Open Source Tomb Raider Engine
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591
  1. /*
  2. * Copyright (c) 2011 Scott Vokes <vokes.s@gmail.com>
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef GREATEST_H
  17. #define GREATEST_H
  18. #define GREATEST_VERSION_MAJOR 0
  19. #define GREATEST_VERSION_MINOR 9
  20. #define GREATEST_VERSION_PATCH 3
  21. /* A unit testing system for C, contained in 1 file.
  22. * It doesn't use dynamic allocation or depend on anything
  23. * beyond ANSI C89. */
  24. /*********************************************************************
  25. * Minimal test runner template
  26. *********************************************************************/
  27. #if 0
  28. #include "greatest.h"
  29. TEST foo_should_foo() {
  30. PASS();
  31. }
  32. static void setup_cb(void *data) {
  33. printf("setup callback for each test case\n");
  34. }
  35. static void teardown_cb(void *data) {
  36. printf("teardown callback for each test case\n");
  37. }
  38. SUITE(suite) {
  39. /* Optional setup/teardown callbacks which will be run before/after
  40. * every test case in the suite.
  41. * Cleared when the suite finishes. */
  42. SET_SETUP(setup_cb, voidp_to_callback_data);
  43. SET_TEARDOWN(teardown_cb, voidp_to_callback_data);
  44. RUN_TEST(foo_should_foo);
  45. }
  46. /* Add all the definitions that need to be in the test runner's main file. */
  47. GREATEST_MAIN_DEFS();
  48. int main(int argc, char **argv) {
  49. GREATEST_MAIN_BEGIN(); /* command-line arguments, initialization. */
  50. RUN_SUITE(suite);
  51. GREATEST_MAIN_END(); /* display results */
  52. }
  53. #endif
  54. /*********************************************************************/
  55. #include <stdlib.h>
  56. #include <stdio.h>
  57. #include <string.h>
  58. #include <time.h>
  59. /***********
  60. * Options *
  61. ***********/
  62. /* Default column width for non-verbose output. */
  63. #ifndef GREATEST_DEFAULT_WIDTH
  64. #define GREATEST_DEFAULT_WIDTH 72
  65. #endif
  66. /* FILE *, for test logging. */
  67. #ifndef GREATEST_STDOUT
  68. #define GREATEST_STDOUT stdout
  69. #endif
  70. /* Remove GREATEST_ prefix from most commonly used symbols? */
  71. #ifndef GREATEST_USE_ABBREVS
  72. #define GREATEST_USE_ABBREVS 1
  73. #endif
  74. /*********
  75. * Types *
  76. *********/
  77. /* Info for the current running suite. */
  78. typedef struct greatest_suite_info {
  79. unsigned int tests_run;
  80. unsigned int passed;
  81. unsigned int failed;
  82. unsigned int skipped;
  83. /* timers, pre/post running suite and individual tests */
  84. clock_t pre_suite;
  85. clock_t post_suite;
  86. clock_t pre_test;
  87. clock_t post_test;
  88. } greatest_suite_info;
  89. /* Type for a suite function. */
  90. typedef void (greatest_suite_cb)(void);
  91. /* Types for setup/teardown callbacks. If non-NULL, these will be run
  92. * and passed the pointer to their additional data. */
  93. typedef void (greatest_setup_cb)(void *udata);
  94. typedef void (greatest_teardown_cb)(void *udata);
  95. typedef enum {
  96. GREATEST_FLAG_VERBOSE = 0x01,
  97. GREATEST_FLAG_FIRST_FAIL = 0x02,
  98. GREATEST_FLAG_LIST_ONLY = 0x04
  99. } GREATEST_FLAG;
  100. typedef struct greatest_run_info {
  101. unsigned int flags;
  102. unsigned int tests_run; /* total test count */
  103. /* Overall pass/fail/skip counts. */
  104. unsigned int passed;
  105. unsigned int failed;
  106. unsigned int skipped;
  107. /* currently running test suite */
  108. greatest_suite_info suite;
  109. /* info to print about the most recent failure */
  110. const char *fail_file;
  111. unsigned int fail_line;
  112. const char *msg;
  113. /* current setup/teardown hooks and userdata */
  114. greatest_setup_cb *setup;
  115. void *setup_udata;
  116. greatest_teardown_cb *teardown;
  117. void *teardown_udata;
  118. /* formatting info for ".....s...F"-style output */
  119. unsigned int col;
  120. unsigned int width;
  121. /* only run a specific suite or test */
  122. char *suite_filter;
  123. char *test_filter;
  124. /* overall timers */
  125. clock_t begin;
  126. clock_t end;
  127. } greatest_run_info;
  128. /* Global var for the current testing context.
  129. * Initialized by GREATEST_MAIN_DEFS(). */
  130. extern greatest_run_info greatest_info;
  131. /**********************
  132. * Exported functions *
  133. **********************/
  134. void greatest_do_pass(const char *name);
  135. void greatest_do_fail(const char *name);
  136. void greatest_do_skip(const char *name);
  137. int greatest_pre_test(const char *name);
  138. void greatest_post_test(const char *name, int res);
  139. void greatest_usage(const char *name);
  140. void GREATEST_SET_SETUP_CB(greatest_setup_cb *cb, void *udata);
  141. void GREATEST_SET_TEARDOWN_CB(greatest_teardown_cb *cb, void *udata);
  142. /**********
  143. * Macros *
  144. **********/
  145. /* Define a suite. */
  146. #define GREATEST_SUITE(NAME) void NAME(void)
  147. /* Start defining a test function.
  148. * The arguments are not included, to allow parametric testing. */
  149. #define GREATEST_TEST static int
  150. /* Run a suite. */
  151. #define GREATEST_RUN_SUITE(S_NAME) greatest_run_suite(S_NAME, #S_NAME)
  152. /* Run a test in the current suite. */
  153. #define GREATEST_RUN_TEST(TEST) \
  154. do { \
  155. if (greatest_pre_test(#TEST) == 1) { \
  156. int res = TEST(); \
  157. greatest_post_test(#TEST, res); \
  158. } else if (GREATEST_LIST_ONLY()) { \
  159. fprintf(GREATEST_STDOUT, " %s\n", #TEST); \
  160. } \
  161. } while (0)
  162. /* Run a test in the current suite with one void* argument,
  163. * which can be a pointer to a struct with multiple arguments. */
  164. #define GREATEST_RUN_TEST1(TEST, ENV) \
  165. do { \
  166. if (greatest_pre_test(#TEST) == 1) { \
  167. int res = TEST(ENV); \
  168. greatest_post_test(#TEST, res); \
  169. } else if (GREATEST_LIST_ONLY()) { \
  170. fprintf(GREATEST_STDOUT, " %s\n", #TEST); \
  171. } \
  172. } while (0)
  173. /* If __VA_ARGS__ (C99) is supported, allow parametric testing
  174. * without needing to manually manage the argument struct. */
  175. #if __STDC_VERSION__ >= 19901L
  176. #define GREATEST_RUN_TESTp(TEST, ...) \
  177. do { \
  178. if (greatest_pre_test(#TEST) == 1) { \
  179. int res = TEST(__VA_ARGS__); \
  180. greatest_post_test(#TEST, res); \
  181. } else if (GREATEST_LIST_ONLY()) { \
  182. fprintf(GREATEST_STDOUT, " %s\n", #TEST); \
  183. } \
  184. } while (0)
  185. #endif
  186. /* Check if the test runner is in verbose mode. */
  187. #define GREATEST_IS_VERBOSE() (greatest_info.flags & GREATEST_FLAG_VERBOSE)
  188. #define GREATEST_LIST_ONLY() (greatest_info.flags & GREATEST_FLAG_LIST_ONLY)
  189. #define GREATEST_FIRST_FAIL() (greatest_info.flags & GREATEST_FLAG_FIRST_FAIL)
  190. #define GREATEST_FAILURE_ABORT() (greatest_info.suite.failed > 0 && GREATEST_FIRST_FAIL())
  191. /* Message-less forms. */
  192. #define GREATEST_PASS() GREATEST_PASSm(NULL)
  193. #define GREATEST_FAIL() GREATEST_FAILm(NULL)
  194. #define GREATEST_SKIP() GREATEST_SKIPm(NULL)
  195. #define GREATEST_ASSERT(COND) GREATEST_ASSERTm(#COND, COND)
  196. #define GREATEST_ASSERT_FALSE(COND) GREATEST_ASSERT_FALSEm(#COND, COND)
  197. #define GREATEST_ASSERT_EQ(EXP, GOT) GREATEST_ASSERT_EQm(#EXP " != " #GOT, EXP, GOT)
  198. #define GREATEST_ASSERT_STR_EQ(EXP, GOT) GREATEST_ASSERT_STR_EQm(#EXP " != " #GOT, EXP, GOT)
  199. /* The following forms take an additional message argument first,
  200. * to be displayed by the test runner. */
  201. /* Fail if a condition is not true, with message. */
  202. #define GREATEST_ASSERTm(MSG, COND) \
  203. do { \
  204. greatest_info.msg = MSG; \
  205. greatest_info.fail_file = __FILE__; \
  206. greatest_info.fail_line = __LINE__; \
  207. if (!(COND)) return -1; \
  208. greatest_info.msg = NULL; \
  209. } while (0)
  210. #define GREATEST_ASSERT_FALSEm(MSG, COND) \
  211. do { \
  212. greatest_info.msg = MSG; \
  213. greatest_info.fail_file = __FILE__; \
  214. greatest_info.fail_line = __LINE__; \
  215. if ((COND)) return -1; \
  216. greatest_info.msg = NULL; \
  217. } while (0)
  218. #define GREATEST_ASSERT_EQm(MSG, EXP, GOT) \
  219. do { \
  220. greatest_info.msg = MSG; \
  221. greatest_info.fail_file = __FILE__; \
  222. greatest_info.fail_line = __LINE__; \
  223. if ((EXP) != (GOT)) return -1; \
  224. greatest_info.msg = NULL; \
  225. } while (0)
  226. #define GREATEST_ASSERT_STR_EQm(MSG, EXP, GOT) \
  227. do { \
  228. const char *exp_s = (EXP); \
  229. const char *got_s = (GOT); \
  230. greatest_info.msg = MSG; \
  231. greatest_info.fail_file = __FILE__; \
  232. greatest_info.fail_line = __LINE__; \
  233. if (0 != strcmp(exp_s, got_s)) { \
  234. fprintf(GREATEST_STDOUT, \
  235. "Expected:\n####\n%s\n####\n", exp_s); \
  236. fprintf(GREATEST_STDOUT, \
  237. "Got:\n####\n%s\n####\n", got_s); \
  238. return -1; \
  239. } \
  240. greatest_info.msg = NULL; \
  241. } while (0)
  242. #define GREATEST_PASSm(MSG) \
  243. do { \
  244. greatest_info.msg = MSG; \
  245. return 0; \
  246. } while (0)
  247. #define GREATEST_FAILm(MSG) \
  248. do { \
  249. greatest_info.fail_file = __FILE__; \
  250. greatest_info.fail_line = __LINE__; \
  251. greatest_info.msg = MSG; \
  252. return -1; \
  253. } while (0)
  254. #define GREATEST_SKIPm(MSG) \
  255. do { \
  256. greatest_info.msg = MSG; \
  257. return 1; \
  258. } while (0)
  259. #define GREATEST_SET_TIME(NAME) \
  260. NAME = clock(); \
  261. if (NAME == (clock_t) -1) { \
  262. fprintf(GREATEST_STDOUT, \
  263. "clock error: %s\n", #NAME); \
  264. exit(EXIT_FAILURE); \
  265. }
  266. #define GREATEST_CLOCK_DIFF(C1, C2) \
  267. fprintf(GREATEST_STDOUT, " (%lu ticks, %.3f sec)", \
  268. (long unsigned int) (C2) - (C1), \
  269. (double)((C2) - (C1)) / (1.0 * (double)CLOCKS_PER_SEC)) \
  270. /* Include several function definitions in the main test file. */
  271. #define GREATEST_MAIN_DEFS() \
  272. \
  273. /* Is FILTER a subset of NAME? */ \
  274. static int greatest_name_match(const char *name, \
  275. const char *filter) { \
  276. size_t offset = 0; \
  277. size_t filter_len = strlen(filter); \
  278. while (name[offset] != '\0') { \
  279. if (name[offset] == filter[0]) { \
  280. if (0 == strncmp(&name[offset], filter, filter_len)) { \
  281. return 1; \
  282. } \
  283. } \
  284. offset++; \
  285. } \
  286. \
  287. return 0; \
  288. } \
  289. \
  290. int greatest_pre_test(const char *name) { \
  291. if (!GREATEST_LIST_ONLY() \
  292. && (!GREATEST_FIRST_FAIL() || greatest_info.suite.failed == 0) \
  293. && (greatest_info.test_filter == NULL || \
  294. greatest_name_match(name, greatest_info.test_filter))) { \
  295. GREATEST_SET_TIME(greatest_info.suite.pre_test); \
  296. if (greatest_info.setup) { \
  297. greatest_info.setup(greatest_info.setup_udata); \
  298. } \
  299. return 1; /* test should be run */ \
  300. } else { \
  301. return 0; /* skipped */ \
  302. } \
  303. } \
  304. \
  305. void greatest_post_test(const char *name, int res) { \
  306. GREATEST_SET_TIME(greatest_info.suite.post_test); \
  307. if (greatest_info.teardown) { \
  308. void *udata = greatest_info.teardown_udata; \
  309. greatest_info.teardown(udata); \
  310. } \
  311. \
  312. if (res < 0) { \
  313. greatest_do_fail(name); \
  314. } else if (res > 0) { \
  315. greatest_do_skip(name); \
  316. } else if (res == 0) { \
  317. greatest_do_pass(name); \
  318. } \
  319. greatest_info.suite.tests_run++; \
  320. greatest_info.col++; \
  321. if (GREATEST_IS_VERBOSE()) { \
  322. GREATEST_CLOCK_DIFF(greatest_info.suite.pre_test, \
  323. greatest_info.suite.post_test); \
  324. fprintf(GREATEST_STDOUT, "\n"); \
  325. } else if (greatest_info.col % greatest_info.width == 0) { \
  326. fprintf(GREATEST_STDOUT, "\n"); \
  327. greatest_info.col = 0; \
  328. } \
  329. if (GREATEST_STDOUT == stdout) fflush(stdout); \
  330. } \
  331. \
  332. static void greatest_run_suite(greatest_suite_cb *suite_cb, \
  333. const char *suite_name) { \
  334. if (greatest_info.suite_filter && \
  335. !greatest_name_match(suite_name, greatest_info.suite_filter)) \
  336. return; \
  337. if (GREATEST_FIRST_FAIL() && greatest_info.failed > 0) return; \
  338. greatest_info.suite.tests_run = 0; \
  339. greatest_info.suite.failed = 0; \
  340. greatest_info.suite.passed = 0; \
  341. greatest_info.suite.skipped = 0; \
  342. greatest_info.suite.pre_suite = 0; \
  343. greatest_info.suite.post_suite = 0; \
  344. greatest_info.suite.pre_test = 0; \
  345. greatest_info.suite.post_test = 0; \
  346. greatest_info.col = 0; \
  347. fprintf(GREATEST_STDOUT, "\n* Suite %s:\n", suite_name); \
  348. GREATEST_SET_TIME(greatest_info.suite.pre_suite); \
  349. suite_cb(); \
  350. GREATEST_SET_TIME(greatest_info.suite.post_suite); \
  351. if (greatest_info.suite.tests_run > 0) { \
  352. fprintf(GREATEST_STDOUT, \
  353. "\n%u tests - %u pass, %u fail, %u skipped", \
  354. greatest_info.suite.tests_run, \
  355. greatest_info.suite.passed, \
  356. greatest_info.suite.failed, \
  357. greatest_info.suite.skipped); \
  358. GREATEST_CLOCK_DIFF(greatest_info.suite.pre_suite, \
  359. greatest_info.suite.post_suite); \
  360. fprintf(GREATEST_STDOUT, "\n"); \
  361. } \
  362. greatest_info.setup = NULL; \
  363. greatest_info.setup_udata = NULL; \
  364. greatest_info.teardown = NULL; \
  365. greatest_info.teardown_udata = NULL; \
  366. greatest_info.passed += greatest_info.suite.passed; \
  367. greatest_info.failed += greatest_info.suite.failed; \
  368. greatest_info.skipped += greatest_info.suite.skipped; \
  369. greatest_info.tests_run += greatest_info.suite.tests_run; \
  370. } \
  371. \
  372. void greatest_do_pass(const char *name) { \
  373. if (GREATEST_IS_VERBOSE()) { \
  374. fprintf(GREATEST_STDOUT, "PASS %s: %s", \
  375. name, greatest_info.msg ? greatest_info.msg : ""); \
  376. } else { \
  377. fprintf(GREATEST_STDOUT, "."); \
  378. } \
  379. greatest_info.suite.passed++; \
  380. } \
  381. \
  382. void greatest_do_fail(const char *name) { \
  383. if (GREATEST_IS_VERBOSE()) { \
  384. fprintf(GREATEST_STDOUT, \
  385. "FAIL %s: %s (%s:%u)", \
  386. name, greatest_info.msg ? greatest_info.msg : "", \
  387. greatest_info.fail_file, greatest_info.fail_line); \
  388. } else { \
  389. fprintf(GREATEST_STDOUT, "F"); \
  390. /* add linebreak if in line of '.'s */ \
  391. if (greatest_info.col % greatest_info.width != 0) \
  392. fprintf(GREATEST_STDOUT, "\n"); \
  393. greatest_info.col = 0; \
  394. fprintf(GREATEST_STDOUT, "FAIL %s: %s (%s:%u)\n", \
  395. name, \
  396. greatest_info.msg ? greatest_info.msg : "", \
  397. greatest_info.fail_file, greatest_info.fail_line); \
  398. } \
  399. greatest_info.suite.failed++; \
  400. } \
  401. \
  402. void greatest_do_skip(const char *name) { \
  403. if (GREATEST_IS_VERBOSE()) { \
  404. fprintf(GREATEST_STDOUT, "SKIP %s: %s", \
  405. name, \
  406. greatest_info.msg ? \
  407. greatest_info.msg : "" ); \
  408. } else { \
  409. fprintf(GREATEST_STDOUT, "s"); \
  410. } \
  411. greatest_info.suite.skipped++; \
  412. } \
  413. \
  414. void greatest_usage(const char *name) { \
  415. fprintf(GREATEST_STDOUT, \
  416. "Usage: %s [-hlfv] [-s SUITE] [-t TEST]\n" \
  417. " -h print this Help\n" \
  418. " -l List suites and their tests, then exit\n" \
  419. " -f Stop runner after first failure\n" \
  420. " -v Verbose output\n" \
  421. " -s SUITE only run suite named SUITE\n" \
  422. " -t TEST only run test named TEST\n", \
  423. name); \
  424. } \
  425. \
  426. void GREATEST_SET_SETUP_CB(greatest_setup_cb *cb, void *udata) { \
  427. greatest_info.setup = cb; \
  428. greatest_info.setup_udata = udata; \
  429. } \
  430. \
  431. void GREATEST_SET_TEARDOWN_CB(greatest_teardown_cb *cb, \
  432. void *udata) { \
  433. greatest_info.teardown = cb; \
  434. greatest_info.teardown_udata = udata; \
  435. } \
  436. \
  437. greatest_run_info greatest_info
  438. /* Handle command-line arguments, etc. */
  439. #define GREATEST_MAIN_BEGIN() \
  440. do { \
  441. int i = 0; \
  442. memset(&greatest_info, 0, sizeof(greatest_info)); \
  443. if (greatest_info.width == 0) { \
  444. greatest_info.width = GREATEST_DEFAULT_WIDTH; \
  445. } \
  446. for (i = 1; i < argc; i++) { \
  447. if (0 == strcmp("-t", argv[i])) { \
  448. if (argc <= i + 1) { \
  449. greatest_usage(argv[0]); \
  450. exit(EXIT_FAILURE); \
  451. } \
  452. greatest_info.test_filter = argv[i+1]; \
  453. i++; \
  454. } else if (0 == strcmp("-s", argv[i])) { \
  455. if (argc <= i + 1) { \
  456. greatest_usage(argv[0]); \
  457. exit(EXIT_FAILURE); \
  458. } \
  459. greatest_info.suite_filter = argv[i+1]; \
  460. i++; \
  461. } else if (0 == strcmp("-f", argv[i])) { \
  462. greatest_info.flags |= GREATEST_FLAG_FIRST_FAIL; \
  463. } else if (0 == strcmp("-v", argv[i])) { \
  464. greatest_info.flags |= GREATEST_FLAG_VERBOSE; \
  465. } else if (0 == strcmp("-l", argv[i])) { \
  466. greatest_info.flags |= GREATEST_FLAG_LIST_ONLY; \
  467. } else if (0 == strcmp("-h", argv[i])) { \
  468. greatest_usage(argv[0]); \
  469. exit(EXIT_SUCCESS); \
  470. } else { \
  471. fprintf(GREATEST_STDOUT, \
  472. "Unknown argument '%s'\n", argv[i]); \
  473. greatest_usage(argv[0]); \
  474. exit(EXIT_FAILURE); \
  475. } \
  476. } \
  477. } while (0); \
  478. GREATEST_SET_TIME(greatest_info.begin)
  479. #define GREATEST_MAIN_END() \
  480. do { \
  481. if (!GREATEST_LIST_ONLY()) { \
  482. GREATEST_SET_TIME(greatest_info.end); \
  483. fprintf(GREATEST_STDOUT, \
  484. "\nTotal: %u tests", greatest_info.tests_run); \
  485. GREATEST_CLOCK_DIFF(greatest_info.begin, \
  486. greatest_info.end); \
  487. fprintf(GREATEST_STDOUT, "\n"); \
  488. fprintf(GREATEST_STDOUT, \
  489. "Pass: %u, fail: %u, skip: %u.\n", \
  490. greatest_info.passed, \
  491. greatest_info.failed, greatest_info.skipped); \
  492. } \
  493. return (greatest_info.failed > 0 \
  494. ? EXIT_FAILURE : EXIT_SUCCESS); \
  495. } while (0)
  496. /* Make abbreviations without the GREATEST_ prefix for the
  497. * most commonly used symbols. */
  498. #if GREATEST_USE_ABBREVS
  499. #define TEST GREATEST_TEST
  500. #define SUITE GREATEST_SUITE
  501. #define RUN_TEST GREATEST_RUN_TEST
  502. #define RUN_TEST1 GREATEST_RUN_TEST1
  503. #define RUN_SUITE GREATEST_RUN_SUITE
  504. #define ASSERT GREATEST_ASSERT
  505. #define ASSERTm GREATEST_ASSERTm
  506. #define ASSERT_FALSE GREATEST_ASSERT_FALSE
  507. #define ASSERT_EQ GREATEST_ASSERT_EQ
  508. #define ASSERT_STR_EQ GREATEST_ASSERT_STR_EQ
  509. #define ASSERT_FALSEm GREATEST_ASSERT_FALSEm
  510. #define ASSERT_EQm GREATEST_ASSERT_EQm
  511. #define ASSERT_STR_EQm GREATEST_ASSERT_STR_EQm
  512. #define PASS GREATEST_PASS
  513. #define FAIL GREATEST_FAIL
  514. #define SKIP GREATEST_SKIP
  515. #define PASSm GREATEST_PASSm
  516. #define FAILm GREATEST_FAILm
  517. #define SKIPm GREATEST_SKIPm
  518. #define SET_SETUP GREATEST_SET_SETUP_CB
  519. #define SET_TEARDOWN GREATEST_SET_TEARDOWN_CB
  520. #if __STDC_VERSION__ >= 19901L
  521. #endif /* C99 */
  522. #define RUN_TESTp GREATEST_RUN_TESTp
  523. #endif /* USE_ABBREVS */
  524. #endif