Merge lp:~ted/dbus-test-runner/fix-coverage into lp:dbus-test-runner/0.1
- fix-coverage
- Merge into trunk
Proposed by
Ted Gould
Status: | Merged |
---|---|
Merged at revision: | 37 |
Proposed branch: | lp:~ted/dbus-test-runner/fix-coverage |
Merge into: | lp:dbus-test-runner/0.1 |
Diff against target: |
399 lines (+222/-24) 2 files modified
src/dbus-test-runner.c (+82/-23) tests/Makefile.am (+140/-1) |
To merge this branch: | bzr merge lp:~ted/dbus-test-runner/fix-coverage |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Neil J. Patel (community) | Approve | ||
Review via email: mp+85211@code.launchpad.net |
Commit message
Description of the change
Provides more tests and some testability to dbus-test-runner. All motivated to increase the code coverage of the test suite.
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/dbus-test-runner.c' | |||
2 | --- src/dbus-test-runner.c 2011-11-28 22:21:06 +0000 | |||
3 | +++ src/dbus-test-runner.c 2011-12-10 03:58:25 +0000 | |||
4 | @@ -49,13 +49,15 @@ | |||
5 | 49 | 49 | ||
6 | 50 | static void check_task_cleanup (task_t * task, gboolean force); | 50 | static void check_task_cleanup (task_t * task, gboolean force); |
7 | 51 | static void start_task (gpointer data, gpointer userdata); | 51 | static void start_task (gpointer data, gpointer userdata); |
8 | 52 | static void bustle_watcher (GPid pid, gint status, gpointer data); | ||
9 | 52 | 53 | ||
10 | 54 | static gchar * bustle_cmd = NULL; | ||
11 | 53 | static gchar * bustle_datafile = NULL; | 55 | static gchar * bustle_datafile = NULL; |
12 | 56 | static guint bustle_watch = 0; | ||
13 | 54 | static GIOChannel * bustle_stdout = NULL; | 57 | static GIOChannel * bustle_stdout = NULL; |
14 | 55 | static GIOChannel * bustle_stderr = NULL; | 58 | static GIOChannel * bustle_stderr = NULL; |
15 | 56 | static GIOChannel * bustle_file = NULL; | 59 | static GIOChannel * bustle_file = NULL; |
16 | 57 | static GPid bustle_pid = 0; | 60 | static GPid bustle_pid = 0; |
17 | 58 | static GList * bustle_watches = NULL; | ||
18 | 59 | static gboolean any_waitfors = FALSE; | 61 | static gboolean any_waitfors = FALSE; |
19 | 60 | 62 | ||
20 | 61 | #define BUSTLE_ERROR_DEFAULT "Bustle" | 63 | #define BUSTLE_ERROR_DEFAULT "Bustle" |
21 | @@ -127,29 +129,27 @@ | |||
22 | 127 | bustle_file = g_io_channel_new_file(bustle_datafile, "w", &error); | 129 | bustle_file = g_io_channel_new_file(bustle_datafile, "w", &error); |
23 | 128 | 130 | ||
24 | 129 | if (error != NULL) { | 131 | if (error != NULL) { |
26 | 130 | g_warning("Unable to open bustle file '%s': %s", bustle_datafile, error->message); | 132 | g_critical("Unable to open bustle file '%s': %s", bustle_datafile, error->message); |
27 | 131 | g_error_free(error); | 133 | g_error_free(error); |
28 | 132 | g_free(bustle_datafile); | 134 | g_free(bustle_datafile); |
29 | 133 | bustle_datafile = NULL; | 135 | bustle_datafile = NULL; |
30 | 136 | global_success = FALSE; | ||
31 | 137 | g_main_loop_quit(global_mainloop); | ||
32 | 134 | return; | 138 | return; |
33 | 135 | } | 139 | } |
34 | 136 | 140 | ||
35 | 137 | gint bustle_stdout_num; | 141 | gint bustle_stdout_num; |
36 | 138 | gint bustle_stderr_num; | 142 | gint bustle_stderr_num; |
37 | 139 | 143 | ||
40 | 140 | gchar ** bustle_monitor = g_new0(gchar *, g_list_length(bustle_watches) + 3); | 144 | gchar ** bustle_monitor = g_new0(gchar *, 3); |
41 | 141 | bustle_monitor[0] = "bustle-dbus-monitor"; | 145 | bustle_monitor[0] = (gchar *)bustle_cmd; |
42 | 142 | bustle_monitor[1] = "--session"; | 146 | bustle_monitor[1] = "--session"; |
43 | 143 | int i; | ||
44 | 144 | for (i = 0; i < g_list_length(bustle_watches); i++) { | ||
45 | 145 | bustle_monitor[i + 2] = (gchar *)g_list_nth(bustle_watches, i)->data; | ||
46 | 146 | } | ||
47 | 147 | 147 | ||
48 | 148 | g_spawn_async_with_pipes(g_get_current_dir(), | 148 | g_spawn_async_with_pipes(g_get_current_dir(), |
49 | 149 | bustle_monitor, /* argv */ | 149 | bustle_monitor, /* argv */ |
50 | 150 | NULL, /* envp */ | 150 | NULL, /* envp */ |
51 | 151 | /* G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL, */ /* flags */ | 151 | /* G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL, */ /* flags */ |
53 | 152 | G_SPAWN_SEARCH_PATH, /* flags */ | 152 | G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, /* flags */ |
54 | 153 | NULL, /* child setup func */ | 153 | NULL, /* child setup func */ |
55 | 154 | NULL, /* child setup data */ | 154 | NULL, /* child setup data */ |
56 | 155 | &bustle_pid, /* PID */ | 155 | &bustle_pid, /* PID */ |
57 | @@ -159,11 +159,16 @@ | |||
58 | 159 | &error); /* error */ | 159 | &error); /* error */ |
59 | 160 | 160 | ||
60 | 161 | if (error != NULL) { | 161 | if (error != NULL) { |
62 | 162 | g_warning("Unable to start bustling data: %s", error->message); | 162 | g_critical("Unable to start bustling data: %s", error->message); |
63 | 163 | g_error_free(error); | ||
64 | 164 | bustle_pid = 0; | ||
65 | 165 | global_success = FALSE; | ||
66 | 166 | g_main_loop_quit(global_mainloop); | ||
67 | 163 | return; | 167 | return; |
68 | 164 | } | 168 | } |
69 | 165 | 169 | ||
70 | 166 | g_debug("Starting bustle monitor. PID: %d", bustle_pid); | 170 | g_debug("Starting bustle monitor. PID: %d", bustle_pid); |
71 | 171 | bustle_watch = g_child_watch_add(bustle_pid, bustle_watcher, NULL); | ||
72 | 167 | 172 | ||
73 | 168 | bustle_stdout = g_io_channel_unix_new(bustle_stdout_num); | 173 | bustle_stdout = g_io_channel_unix_new(bustle_stdout_num); |
74 | 169 | g_io_add_watch(bustle_stdout, | 174 | g_io_add_watch(bustle_stdout, |
75 | @@ -187,6 +192,14 @@ | |||
76 | 187 | return; | 192 | return; |
77 | 188 | } | 193 | } |
78 | 189 | 194 | ||
79 | 195 | if (bustle_watch != 0) { | ||
80 | 196 | g_source_remove(bustle_watch); | ||
81 | 197 | } | ||
82 | 198 | |||
83 | 199 | if (bustle_pid == 0) { | ||
84 | 200 | return; | ||
85 | 201 | } | ||
86 | 202 | |||
87 | 190 | gchar * killline = g_strdup_printf("kill -INT %d", bustle_pid); | 203 | gchar * killline = g_strdup_printf("kill -INT %d", bustle_pid); |
88 | 191 | g_spawn_command_line_sync(killline, NULL, NULL, NULL, NULL); | 204 | g_spawn_command_line_sync(killline, NULL, NULL, NULL, NULL); |
89 | 192 | g_free(killline); | 205 | g_free(killline); |
90 | @@ -281,6 +294,36 @@ | |||
91 | 281 | } | 294 | } |
92 | 282 | 295 | ||
93 | 283 | static void | 296 | static void |
94 | 297 | dbus_watcher (GPid pid, gint status, gpointer data) | ||
95 | 298 | { | ||
96 | 299 | g_critical("DBus Daemon exited abruptly!"); | ||
97 | 300 | |||
98 | 301 | global_success = FALSE; | ||
99 | 302 | g_main_loop_quit(global_mainloop); | ||
100 | 303 | |||
101 | 304 | if (pid != 0) { | ||
102 | 305 | g_spawn_close_pid(pid); | ||
103 | 306 | } | ||
104 | 307 | |||
105 | 308 | return; | ||
106 | 309 | } | ||
107 | 310 | |||
108 | 311 | static void | ||
109 | 312 | bustle_watcher (GPid pid, gint status, gpointer data) | ||
110 | 313 | { | ||
111 | 314 | g_critical("Bustle Monitor exited abruptly!"); | ||
112 | 315 | |||
113 | 316 | global_success = FALSE; | ||
114 | 317 | g_main_loop_quit(global_mainloop); | ||
115 | 318 | |||
116 | 319 | if (pid != 0) { | ||
117 | 320 | g_spawn_close_pid(pid); | ||
118 | 321 | } | ||
119 | 322 | |||
120 | 323 | return; | ||
121 | 324 | } | ||
122 | 325 | |||
123 | 326 | static void | ||
124 | 284 | proc_watcher (GPid pid, gint status, gpointer data) | 327 | proc_watcher (GPid pid, gint status, gpointer data) |
125 | 285 | { | 328 | { |
126 | 286 | task_t * task = (task_t *)data; | 329 | task_t * task = (task_t *)data; |
127 | @@ -404,7 +447,7 @@ | |||
128 | 404 | dbus_writes (GIOChannel * channel, GIOCondition condition, gpointer data) | 447 | dbus_writes (GIOChannel * channel, GIOCondition condition, gpointer data) |
129 | 405 | { | 448 | { |
130 | 406 | if (condition & G_IO_ERR) { | 449 | if (condition & G_IO_ERR) { |
132 | 407 | g_error("DBus writing failure!"); | 450 | g_critical("DBus writing failure!"); |
133 | 408 | return FALSE; | 451 | return FALSE; |
134 | 409 | } | 452 | } |
135 | 410 | 453 | ||
136 | @@ -427,9 +470,14 @@ | |||
137 | 427 | if (tasks != NULL) { | 470 | if (tasks != NULL) { |
138 | 428 | start_bustling(); | 471 | start_bustling(); |
139 | 429 | 472 | ||
141 | 430 | g_list_foreach(tasks, start_task, GINT_TO_POINTER(FALSE)); | 473 | /* If we're still in a place where we can succeed, then |
142 | 474 | we should continue. Otherwise fail. */ | ||
143 | 475 | if (global_success) { | ||
144 | 476 | g_list_foreach(tasks, start_task, GINT_TO_POINTER(FALSE)); | ||
145 | 477 | } | ||
146 | 431 | } else { | 478 | } else { |
147 | 432 | g_print("No tasks!\n"); | 479 | g_print("No tasks!\n"); |
148 | 480 | global_success = FALSE; | ||
149 | 433 | g_main_loop_quit(global_mainloop); | 481 | g_main_loop_quit(global_mainloop); |
150 | 434 | } | 482 | } |
151 | 435 | } | 483 | } |
152 | @@ -540,13 +588,6 @@ | |||
153 | 540 | return TRUE; | 588 | return TRUE; |
154 | 541 | } | 589 | } |
155 | 542 | 590 | ||
156 | 543 | static gboolean | ||
157 | 544 | bustle_watch (const gchar * arg, const gchar * value, gpointer data, GError ** error) | ||
158 | 545 | { | ||
159 | 546 | bustle_watches = g_list_append(bustle_watches, g_strdup(value)); | ||
160 | 547 | return TRUE; | ||
161 | 548 | } | ||
162 | 549 | |||
163 | 550 | static void | 591 | static void |
164 | 551 | length_finder (gpointer data, gpointer udata) | 592 | length_finder (gpointer data, gpointer udata) |
165 | 552 | { | 593 | { |
166 | @@ -636,11 +677,13 @@ | |||
167 | 636 | } | 677 | } |
168 | 637 | 678 | ||
169 | 638 | static gchar * dbus_configfile = NULL; | 679 | static gchar * dbus_configfile = NULL; |
170 | 680 | static gchar * dbus_daemon = NULL; | ||
171 | 639 | 681 | ||
172 | 640 | static GOptionEntry general_options[] = { | 682 | static GOptionEntry general_options[] = { |
173 | 683 | {"dbus-daemon", 0, 0, G_OPTION_ARG_FILENAME, &dbus_daemon, "Path to the DBus deamon to use. Defaults to 'dbus-daemon'.", "executable"}, | ||
174 | 641 | {"dbus-config", 'd', 0, G_OPTION_ARG_FILENAME, &dbus_configfile, "Configuration file for newly created DBus server. Defaults to '" DEFAULT_SESSION_CONF "'.", "config_file"}, | 684 | {"dbus-config", 'd', 0, G_OPTION_ARG_FILENAME, &dbus_configfile, "Configuration file for newly created DBus server. Defaults to '" DEFAULT_SESSION_CONF "'.", "config_file"}, |
175 | 685 | {"bustle-monitor", 0, 0, G_OPTION_ARG_FILENAME, &bustle_cmd, "Path to the Bustle DBus Monitor to use. Defaults to 'bustle-dbus-monitor'.", "executable"}, | ||
176 | 642 | {"bustle-data", 'b', 0, G_OPTION_ARG_FILENAME, &bustle_datafile, "A file to write out data from the bustle logger to.", "data_file"}, | 686 | {"bustle-data", 'b', 0, G_OPTION_ARG_FILENAME, &bustle_datafile, "A file to write out data from the bustle logger to.", "data_file"}, |
177 | 643 | {"bustle-watch", 'w', 0, G_OPTION_ARG_CALLBACK, bustle_watch, "Defines a watch string for the bustle watcher task. (broken)", "filter"}, | ||
178 | 644 | {"max-wait", 'm', 0, G_OPTION_ARG_INT, &max_wait, "The maximum amount of time the test runner will wait for the test to complete. Default is 30 seconds.", "seconds"}, | 687 | {"max-wait", 'm', 0, G_OPTION_ARG_INT, &max_wait, "The maximum amount of time the test runner will wait for the test to complete. Default is 30 seconds.", "seconds"}, |
179 | 645 | {NULL} | 688 | {NULL} |
180 | 646 | }; | 689 | }; |
181 | @@ -683,21 +726,36 @@ | |||
182 | 683 | dbus_configfile = DEFAULT_SESSION_CONF; | 726 | dbus_configfile = DEFAULT_SESSION_CONF; |
183 | 684 | } | 727 | } |
184 | 685 | 728 | ||
185 | 729 | if (dbus_daemon == NULL) { | ||
186 | 730 | dbus_daemon = "dbus-daemon"; | ||
187 | 731 | } | ||
188 | 732 | |||
189 | 733 | if (bustle_cmd == NULL) { | ||
190 | 734 | bustle_cmd = "bustle-dbus-monitor"; | ||
191 | 735 | } | ||
192 | 736 | |||
193 | 686 | gint dbus_stdout; | 737 | gint dbus_stdout; |
194 | 687 | GPid dbus; | 738 | GPid dbus; |
195 | 688 | gchar * blank[1] = {NULL}; | 739 | gchar * blank[1] = {NULL}; |
197 | 689 | gchar * dbus_startup[] = {"dbus-daemon", "--config-file", dbus_configfile, "--print-address", NULL}; | 740 | gchar * dbus_startup[] = {dbus_daemon, "--config-file", dbus_configfile, "--print-address", NULL}; |
198 | 690 | g_spawn_async_with_pipes(g_get_current_dir(), | 741 | g_spawn_async_with_pipes(g_get_current_dir(), |
199 | 691 | dbus_startup, /* argv */ | 742 | dbus_startup, /* argv */ |
200 | 692 | blank, /* envp */ | 743 | blank, /* envp */ |
202 | 693 | G_SPAWN_SEARCH_PATH, /* flags */ | 744 | G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, /* flags */ |
203 | 694 | NULL, /* child setup func */ | 745 | NULL, /* child setup func */ |
204 | 695 | NULL, /* child setup data */ | 746 | NULL, /* child setup data */ |
205 | 696 | &dbus, /* PID */ | 747 | &dbus, /* PID */ |
206 | 697 | NULL, /* stdin */ | 748 | NULL, /* stdin */ |
207 | 698 | &dbus_stdout, /* stdout */ | 749 | &dbus_stdout, /* stdout */ |
208 | 699 | NULL, /* stderr */ | 750 | NULL, /* stderr */ |
210 | 700 | NULL); /* error */ | 751 | &error); /* error */ |
211 | 752 | |||
212 | 753 | if (error != NULL) { | ||
213 | 754 | g_critical("Unable to start dbus daemon: %s", error->message); | ||
214 | 755 | return 1; | ||
215 | 756 | } | ||
216 | 757 | |||
217 | 758 | guint dbus_watch = g_child_watch_add(dbus, dbus_watcher, NULL); | ||
218 | 701 | 759 | ||
219 | 702 | GIOChannel * dbus_io = g_io_channel_unix_new(dbus_stdout); | 760 | GIOChannel * dbus_io = g_io_channel_unix_new(dbus_stdout); |
220 | 703 | g_io_add_watch(dbus_io, | 761 | g_io_add_watch(dbus_io, |
221 | @@ -714,6 +772,7 @@ | |||
222 | 714 | 772 | ||
223 | 715 | stop_bustling(); | 773 | stop_bustling(); |
224 | 716 | 774 | ||
225 | 775 | g_source_remove(dbus_watch); /* Let's not error when we want to kill it */ | ||
226 | 717 | gchar * killline = g_strdup_printf("kill -9 %d", dbus); | 776 | gchar * killline = g_strdup_printf("kill -9 %d", dbus); |
227 | 718 | g_spawn_command_line_sync(killline, NULL, NULL, NULL, NULL); | 777 | g_spawn_command_line_sync(killline, NULL, NULL, NULL, NULL); |
228 | 719 | g_free(killline); | 778 | g_free(killline); |
229 | 720 | 779 | ||
230 | === modified file 'tests/Makefile.am' | |||
231 | --- tests/Makefile.am 2011-11-28 22:21:06 +0000 | |||
232 | +++ tests/Makefile.am 2011-12-10 03:58:25 +0000 | |||
233 | @@ -1,5 +1,5 @@ | |||
234 | 1 | 1 | ||
236 | 2 | DBUS_RUNNER=../src/dbus-test-runner --dbus-config $(srcdir)/../data/session.conf | 2 | DBUS_RUNNER=$(top_builddir)/src/dbus-test-runner --dbus-config $(srcdir)/../data/session.conf |
237 | 3 | TESTS = | 3 | TESTS = |
238 | 4 | DISTCLEANFILES = $(TESTS) | 4 | DISTCLEANFILES = $(TESTS) |
239 | 5 | XFAIL_TESTS = | 5 | XFAIL_TESTS = |
240 | @@ -57,6 +57,96 @@ | |||
241 | 57 | @chmod +x $@ | 57 | @chmod +x $@ |
242 | 58 | XFAIL_TESTS += test-timeout | 58 | XFAIL_TESTS += test-timeout |
243 | 59 | 59 | ||
244 | 60 | TESTS += test-timeout-disable | ||
245 | 61 | test-timeout-disable: Makefile.am | ||
246 | 62 | @echo "#!/bin/sh" > $@ | ||
247 | 63 | @echo $(DBUS_RUNNER) --max-wait 0 --task true >> $@ | ||
248 | 64 | @chmod +x $@ | ||
249 | 65 | |||
250 | 66 | TESTS += test-param-only-name | ||
251 | 67 | test-param-only-name: Makefile.am | ||
252 | 68 | @echo "#!/bin/sh" > $@ | ||
253 | 69 | @echo $(DBUS_RUNNER) --task-name Name >> $@ | ||
254 | 70 | @chmod +x $@ | ||
255 | 71 | XFAIL_TESTS += test-param-only-name | ||
256 | 72 | |||
257 | 73 | TESTS += test-param-dup-name | ||
258 | 74 | test-param-dup-name: Makefile.am | ||
259 | 75 | @echo "#!/bin/sh" > $@ | ||
260 | 76 | @echo $(DBUS_RUNNER) --task true --task-name Name --task-name Name2 >> $@ | ||
261 | 77 | @chmod +x $@ | ||
262 | 78 | XFAIL_TESTS += test-param-dup-name | ||
263 | 79 | |||
264 | 80 | TESTS += test-param-only-ignore | ||
265 | 81 | test-param-only-ignore: Makefile.am | ||
266 | 82 | @echo "#!/bin/sh" > $@ | ||
267 | 83 | @echo $(DBUS_RUNNER) --ignore-return >> $@ | ||
268 | 84 | @chmod +x $@ | ||
269 | 85 | XFAIL_TESTS += test-param-only-ignore | ||
270 | 86 | |||
271 | 87 | TESTS += test-param-only-invert | ||
272 | 88 | test-param-only-invert: Makefile.am | ||
273 | 89 | @echo "#!/bin/sh" > $@ | ||
274 | 90 | @echo $(DBUS_RUNNER) --invert-return >> $@ | ||
275 | 91 | @chmod +x $@ | ||
276 | 92 | XFAIL_TESTS += test-param-only-invert | ||
277 | 93 | |||
278 | 94 | TESTS += test-param-multi-return-invert | ||
279 | 95 | test-param-multi-return-invert: Makefile.am | ||
280 | 96 | @echo "#!/bin/sh" > $@ | ||
281 | 97 | @echo $(DBUS_RUNNER) --task true --ignore-return --invert-return >> $@ | ||
282 | 98 | @chmod +x $@ | ||
283 | 99 | XFAIL_TESTS += test-param-multi-return-invert | ||
284 | 100 | |||
285 | 101 | TESTS += test-param-multi-return-ignore | ||
286 | 102 | test-param-multi-return-ignore: Makefile.am | ||
287 | 103 | @echo "#!/bin/sh" > $@ | ||
288 | 104 | @echo $(DBUS_RUNNER) --task true --invert-return --ignore-return >> $@ | ||
289 | 105 | @chmod +x $@ | ||
290 | 106 | XFAIL_TESTS += test-param-multi-return-ignore | ||
291 | 107 | |||
292 | 108 | TESTS += test-param-only-param | ||
293 | 109 | test-param-only-param: Makefile.am | ||
294 | 110 | @echo "#!/bin/sh" > $@ | ||
295 | 111 | @echo $(DBUS_RUNNER) --parameter bob >> $@ | ||
296 | 112 | @chmod +x $@ | ||
297 | 113 | XFAIL_TESTS += test-param-only-param | ||
298 | 114 | |||
299 | 115 | TESTS += test-param-only-wait | ||
300 | 116 | test-param-only-wait: Makefile.am | ||
301 | 117 | @echo "#!/bin/sh" > $@ | ||
302 | 118 | @echo $(DBUS_RUNNER) --wait-for org.test.test >> $@ | ||
303 | 119 | @chmod +x $@ | ||
304 | 120 | XFAIL_TESTS += test-param-only-wait | ||
305 | 121 | |||
306 | 122 | TESTS += test-param-multi-wait | ||
307 | 123 | test-param-multi-wait: Makefile.am | ||
308 | 124 | @echo "#!/bin/sh" > $@ | ||
309 | 125 | @echo $(DBUS_RUNNER) --task true --wait-for org.test.test --wait-for org.test.test2 >> $@ | ||
310 | 126 | @chmod +x $@ | ||
311 | 127 | XFAIL_TESTS += test-param-multi-wait | ||
312 | 128 | |||
313 | 129 | TESTS += test-param-bad | ||
314 | 130 | test-param-bad: Makefile.am | ||
315 | 131 | @echo "#!/bin/sh" > $@ | ||
316 | 132 | @echo $(DBUS_RUNNER) --this-is-most-surly-not-a-real-parameter >> $@ | ||
317 | 133 | @chmod +x $@ | ||
318 | 134 | XFAIL_TESTS += test-param-bad | ||
319 | 135 | |||
320 | 136 | TESTS += test-param-bad-task | ||
321 | 137 | test-param-bad-task: Makefile.am | ||
322 | 138 | @echo "#!/bin/sh" > $@ | ||
323 | 139 | @echo $(DBUS_RUNNER) --task this-is-most-surly-not-a-real-program >> $@ | ||
324 | 140 | @chmod +x $@ | ||
325 | 141 | XFAIL_TESTS += test-param-bad-task | ||
326 | 142 | |||
327 | 143 | TESTS += test-no-tasks | ||
328 | 144 | test-no-tasks: Makefile.am | ||
329 | 145 | @echo "#!/bin/sh" > $@ | ||
330 | 146 | @echo $(DBUS_RUNNER) >> $@ | ||
331 | 147 | @chmod +x $@ | ||
332 | 148 | XFAIL_TESTS += test-no-tasks | ||
333 | 149 | |||
334 | 60 | TESTS += test-output | 150 | TESTS += test-output |
335 | 61 | test-output: Makefile.am | 151 | test-output: Makefile.am |
336 | 62 | @echo "#!/bin/sh -e" > $@ | 152 | @echo "#!/bin/sh -e" > $@ |
337 | @@ -85,6 +175,29 @@ | |||
338 | 85 | @chmod +x $@ | 175 | @chmod +x $@ |
339 | 86 | DISTCLEANFILES += test-bustle.bustle test-bustle.filtered | 176 | DISTCLEANFILES += test-bustle.bustle test-bustle.filtered |
340 | 87 | 177 | ||
341 | 178 | TESTS += test-bustle-bad-file | ||
342 | 179 | test-bustle-bad-file: Makefile.am | ||
343 | 180 | @echo "#!/bin/sh -e" > $@ | ||
344 | 181 | @echo $(DBUS_RUNNER) --bustle-data \"$(builddir)\" --task true >> $@ | ||
345 | 182 | @chmod +x $@ | ||
346 | 183 | XFAIL_TESTS += test-bustle-bad-file | ||
347 | 184 | |||
348 | 185 | TESTS += test-bustle-bad-monitor | ||
349 | 186 | test-bustle-bad-monitor: Makefile.am | ||
350 | 187 | @echo "#!/bin/sh -e" > $@ | ||
351 | 188 | @echo $(DBUS_RUNNER) --bustle-monitor probably-doesnt-exist --bustle-data \"$(builddir)/test-bustle-bad-monitor.bustle\" --task true >> $@ | ||
352 | 189 | @chmod +x $@ | ||
353 | 190 | XFAIL_TESTS += test-bustle-bad-monitor | ||
354 | 191 | DISTCLEANFILES += test-bustle-bad-monitor.bustle | ||
355 | 192 | |||
356 | 193 | TESTS += test-bustle-bad-monitor-error | ||
357 | 194 | test-bustle-bad-monitor-error: Makefile.am | ||
358 | 195 | @echo "#!/bin/sh -e" > $@ | ||
359 | 196 | @echo $(DBUS_RUNNER) --bustle-monitor sleep --bustle-data \"$(builddir)/test-bustle-bad-monitor-error.bustle\" --task true >> $@ | ||
360 | 197 | @chmod +x $@ | ||
361 | 198 | XFAIL_TESTS += test-bustle-bad-monitor-error | ||
362 | 199 | DISTCLEANFILES += test-bustle-bad-monitor-error.bustle | ||
363 | 200 | |||
364 | 88 | TESTS += test-bustle-data | 201 | TESTS += test-bustle-data |
365 | 89 | test-bustle-data: Makefile.am | 202 | test-bustle-data: Makefile.am |
366 | 90 | @echo "#!/bin/sh -e" > $@ | 203 | @echo "#!/bin/sh -e" > $@ |
367 | @@ -126,6 +239,32 @@ | |||
368 | 126 | @echo $(DBUS_RUNNER) --task $(builddir)/test-check-name --parameter org.test.name --wait-for org.test.name --task $(builddir)/test-own-name --parameter org.test.name --ignore-return >> $@ | 239 | @echo $(DBUS_RUNNER) --task $(builddir)/test-check-name --parameter org.test.name --wait-for org.test.name --task $(builddir)/test-own-name --parameter org.test.name --ignore-return >> $@ |
369 | 127 | @chmod +x $@ | 240 | @chmod +x $@ |
370 | 128 | 241 | ||
371 | 242 | TESTS += test-daemon-bad | ||
372 | 243 | test-daemon-bad: Makefile.am | ||
373 | 244 | @echo "#!/bin/sh" > $@ | ||
374 | 245 | @echo $(DBUS_RUNNER) --dbus-daemon false --task true >> $@ | ||
375 | 246 | @chmod +x $@ | ||
376 | 247 | XFAIL_TESTS += test-daemon-bad | ||
377 | 248 | |||
378 | 249 | TESTS += test-daemon-missing | ||
379 | 250 | test-daemon-missing: Makefile.am | ||
380 | 251 | @echo "#!/bin/sh" > $@ | ||
381 | 252 | @echo $(DBUS_RUNNER) --dbus-daemon probably-doesnt-exist --task true >> $@ | ||
382 | 253 | @chmod +x $@ | ||
383 | 254 | XFAIL_TESTS += test-daemon-missing | ||
384 | 255 | |||
385 | 256 | TESTS += test-daemon-junk | ||
386 | 257 | test-daemon-junk: Makefile.am test-daemon-junk-spitter | ||
387 | 258 | @echo "#!/bin/sh" > $@ | ||
388 | 259 | @echo $(DBUS_RUNNER) --dbus-daemon $(builddir)/test-daemon-junk-spitter --task true >> $@ | ||
389 | 260 | @chmod +x $@ | ||
390 | 261 | test-daemon-junk-spitter: Makefile.am | ||
391 | 262 | @echo "#!/bin/sh" > $@ | ||
392 | 263 | @echo cat $(top_builddir)/src/dbus-test-runner >> $@ | ||
393 | 264 | @chmod +x $@ | ||
394 | 265 | XFAIL_TESTS += test-daemon-junk | ||
395 | 266 | DISTCLEANFILES += test-daemon-junk-spitter | ||
396 | 267 | |||
397 | 129 | EXTRA_DIST = \ | 268 | EXTRA_DIST = \ |
398 | 130 | delayrm.sh \ | 269 | delayrm.sh \ |
399 | 131 | test-bustle.reference \ | 270 | test-bustle.reference \ |
Looks good, approved.