------------------------------------------------------------
revno: 1566
committer: Dmitrijs Ledkovs <[email protected]>
branch nick: upstart
timestamp: Mon 2013-11-11 10:13:08 +0000
message:
Introduce TAP output, mark failing tests as TODO, unset environment
variables that cause test suite failures.
modified:
configure.ac
init/Makefile.am
init/tests/test_job_process.c
lib/Makefile.am
test/Makefile.am
util/Makefile.am
util/tests/test_initctl.c
--
lp:upstart
https://code.launchpad.net/~upstart-devel/upstart/trunk
Your team Upstart Reviewers is subscribed to branch lp:upstart.
To unsubscribe from this branch go to
https://code.launchpad.net/~upstart-devel/upstart/trunk/+edit-subscription
=== modified file 'configure.ac'
--- configure.ac 2013-11-05 15:08:36 +0000
+++ configure.ac 2013-11-11 10:13:08 +0000
@@ -20,6 +20,8 @@
# Checks for programs.
AC_PROG_CC
+AC_PROG_CC_C99
+AM_PROG_CC_C_O
PKG_PROG_PKG_CONFIG([0.22])
AC_PATH_PROG([NIH_DBUS_TOOL], [nih-dbus-tool])
@@ -67,6 +69,14 @@
test "$have_gio" = yes &&
test "$dconf_bridge" = yes])
+AC_CHECK_DECL([TEST_PLAN],[
+have_tap=yes
+AC_REQUIRE_AUX_FILE([tap-driver.sh])
+AC_DEFINE([NIH_TAP_OUTPUT], [1], [Do not abort on test failure])
+],[have_tap=no],[[#include <nih/test.h>]])
+AM_CONDITIONAL([ENABLE_TAP_OUTPUT], [test "$have_tap" = "yes"])
+
+
# Reasons for requiring this library version:
#
# 1) RFC 4627, the JSON "memo" (it is *NOT* a standard!) helpfully fails
@@ -102,8 +112,6 @@
AC_CHECK_HEADERS([valgrind/valgrind.h, sys/prctl.h])
# Checks for typedefs, structures, and compiler characteristics.
-AC_PROG_CC_C99
-AM_PROG_CC_C_O
NIH_C_THREAD
AC_CHECK_SIZEOF(int)
=== modified file 'init/Makefile.am'
--- init/Makefile.am 2013-10-24 12:35:33 +0000
+++ init/Makefile.am 2013-11-11 10:13:08 +0000
@@ -166,6 +166,19 @@
test_control \
test_main
+if ENABLE_TAP_OUTPUT
+LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh
+endif
+
+AM_TESTS_ENVIRONMENT= \
+ unset -v \
+ XDG_RUNTIME_DIR \
+ DBUS_SESSION_BUS_ADDRESS \
+ UPSTART_SESSION \
+ UPSTART_INSTANCE \
+ UPSTART_EVENTS \
+ UPSTART_JOB;
+
TESTS = \
$(upstart_test_programs) \
test_conf_preload.sh$(EXEEXT)
=== modified file 'init/tests/test_job_process.c'
--- init/tests/test_job_process.c 2013-10-03 14:43:24 +0000
+++ init/tests/test_job_process.c 2013-11-11 10:13:08 +0000
@@ -9371,6 +9371,9 @@
*/
argv0 = argv[0];
if (argv0[0] != '/') {
+#ifdef TEST_PLAN
+ TEST_PLAN(153);
+#endif
char *path = nih_alloc (NULL, PATH_MAX);
assert (getcwd (path, PATH_MAX));
=== modified file 'lib/Makefile.am'
--- lib/Makefile.am 2013-11-07 14:50:18 +0000
+++ lib/Makefile.am 2013-11-11 10:13:08 +0000
@@ -94,6 +94,10 @@
$< > $@
chmod +x $@
+if ENABLE_TAP_OUTPUT
+LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh
+endif
+
TESTS = test_libupstart
check_PROGRAMS = $(TESTS)
check_SCRIPTS = run_abi_checker.sh
=== modified file 'test/Makefile.am'
--- test/Makefile.am 2013-10-16 12:39:07 +0000
+++ test/Makefile.am 2013-11-11 10:13:08 +0000
@@ -22,6 +22,10 @@
test_util_common.c \
test_util_common.h
+if ENABLE_TAP_OUTPUT
+LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh
+endif
+
TESTS = test_util_check_env
check_PROGRAMS = $(TESTS)
=== modified file 'util/Makefile.am'
--- util/Makefile.am 2013-11-08 14:29:58 +0000
+++ util/Makefile.am 2013-11-11 10:13:08 +0000
@@ -182,7 +182,19 @@
rm -f "$(DESTDIR)$(sbindir)/$$file"; \
done
-AM_TESTS_ENVIRONMENT=unset -v XDG_RUNTIME_DIR HOME DBUS_SESSION_BUS_ADDRESS UPSTART_SESSION UPSTART_INSTANCE UPSTART_EVENTS UPSTART_JOB;
+AM_TESTS_ENVIRONMENT= \
+ unset -v \
+ XDG_RUNTIME_DIR \
+ DBUS_SESSION_BUS_ADDRESS \
+ UPSTART_SESSION \
+ UPSTART_INSTANCE \
+ UPSTART_EVENTS \
+ UPSTART_JOB;
+
+if ENABLE_TAP_OUTPUT
+LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh
+endif
+
TESTS = \
test_initctl \
test_utmp \
=== modified file 'util/tests/test_initctl.c'
--- util/tests/test_initctl.c 2013-11-07 14:50:42 +0000
+++ util/tests/test_initctl.c 2013-11-11 10:13:08 +0000
@@ -10988,6 +10988,13 @@
TEST_EQ (unsetenv ("UPSTART_CONFDIR"), 0);
TEST_EQ (unsetenv ("UPSTART_LOGDIR"), 0);
+
+ if (! getenv ("XDG_RUNTIME_DIR")) {
+ TEST_GROUP ("set-env rexec # TODO fails without XDG_RUNTIME_DIR set");
+ TEST_FAILED ();
+ return;
+ } else {
+
/*******************************************************************/
TEST_FEATURE ("ensure 'set-env' persists across session-init re-exec");
@@ -11049,6 +11056,8 @@
assert0 (unlink (logfile));
DELETE_FILE (confdir, "foo.conf");
+ }
+
/*******************************************************************/
TEST_FEATURE ("ensure 'set-env --global' persists across session-init re-exec");
@@ -15783,7 +15792,13 @@
FILE *err;
NihCommand command;
char *args[2];
- int ret = 0;
+ int ret = 0;
+
+ if (! getenv ("XDG_RUNTIME_DIR")) {
+ TEST_GROUP ("usage # TODO fails without XDG_RUNTIME_DIR set");
+ TEST_FAILED ();
+ return;
+ }
TEST_GROUP ("usage");
--
upstart-devel mailing list
[email protected]
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/upstart-devel