2 * Test swift. Imports functions from test_sw_* files and runs tests.
14 static void (*test_fun_array[])(void) = {
29 static void usage(const char *argv0)
31 fprintf(stderr, "Usage: %s [test_no]\n\n", argv0);
36 * In case of no arguments call all functions defined in test_fun_array.
39 int main(int argc, char **argv)
43 /* No arguments: call all test functions. */
46 for (i = 1; i < sizeof(test_fun_array)/sizeof(test_fun_array[0]); i++)
54 test_idx = atoi(argv[1]);
56 if (test_idx < 1 || test_idx >= sizeof(test_fun_array)/sizeof(test_fun_array[0])) {
57 fprintf(stderr, "Error: test index %d is out of bounds\n", test_idx);
61 test_fun_array[test_idx]();