dee

Merge lp:~kamstrup/dee/test-fixes into lp:dee

Proposed by Mikkel Kamstrup Erlandsen on 2011-11-29
Status: Rejected
Rejected by: Mikkel Kamstrup Erlandsen on 2011-11-29
Proposed branch: lp:~kamstrup/dee/test-fixes
Merge into: lp:dee
Diff against target: 75 lines (+45/-1)
2 files modified
configure.ac (+13/-0)
tests/Makefile.am (+32/-1)
To merge this branch: bzr merge lp:~kamstrup/dee/test-fixes
Reviewer Review Type Date Requested Status
Mikkel Kamstrup Erlandsen (community) Disapprove on 2011-11-29
Review via email: mp+83743@code.launchpad.net

Description of the change

Add a headless mode for the test suite. It is disabled by default, and can be enabled with --enable-headless-tests.

To post a comment you must log in.

Rejected as this change is not necessary for Dee because it uses dbus-test-runner

review: Disapprove

Unmerged revisions

309. By Mikkel Kamstrup Erlandsen on 2011-11-29

Add a headless mode for the test suite. It is disabled by default, and can be enabled with --enable-headless-tests.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'configure.ac'
2--- configure.ac 2011-11-19 22:20:23 +0000
3+++ configure.ac 2011-11-29 09:43:24 +0000
4@@ -141,6 +141,18 @@
5
6 AM_CONDITIONAL(ENABLE_TRACE_LOG, test "$enable_trace_log" = "yes")
7
8+dnl Headless tests ============================================================
9+AC_ARG_ENABLE([headless-tests],
10+ AS_HELP_STRING([--enable-headless-tests=@<:@no/yes@:>@],[enable headless test suite (requires Xvfb) @<:@default=no@:>@]),,
11+ [enable_headless_tests=no])
12+
13+AM_CONDITIONAL([ENABLE_HEADLESS_TESTS],[test "x$enable_headless_tests" != "xno"])
14+
15+if test "x$enable_headless_tests" = "xyes"; then
16+ AC_PATH_PROG([XVFB],[Xvfb])
17+ AC_PATH_PROG([DBUS_LAUNCH],[dbus-launch])
18+fi
19+
20 dnl ===========================================================================
21
22 AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
23@@ -185,6 +197,7 @@
24
25 Tests : ${enable_tests}
26 Extended Tests : ${enable_extended_tests}
27+ Headless tests : ${enable_headless_tests}
28 Verbose logging: ${enable_trace_log}
29
30 Extra CFlags : ${CPPFLAGS} $MAINTAINER_CFLAGS
31
32=== modified file 'tests/Makefile.am'
33--- tests/Makefile.am 2011-08-31 19:29:04 +0000
34+++ tests/Makefile.am 2011-11-29 09:43:24 +0000
35@@ -122,8 +122,39 @@
36 > test-dee-results.html ) \
37 && ( xdg-open test-dee-results.html )
38
39-#run make test as part of make check
40+# Run tests as part of make check
41+if ENABLE_HEADLESS_TESTS
42+check-local: test-headless
43+else
44 check-local: test
45+endif
46
47 clean-generic:
48 rm -rf test-dee-results.xml test-dee-results.html dee-test-resource-manager
49+
50+# START HEADLESS TESTS
51+if ENABLE_HEADLESS_TESTS
52+DISPLAY = :27
53+LOG_PATH = headless-logs
54+test-headless:
55+ set -e; \
56+ export DISPLAY=$(DISPLAY); \
57+ rm -rf $(LOG_PATH); \
58+ mkdir $(LOG_PATH); \
59+ $(XVFB) $(DISPLAY) -screen 0 1024x768x8 > $(LOG_PATH)/Xvfb.out 2>&1 & \
60+ sleep 1; \
61+ \
62+ $(DBUS_LAUNCH) > $(LOG_PATH)/sessionbus.sh; \
63+ source $(LOG_PATH)/sessionbus.sh; \
64+ sleep 1; \
65+ \
66+ make test; \
67+ sleep 1; \
68+ \
69+ kill `grep DBUS_SESSION_BUS_PID $(LOG_PATH)/sessionbus.sh | grep -oE '[0-9]+'`; \
70+ pkill Xvfb;
71+
72+endif
73+# END HEADLESS TESTS
74+
75+

Subscribers

People subscribed via source and target branches