| ... | @@ -135,6 +135,7 @@ static int print_full_usage(const char *arg0, FILE *file, int return_code) { | ... | @@ -135,6 +135,7 @@ static int print_full_usage(const char *arg0, FILE *file, int return_code) { |
| 135 | " --test-name-prefix [text] add prefix to all tests\n" | 135 | " --test-name-prefix [text] add prefix to all tests\n" |
| 136 | " --test-cmd [arg] specify test execution command one arg at a time\n" | 136 | " --test-cmd [arg] specify test execution command one arg at a time\n" |
| 137 | " --test-cmd-bin appends test binary path to test cmd args\n" | 137 | " --test-cmd-bin appends test binary path to test cmd args\n" |
| | 138 | " --test-evented-io runs the test in evented I/O mode\n" |
| 138 | , arg0); | 139 | , arg0); |
| 139 | return return_code; | 140 | return return_code; |
| 140 | } | 141 | } |
| ... | @@ -428,6 +429,7 @@ int main(int argc, char **argv) { | ... | @@ -428,6 +429,7 @@ int main(int argc, char **argv) { |
| 428 | ZigList<CFile *> c_source_files = {0}; | 429 | ZigList<CFile *> c_source_files = {0}; |
| 429 | const char *test_filter = nullptr; | 430 | const char *test_filter = nullptr; |
| 430 | const char *test_name_prefix = nullptr; | 431 | const char *test_name_prefix = nullptr; |
| | 432 | bool test_evented_io = false; |
| 431 | size_t ver_major = 0; | 433 | size_t ver_major = 0; |
| 432 | size_t ver_minor = 0; | 434 | size_t ver_minor = 0; |
| 433 | size_t ver_patch = 0; | 435 | size_t ver_patch = 0; |
| ... | @@ -709,6 +711,8 @@ int main(int argc, char **argv) { | ... | @@ -709,6 +711,8 @@ int main(int argc, char **argv) { |
| 709 | cur_pkg = cur_pkg->parent; | 711 | cur_pkg = cur_pkg->parent; |
| 710 | } else if (strcmp(arg, "-ffunction-sections") == 0) { | 712 | } else if (strcmp(arg, "-ffunction-sections") == 0) { |
| 711 | function_sections = true; | 713 | function_sections = true; |
| | 714 | } else if (strcmp(arg, "--test-evented-io") == 0) { |
| | 715 | test_evented_io = true; |
| 712 | } else if (i + 1 >= argc) { | 716 | } else if (i + 1 >= argc) { |
| 713 | fprintf(stderr, "Expected another argument after %s\n", arg); | 717 | fprintf(stderr, "Expected another argument after %s\n", arg); |
| 714 | return print_error_usage(arg0); | 718 | return print_error_usage(arg0); |
| ... | @@ -1059,6 +1063,7 @@ int main(int argc, char **argv) { | ... | @@ -1059,6 +1063,7 @@ int main(int argc, char **argv) { |
| 1059 | g->want_stack_check = want_stack_check; | 1063 | g->want_stack_check = want_stack_check; |
| 1060 | g->want_sanitize_c = want_sanitize_c; | 1064 | g->want_sanitize_c = want_sanitize_c; |
| 1061 | g->want_single_threaded = want_single_threaded; | 1065 | g->want_single_threaded = want_single_threaded; |
| | 1066 | g->test_is_evented = test_evented_io; |
| 1062 | Buf *builtin_source = codegen_generate_builtin_source(g); | 1067 | Buf *builtin_source = codegen_generate_builtin_source(g); |
| 1063 | if (fwrite(buf_ptr(builtin_source), 1, buf_len(builtin_source), stdout) != buf_len(builtin_source)) { | 1068 | if (fwrite(buf_ptr(builtin_source), 1, buf_len(builtin_source), stdout) != buf_len(builtin_source)) { |
| 1064 | fprintf(stderr, "unable to write to stdout: %s\n", strerror(ferror(stdout))); | 1069 | fprintf(stderr, "unable to write to stdout: %s\n", strerror(ferror(stdout))); |
| ... | @@ -1232,6 +1237,7 @@ int main(int argc, char **argv) { | ... | @@ -1232,6 +1237,7 @@ int main(int argc, char **argv) { |
| 1232 | if (test_filter) { | 1237 | if (test_filter) { |
| 1233 | codegen_set_test_filter(g, buf_create_from_str(test_filter)); | 1238 | codegen_set_test_filter(g, buf_create_from_str(test_filter)); |
| 1234 | } | 1239 | } |
| | 1240 | g->test_is_evented = test_evented_io; |
| 1235 | | 1241 | |
| 1236 | if (test_name_prefix) { | 1242 | if (test_name_prefix) { |
| 1237 | codegen_set_test_name_prefix(g, buf_create_from_str(test_name_prefix)); | 1243 | codegen_set_test_name_prefix(g, buf_create_from_str(test_name_prefix)); |