if (DBUS_ENABLE_EMBEDDED_TESTS)
set (DBUS_UTIL_SOURCES
${DBUS_UTIL_SOURCES}
- ${DBUS_DIR}/dbus-spawn-test.c
${DBUS_DIR}/dbus-test-wrappers.c
)
endif (DBUS_ENABLE_EMBEDDED_TESTS)
add_helper_executable(test-privserver ${TEST_DIR}/test-privserver.c dbus-testutils)
add_helper_executable(test-shell-service ${test-shell-service_SOURCES} dbus-testutils)
add_helper_executable(test-spawn ${test-spawn_SOURCES} ${DBUS_INTERNAL_LIBRARIES})
+if(NOT WINCE)
+ add_test_executable(test-spawn-oom ${TEST_DIR}/internals/spawn-oom.c ${DBUS_INTERNAL_LIBRARIES})
+endif()
add_helper_executable(test-exit ${test-exit_SOURCES} ${DBUS_INTERNAL_LIBRARIES})
# the second argument of add_helper_executable() is a whitespace-separated
# list of source files and the third and subsequent arguments are libraries
if DBUS_ENABLE_EMBEDDED_TESTS
DBUS_UTIL_SOURCES += \
- dbus-spawn-test.c \
dbus-test-wrappers.c \
dbus-test-wrappers.h \
$(NULL)
{ "transport-unix", _dbus_transport_unix_test },
#endif
-#if !defined(DBUS_WINCE)
- { "spawn", _dbus_spawn_test },
-#endif
-
{ NULL }
};
dbus_bool_t _dbus_data_slot_test (const char *test_data_dir);
dbus_bool_t _dbus_sysdeps_test (const char *test_data_dir);
-dbus_bool_t _dbus_spawn_test (const char *test_data_dir);
DBUS_PRIVATE_EXPORT
dbus_bool_t _dbus_userdb_test (const char *test_data_dir);
EXTRA_DIST += tap-test.sh.in
TESTS =
+noinst_PROGRAMS =
if DBUS_ENABLE_EMBEDDED_TESTS
+
+uninstallable_test_programs =
+
## break-loader removed for now
## these binaries are used in tests but are not themselves tests
TEST_BINARIES = \
test-shell-service \
$(NULL)
+if !DBUS_WINCE
+uninstallable_test_programs += test-spawn-oom
+endif
+
## These are conceptually part of directories that come earlier in SUBDIRS
## order, but we don't want to run them til we arrive in this directory,
## since they depend on stuff from this directory. We wrap some of them in a
TESTS += ../dbus/test-dbus$(EXEEXT)
+noinst_PROGRAMS += $(uninstallable_test_programs)
+TESTS += $(uninstallable_test_programs)
+
else !DBUS_ENABLE_EMBEDDED_TESTS
TEST_BINARIES=
endif !DBUS_ENABLE_EMBEDDED_TESTS
-noinst_PROGRAMS= $(TEST_BINARIES)
+noinst_PROGRAMS += $(TEST_BINARIES)
# This helper is meant to crash, so if we're compiling the rest with
# AddressSanitizer, we need to stop it from catching the SIGSEGV and
test_shell_LDADD = libdbus-testutils.la
test_spawn_SOURCES = spawn-test.c
test_spawn_LDADD = $(top_builddir)/dbus/libdbus-internal.la
+test_spawn_oom_SOURCES = internals/spawn-oom.c
+test_spawn_oom_LDADD = $(top_builddir)/dbus/libdbus-internal.la
test_assertions_SOURCES = internals/assertions.c
test_assertions_LDADD = libdbus-testutils.la $(GLIB_LIBS)
*/
#include <config.h>
-
-#include "dbus-spawn.h"
-#include "dbus-sysdeps.h"
-#include "dbus-test.h"
+#include "dbus/dbus-internals.h"
+#include "dbus/dbus-spawn.h"
+#include "dbus/dbus-sysdeps.h"
+#include "dbus/dbus-test.h"
+#include "dbus/dbus-test-wrappers.h"
static char *
get_test_exec (const char *exe,
return TRUE;
}
-dbus_bool_t
+static dbus_bool_t
_dbus_spawn_test (const char *test_data_dir)
{
if (!_dbus_test_oom_handling ("spawn_nonexistent",
return TRUE;
}
+
+static DBusTestCase test = { "spawn", _dbus_spawn_test };
+
+int
+main (int argc,
+ char **argv)
+{
+ return _dbus_test_main (argc, argv, 1, &test,
+ DBUS_TEST_FLAGS_CHECK_MEMORY_LEAKS,
+ NULL, NULL);
+}