*
*/
+#include <config.h>
#include "dbus-test.h"
+#include "dbus-sysdeps.h"
#include <stdio.h>
#include <stdlib.h>
static void
die (const char *failure)
{
- fprintf (stderr, "Failed: %s\n", failure);
+ fprintf (stderr, "Unit test failed: %s\n", failure);
exit (1);
}
* any app other than our test app, this symbol
* won't exist in some builds of the library.
* (with --enable-tests=no)
+ *
+ * @param test_data_dir the directory with test data (test/data normally)
*/
void
-dbus_internal_symbol_do_not_use_run_tests (void)
+dbus_internal_do_not_use_run_tests (const char *test_data_dir)
{
#ifdef DBUS_BUILD_TESTS
+ if (test_data_dir == NULL)
+ test_data_dir = _dbus_getenv ("DBUS_TEST_DATA");
+
+ if (test_data_dir != NULL)
+ printf ("Test data in %s\n", test_data_dir);
+ else
+ printf ("No test data!\n");
+
printf ("%s: running string tests\n", "dbus-test");
if (!_dbus_string_test ())
die ("strings");
+
+ printf ("%s: running auth tests\n", "dbus-test");
+ if (!_dbus_auth_test (test_data_dir))
+ die ("auth");
+
+ printf ("%s: running address parse tests\n", "dbus-test");
+ if (!_dbus_address_test ())
+ die ("address parsing");
printf ("%s: running marshalling tests\n", "dbus-test");
if (!_dbus_marshal_test ())
die ("marshalling");
printf ("%s: running message tests\n", "dbus-test");
- if (!_dbus_message_test ())
+ if (!_dbus_message_test (test_data_dir))
die ("messages");
-
+
printf ("%s: running memory pool tests\n", "dbus-test");
if (!_dbus_mem_pool_test ())
die ("memory pools");
-
+
printf ("%s: running linked list tests\n", "dbus-test");
if (!_dbus_list_test ())
die ("lists");