support --emit in 'test' command

Support the `--emit` switch in `zig --emit asm test file.zig`.

The command fails because no tests run (no executable is created) but
it emits the requested file.  That seems like a good tradeoff.
This commit is contained in:
Ben Noordhuis 2018-06-29 23:28:42 +02:00
parent f1c56f7f22
commit 03f66825d6

View File

@ -924,6 +924,8 @@ int main(int argc, char **argv) {
codegen_print_timing_report(g, stdout); codegen_print_timing_report(g, stdout);
return EXIT_SUCCESS; return EXIT_SUCCESS;
} else if (cmd == CmdTest) { } else if (cmd == CmdTest) {
codegen_set_emit_file_type(g, emit_file_type);
ZigTarget native; ZigTarget native;
get_native_target(&native); get_native_target(&native);