2016-05-05 10:21:51 -04:00
|
|
|
#include "cogl-config.h"
|
2013-05-30 08:22:22 -04:00
|
|
|
|
2013-06-10 08:25:15 -04:00
|
|
|
#include <gmodule.h>
|
2013-05-30 08:22:22 -04:00
|
|
|
|
|
|
|
#include <test-fixtures/test-unit.h>
|
2013-07-03 05:50:37 -04:00
|
|
|
#include <stdlib.h>
|
2013-05-30 08:22:22 -04:00
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, char **argv)
|
|
|
|
{
|
2013-06-10 08:25:15 -04:00
|
|
|
GModule *main_module;
|
2013-05-30 08:22:22 -04:00
|
|
|
const CoglUnitTest *unit_test;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (argc != 2)
|
|
|
|
{
|
|
|
|
g_printerr ("usage %s UNIT_TEST\n", argv[0]);
|
|
|
|
exit (1);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Just for convenience in case people try passing the wrapper
|
|
|
|
* filenames for the UNIT_TEST argument we normalize '-' characters
|
|
|
|
* to '_' characters... */
|
|
|
|
for (i = 0; argv[1][i]; i++)
|
|
|
|
{
|
|
|
|
if (argv[1][i] == '-')
|
|
|
|
argv[1][i] = '_';
|
|
|
|
}
|
|
|
|
|
2013-06-10 08:25:15 -04:00
|
|
|
main_module = g_module_open (NULL, /* use main module */
|
|
|
|
0 /* flags */);
|
|
|
|
|
|
|
|
if (!g_module_symbol (main_module, argv[1], (void **) &unit_test))
|
2013-05-30 08:22:22 -04:00
|
|
|
{
|
|
|
|
g_printerr ("Unknown test name \"%s\"\n", argv[1]);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
test_utils_init (unit_test->requirement_flags,
|
|
|
|
unit_test->known_failure_flags);
|
|
|
|
unit_test->run ();
|
|
|
|
test_utils_fini ();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|