2010-11-23 21:54:39 -08:00
|
|
|
#include <mooedit/mooeditor-tests.h>
|
2010-12-12 02:29:20 -08:00
|
|
|
#include <moolua/moolua-tests.h>
|
2011-01-01 18:53:27 -08:00
|
|
|
#include <moopython/moopython-tests.h>
|
2008-05-23 15:07:14 -05:00
|
|
|
#include <mooutils/mooutils-tests.h>
|
2008-05-15 23:51:55 -05:00
|
|
|
#include <gtk/gtk.h>
|
2008-08-28 22:52:21 -05:00
|
|
|
#include <stdio.h>
|
2008-09-14 03:00:42 -05:00
|
|
|
#include "mem-debug.h"
|
2008-01-19 01:34:21 -06:00
|
|
|
|
2008-05-05 10:13:42 -05:00
|
|
|
static void
|
2011-01-02 01:41:49 -08:00
|
|
|
add_tests (MooTestOptions opts)
|
2008-01-19 01:34:21 -06:00
|
|
|
{
|
2008-02-02 16:54:52 -06:00
|
|
|
moo_test_gobject ();
|
2008-01-20 03:11:24 -06:00
|
|
|
moo_test_mooaccel ();
|
2008-01-19 01:34:21 -06:00
|
|
|
moo_test_mooutils_fs ();
|
2008-02-20 18:45:20 -06:00
|
|
|
moo_test_moo_file_writer ();
|
2008-02-03 02:02:26 -06:00
|
|
|
moo_test_mooutils_misc ();
|
2011-01-02 01:41:49 -08:00
|
|
|
moo_test_i18n (opts);
|
2008-01-19 01:34:21 -06:00
|
|
|
|
2008-01-19 04:58:44 -06:00
|
|
|
#ifdef __WIN32__
|
|
|
|
moo_test_mooutils_win32 ();
|
|
|
|
#endif
|
|
|
|
|
2011-01-02 18:46:01 -08:00
|
|
|
moo_test_lua (opts);
|
2008-01-27 00:04:00 -06:00
|
|
|
|
2011-01-01 18:53:27 -08:00
|
|
|
#ifdef MOO_ENABLE_PYTHON
|
|
|
|
moo_test_python ();
|
|
|
|
#endif
|
|
|
|
|
2008-02-10 12:56:31 -06:00
|
|
|
moo_test_editor ();
|
2008-05-05 10:13:42 -05:00
|
|
|
}
|
|
|
|
|
2008-09-14 03:00:42 -05:00
|
|
|
static int
|
2011-01-02 01:41:49 -08:00
|
|
|
unit_tests_main (MooTestOptions opts, char **tests, const char *data_dir_arg, const char *coverage_file)
|
2008-05-05 10:13:42 -05:00
|
|
|
{
|
2010-11-07 23:38:04 -08:00
|
|
|
const char *data_dir = NULL;
|
2011-01-02 01:41:49 -08:00
|
|
|
gboolean passed;
|
2010-11-07 23:38:04 -08:00
|
|
|
|
|
|
|
#ifdef MOO_UNIT_TEST_DATA_DIR
|
|
|
|
data_dir = MOO_UNIT_TEST_DATA_DIR;
|
|
|
|
#endif
|
2008-02-10 12:56:31 -06:00
|
|
|
|
2010-10-25 00:05:49 -07:00
|
|
|
if (data_dir_arg)
|
|
|
|
data_dir = data_dir_arg;
|
2008-02-10 12:56:31 -06:00
|
|
|
|
2011-01-02 01:41:49 -08:00
|
|
|
moo_test_set_data_dir (data_dir);
|
|
|
|
|
|
|
|
add_tests (opts);
|
|
|
|
|
|
|
|
passed = moo_test_run_tests (tests, coverage_file, opts);
|
2008-09-15 03:59:22 -05:00
|
|
|
|
2008-01-31 01:16:57 -06:00
|
|
|
moo_test_cleanup ();
|
2008-02-10 12:56:31 -06:00
|
|
|
|
2011-01-02 01:41:49 -08:00
|
|
|
return passed ? 0 : 1;
|
2008-01-19 01:34:21 -06:00
|
|
|
}
|
2010-10-18 23:19:20 -07:00
|
|
|
|
|
|
|
static void
|
2011-01-02 01:41:49 -08:00
|
|
|
list_unit_tests (const char *data_dir)
|
2010-10-18 23:19:20 -07:00
|
|
|
{
|
2011-01-02 01:41:49 -08:00
|
|
|
unit_tests_main (MOO_TEST_LIST_ONLY, NULL, data_dir, NULL);
|
2010-10-18 23:19:20 -07:00
|
|
|
}
|