aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-02-10 00:26:33 -0500
committerAndrew Kelley <andrew@ziglang.org>2020-02-10 00:26:33 -0500
commitcdc5070f216a924d24588b8d0fe06400e036e6bf (patch)
treec1943e1831725e41810ea4db4eb1785a130e18e1 /src/main.cpp
parent9e5b2489913f72764ded2089bccd7e612a3cc347 (diff)
parent014f66e6de4aaf81f32c796b12f981326a479397 (diff)
downloadzig-cdc5070f216a924d24588b8d0fe06400e036e6bf.tar.gz
zig-cdc5070f216a924d24588b8d0fe06400e036e6bf.zip
Merge remote-tracking branch 'origin/master' into llvm10
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index fe0da7c0fe..e58120e057 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -135,6 +135,7 @@ static int print_full_usage(const char *arg0, FILE *file, int return_code) {
" --test-name-prefix [text] add prefix to all tests\n"
" --test-cmd [arg] specify test execution command one arg at a time\n"
" --test-cmd-bin appends test binary path to test cmd args\n"
+ " --test-evented-io runs the test in evented I/O mode\n"
, arg0);
return return_code;
}
@@ -429,6 +430,7 @@ int main(int argc, char **argv) {
ZigList<CFile *> c_source_files = {0};
const char *test_filter = nullptr;
const char *test_name_prefix = nullptr;
+ bool test_evented_io = false;
size_t ver_major = 0;
size_t ver_minor = 0;
size_t ver_patch = 0;
@@ -710,6 +712,8 @@ int main(int argc, char **argv) {
cur_pkg = cur_pkg->parent;
} else if (strcmp(arg, "-ffunction-sections") == 0) {
function_sections = true;
+ } else if (strcmp(arg, "--test-evented-io") == 0) {
+ test_evented_io = true;
} else if (i + 1 >= argc) {
fprintf(stderr, "Expected another argument after %s\n", arg);
return print_error_usage(arg0);
@@ -1060,6 +1064,7 @@ int main(int argc, char **argv) {
g->want_stack_check = want_stack_check;
g->want_sanitize_c = want_sanitize_c;
g->want_single_threaded = want_single_threaded;
+ g->test_is_evented = test_evented_io;
Buf *builtin_source = codegen_generate_builtin_source(g);
if (fwrite(buf_ptr(builtin_source), 1, buf_len(builtin_source), stdout) != buf_len(builtin_source)) {
fprintf(stderr, "unable to write to stdout: %s\n", strerror(ferror(stdout)));
@@ -1233,6 +1238,7 @@ int main(int argc, char **argv) {
if (test_filter) {
codegen_set_test_filter(g, buf_create_from_str(test_filter));
}
+ g->test_is_evented = test_evented_io;
if (test_name_prefix) {
codegen_set_test_name_prefix(g, buf_create_from_str(test_name_prefix));