summaryrefslogtreecommitdiff
path: root/test/name-test/test-threads-init.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2016-02-08 20:28:21 +0000
committerRalf Habacker <ralf.habacker@freenet.de>2016-02-11 02:37:14 +0100
commitfec99c9b3d8318e3abae432f2aca50802a87f90e (patch)
tree1c2b5f8ac1525653ce8e7d72d13e0bf9190aca42 /test/name-test/test-threads-init.c
parent8fd2be6013e3d0ff6a6ff63ea022f9606d9a87c6 (diff)
downloaddbus-fec99c9b3d8318e3abae432f2aca50802a87f90e.tar.gz
name-test C tests: produce structured (TAP) output
Similar to commit 58eefa1031e14cb402ed0aae85e6bce1ba030a28. test-privserver is a helper executable, not a test. I moved its output from stdout to stderr so it can't be misinterpreted as the test's stdout. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92899 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Diffstat (limited to 'test/name-test/test-threads-init.c')
-rw-r--r--test/name-test/test-threads-init.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/name-test/test-threads-init.c b/test/name-test/test-threads-init.c
index a517e2a2..62857158 100644
--- a/test/name-test/test-threads-init.c
+++ b/test/name-test/test-threads-init.c
@@ -105,7 +105,7 @@ check_condvar_lock (DBusCondVar *condvar1,
}
}
-
+/* This test outputs TAP syntax: http://testanything.org/ */
int
main (int argc, char *argv[])
{
@@ -116,6 +116,7 @@ main (int argc, char *argv[])
DBusCondVar *dispatch_cond1, *io_path_cond1;
DBusMutex *mutex2, *dispatch_mutex2, *io_path_mutex2;
DBusCondVar *dispatch_cond2, *io_path_cond2;
+ int test_num = 0;
printf ("*** Testing late thread init\n");
@@ -140,6 +141,7 @@ main (int argc, char *argv[])
check_mutex_lock (io_path_mutex1, io_path_mutex2, TRUE);
check_condvar_lock (dispatch_cond1, dispatch_cond2, TRUE);
check_condvar_lock (io_path_cond1, io_path_cond2, TRUE);
+ printf ("ok %d\n", ++test_num);
dbus_threads_init_default ();
@@ -161,6 +163,7 @@ main (int argc, char *argv[])
check_mutex_lock (io_path_mutex1, io_path_mutex2, TRUE);
check_condvar_lock (dispatch_cond1, dispatch_cond2, TRUE);
check_condvar_lock (io_path_cond1, io_path_cond2, TRUE);
+ printf ("ok %d\n", ++test_num);
method = dbus_message_new_method_call ("org.freedesktop.TestSuiteEchoService",
"/org/freedesktop/TestSuite",
@@ -169,6 +172,6 @@ main (int argc, char *argv[])
dbus_connection_send (conn, method, NULL);
dbus_message_unref (method);
- printf ("Success ***\n");
+ printf ("Testing completed\n1..%d\n", test_num);
exit (0);
}