From a92553d485e04ce77c689c9e33ac92f54fbd0424 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Sat, 11 Jan 2014 10:07:21 +0100 Subject: [PATCH 3/3] Rename spawn-test application to test-spawn to match mostly tests. --- cmake/test/CMakeLists.txt | 6 +++--- test/.gitignore | 2 +- test/Makefile.am | 6 +++--- test/spawn-test.c | 42 ------------------------------------------ test/test-spawn.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 5 Dateien geändert, 49 Zeilen hinzugefügt(+), 49 Zeilen entfernt(-) delete mode 100644 test/spawn-test.c create mode 100644 test/test-spawn.c diff --git a/cmake/test/CMakeLists.txt b/cmake/test/CMakeLists.txt index 8af38dd..d0a1ecc 100644 --- a/cmake/test/CMakeLists.txt +++ b/cmake/test/CMakeLists.txt @@ -31,8 +31,8 @@ set (test-shell_SOURCES ${CMAKE_SOURCE_DIR}/../test/test-shell.c ) -set (spawn-test_SOURCES - ${CMAKE_SOURCE_DIR}/../test/spawn-test.c +set (test-spawn_SOURCES + ${CMAKE_SOURCE_DIR}/../test/test-spawn.c ) set (test-exit_SOURCES @@ -52,7 +52,7 @@ add_helper_executable(test-names ${test-names_SOURCES} dbus-testutils) add_test_executable(test-shell ${test-shell_SOURCES} ${DBUS_INTERNAL_LIBRARIES}) add_test_executable(test-printf ${CMAKE_SOURCE_DIR}/../test/internals/printf.c dbus-testutils) add_helper_executable(test-shell-service ${test-shell-service_SOURCES} dbus-testutils) -add_helper_executable(spawn-test ${spawn-test_SOURCES} ${DBUS_INTERNAL_LIBRARIES}) +add_helper_executable(test-spawn ${test-spawn_SOURCES} ${DBUS_INTERNAL_LIBRARIES}) add_helper_executable(test-exit ${test-exit_SOURCES} ${DBUS_INTERNAL_LIBRARIES}) add_helper_executable(test-segfault ${test-segfault_SOURCES} ${DBUS_INTERNAL_LIBRARIES}) add_helper_executable(test-sleep-forever ${test-sleep-forever_SOURCES} ${DBUS_INTERNAL_LIBRARIES}) diff --git a/test/.gitignore b/test/.gitignore index 814a35c..71b3cec 100644 --- a/test/.gitignore +++ b/test/.gitignore @@ -14,7 +14,7 @@ unbase64 *.da *.gcov break-loader -spawn-test +test-spawn test-corrupt test-exit test-segfault diff --git a/test/Makefile.am b/test/Makefile.am index 06d06e3..36921e6 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -61,7 +61,7 @@ if DBUS_ENABLE_EMBEDDED_TESTS ## break-loader removed for now ## these binaries are used in tests but are not themselves tests TEST_BINARIES = \ - spawn-test \ + test-spawn \ test-exit \ test-names \ test-segfault \ @@ -102,8 +102,8 @@ test_shell_service_CPPFLAGS = $(static_cppflags) test_shell_service_LDADD = libdbus-testutils-internal.la test_shell_CPPFLAGS = $(static_cppflags) test_shell_LDADD = libdbus-testutils-internal.la -spawn_test_CPPFLAGS = $(static_cppflags) -spawn_test_LDADD = $(top_builddir)/dbus/libdbus-internal.la +test_spawn_CPPFLAGS = $(static_cppflags) +test_spawn_LDADD = $(top_builddir)/dbus/libdbus-internal.la test_printf_SOURCES = internals/printf.c test_printf_CPPFLAGS = $(static_cppflags) diff --git a/test/spawn-test.c b/test/spawn-test.c deleted file mode 100644 index 723a488..0000000 --- a/test/spawn-test.c +++ /dev/null @@ -1,42 +0,0 @@ -#include -#include - -#include -#include -#include - -static void -setup_func (void *data) -{ - printf ("entering setup func.\n"); -} - -int -main (int argc, char **argv) -{ - char **argv_copy; - int i; - DBusError error; - - if (argc < 2) - { - fprintf (stderr, "You need to specify a program to launch.\n"); - - return -1; - } - - argv_copy = dbus_new (char *, argc); - for (i = 0; i < argc - 1; i++) - argv_copy [i] = argv[i + 1]; - argv_copy[argc - 1] = NULL; - - if (!_dbus_spawn_async_with_babysitter (NULL, argv_copy[0], argv_copy, NULL, setup_func, NULL, &error)) - { - fprintf (stderr, "Could not launch application: \"%s\"\n", - error.message); - } - - dbus_free(argv_copy); - - return 0; -} diff --git a/test/test-spawn.c b/test/test-spawn.c new file mode 100644 index 0000000..723a488 --- /dev/null +++ b/test/test-spawn.c @@ -0,0 +1,42 @@ +#include +#include + +#include +#include +#include + +static void +setup_func (void *data) +{ + printf ("entering setup func.\n"); +} + +int +main (int argc, char **argv) +{ + char **argv_copy; + int i; + DBusError error; + + if (argc < 2) + { + fprintf (stderr, "You need to specify a program to launch.\n"); + + return -1; + } + + argv_copy = dbus_new (char *, argc); + for (i = 0; i < argc - 1; i++) + argv_copy [i] = argv[i + 1]; + argv_copy[argc - 1] = NULL; + + if (!_dbus_spawn_async_with_babysitter (NULL, argv_copy[0], argv_copy, NULL, setup_func, NULL, &error)) + { + fprintf (stderr, "Could not launch application: \"%s\"\n", + error.message); + } + + dbus_free(argv_copy); + + return 0; +} -- 1.7.10.4