1 /* -*- mode: C; c-file-style: "gnu" -*- */
2 /* dbus-test.c Program to run all tests
4 * Copyright (C) 2002, 2003 Red Hat Inc.
6 * Licensed under the Academic Free License version 1.2
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include "dbus-gtest.h"
29 #ifdef DBUS_BUILD_TESTS
31 die (const char *failure)
33 fprintf (stderr, "Unit test failed: %s\n", failure);
36 #endif /* DBUS_BUILD_TESTS */
39 * An exported symbol to be run in order to execute
40 * unit tests. Should not be used by
41 * any app other than our test app, this symbol
42 * won't exist in some builds of the library.
43 * (with --enable-tests=no)
45 * @param test_data_dir the directory with test data (test/data normally)
48 dbus_glib_internal_do_not_use_run_tests (const char *test_data_dir)
50 #ifdef DBUS_BUILD_TESTS
51 if (test_data_dir == NULL)
52 test_data_dir = g_getenv ("DBUS_TEST_DATA");
54 if (test_data_dir != NULL)
55 printf ("Test data in %s\n", test_data_dir);
57 printf ("No test data!\n");
59 printf ("%s: running mainloop integration tests\n", "dbus-glib-test");
60 if (!_dbus_gmain_test (test_data_dir))
63 printf ("%s: running GObject tests\n", "dbus-glib-test");
64 if (!_dbus_gobject_test (test_data_dir))
67 printf ("%s: completed successfully\n", "dbus-glib-test");
69 printf ("Not compiled with unit tests, not running any\n");