2014-07-06 05:14:11 +02:00
|
|
|
#include <platform.h>
|
|
|
|
#include <kernel/config.h>
|
2014-02-18 05:45:00 +01:00
|
|
|
#include <CuTest.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <util/log.h>
|
|
|
|
|
2014-08-25 00:35:49 +02:00
|
|
|
#pragma warning(disable: 4210)
|
2014-08-14 05:06:36 +02:00
|
|
|
#define ADD_TESTS(suite, name) \
|
|
|
|
CuSuite *get_##name##_suite(void); \
|
|
|
|
CuSuiteAddSuite(suite, get_##name##_suite())
|
|
|
|
|
2014-02-18 05:45:00 +01:00
|
|
|
int RunAllTests(void)
|
|
|
|
{
|
|
|
|
CuString *output = CuStringNew();
|
|
|
|
CuSuite *suite = CuSuiteNew();
|
|
|
|
int flags = log_flags;
|
|
|
|
|
|
|
|
log_flags = LOG_FLUSH | LOG_CPERROR;
|
2014-07-06 05:14:11 +02:00
|
|
|
kernel_init();
|
2014-02-18 05:45:00 +01:00
|
|
|
|
|
|
|
/* self-test */
|
2014-08-14 05:06:36 +02:00
|
|
|
ADD_TESTS(suite, tests);
|
|
|
|
ADD_TESTS(suite, callback);
|
|
|
|
ADD_TESTS(suite, json);
|
|
|
|
ADD_TESTS(suite, jsonconf);
|
|
|
|
ADD_TESTS(suite, direction);
|
|
|
|
ADD_TESTS(suite, skill);
|
|
|
|
ADD_TESTS(suite, keyword);
|
2014-08-16 23:23:37 +02:00
|
|
|
ADD_TESTS(suite, order);
|
2014-08-24 21:49:55 +02:00
|
|
|
ADD_TESTS(suite, race);
|
2014-02-18 05:45:00 +01:00
|
|
|
/* util */
|
2014-08-14 05:06:36 +02:00
|
|
|
ADD_TESTS(suite, config);
|
|
|
|
ADD_TESTS(suite, base36);
|
|
|
|
ADD_TESTS(suite, bsdstring);
|
|
|
|
ADD_TESTS(suite, functions);
|
|
|
|
ADD_TESTS(suite, umlaut);
|
2014-08-24 22:54:40 +02:00
|
|
|
ADD_TESTS(suite, strings);
|
2014-02-18 05:45:00 +01:00
|
|
|
/* kernel */
|
2014-08-26 20:06:28 +02:00
|
|
|
ADD_TESTS(suite, unit);
|
2014-08-20 07:00:58 +02:00
|
|
|
ADD_TESTS(suite, faction);
|
2014-08-14 05:06:36 +02:00
|
|
|
ADD_TESTS(suite, build);
|
|
|
|
ADD_TESTS(suite, pool);
|
|
|
|
ADD_TESTS(suite, curse);
|
|
|
|
ADD_TESTS(suite, equipment);
|
|
|
|
ADD_TESTS(suite, item);
|
|
|
|
ADD_TESTS(suite, magic);
|
|
|
|
ADD_TESTS(suite, reports);
|
|
|
|
ADD_TESTS(suite, save);
|
|
|
|
ADD_TESTS(suite, ship);
|
|
|
|
ADD_TESTS(suite, spellbook);
|
|
|
|
ADD_TESTS(suite, building);
|
|
|
|
ADD_TESTS(suite, spell);
|
|
|
|
ADD_TESTS(suite, ally);
|
2014-02-18 05:45:00 +01:00
|
|
|
/* gamecode */
|
2014-08-27 21:09:39 +02:00
|
|
|
ADD_TESTS(suite, battle);
|
2014-08-14 05:06:36 +02:00
|
|
|
ADD_TESTS(suite, economy);
|
2014-08-27 21:09:39 +02:00
|
|
|
ADD_TESTS(suite, laws);
|
|
|
|
ADD_TESTS(suite, market);
|
|
|
|
ADD_TESTS(suite, move);
|
|
|
|
ADD_TESTS(suite, stealth);
|
2014-08-31 08:58:55 +02:00
|
|
|
ADD_TESTS(suite, upkeep);
|
2014-08-27 21:09:39 +02:00
|
|
|
ADD_TESTS(suite, vortex);
|
2014-02-18 05:45:00 +01:00
|
|
|
|
|
|
|
CuSuiteRun(suite);
|
|
|
|
CuSuiteSummary(suite, output);
|
|
|
|
CuSuiteDetails(suite, output);
|
|
|
|
printf("%s\n", output->buffer);
|
|
|
|
|
|
|
|
log_flags = flags;
|
|
|
|
return suite->failCount;
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char ** argv) {
|
2014-06-13 07:14:07 +02:00
|
|
|
log_stderr = 0;
|
|
|
|
return RunAllTests();
|
2014-02-18 05:45:00 +01:00
|
|
|
}
|