00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <config.h>
00025 #include "dbus-gtest.h"
00026 #include <stdio.h>
00027 #include <stdlib.h>
00028
00029 #ifdef DBUS_BUILD_TESTS
00030 static void
00031 die (const char *failure)
00032 {
00033 fprintf (stderr, "Unit test failed: %s\n", failure);
00034 exit (1);
00035 }
00036 #endif
00037
00047 void
00048 dbus_glib_internal_do_not_use_run_tests (const char *test_data_dir)
00049 {
00050 #ifdef DBUS_BUILD_TESTS
00051 if (test_data_dir == NULL)
00052 test_data_dir = g_getenv ("DBUS_TEST_DATA");
00053
00054 if (test_data_dir != NULL)
00055 printf ("Test data in %s\n", test_data_dir);
00056 else
00057 printf ("No test data!\n");
00058
00059 printf ("%s: running glib tests\n", "dbus-glib-test");
00060 if (!_dbus_glib_test (test_data_dir))
00061 die ("glib");
00062
00063 printf ("%s: running utils tests\n", "dbus-glib-test");
00064 if (!_dbus_gutils_test (test_data_dir))
00065 die ("gutils");
00066
00067 printf ("%s: running mainloop integration tests\n", "dbus-glib-test");
00068 if (!_dbus_gmain_test (test_data_dir))
00069 die ("gmain");
00070
00071 printf ("%s: running GObject tests\n", "dbus-glib-test");
00072 if (!_dbus_gobject_test (test_data_dir))
00073 die ("gobject");
00074
00075 printf ("%s: completed successfully\n", "dbus-glib-test");
00076 #else
00077 printf ("Not compiled with unit tests, not running any\n");
00078 #endif
00079 }
00080
00081