| 54 | } |
| 55 | |
| 56 | int main(int argc, char* argv[]) { |
| 57 | CmdLine cmd_line(argc, argv); |
| 58 | |
| 59 | TestSettings settings {}; |
| 60 | settings.verbose = cmd_line.has_arg("--verbose"); |
| 61 | settings.validate = cmd_line.has_arg("--validate"); |
| 62 | |
| 63 | print_app_info(); |
| 64 | print_app_usage(settings); |
| 65 | |
| 66 | if (cmd_line.has_arg("--help")) { |
| 67 | return 0; |
| 68 | } |
| 69 | |
| 70 | const char* arch = cmd_line.value_of("--arch", "all"); |
| 71 | bool x86_failed = false; |
| 72 | bool x64_failed = false; |
| 73 | bool aarch64_failed = false; |
| 74 | |
| 75 | #if !defined(ASMJIT_NO_X86) |
| 76 | if ((strcmp(arch, "all") == 0 || strcmp(arch, "x86") == 0)) |
| 77 | x86_failed = !test_x86_assembler(settings); |
| 78 | |
| 79 | if ((strcmp(arch, "all") == 0 || strcmp(arch, "x64") == 0)) |
| 80 | x64_failed = !test_x64_assembler(settings); |
| 81 | #endif |
| 82 | |
| 83 | #if !defined(ASMJIT_NO_AARCH64) |
| 84 | if ((strcmp(arch, "all") == 0 || strcmp(arch, "aarch64") == 0)) |
| 85 | aarch64_failed = !test_aarch64_assembler(settings); |
| 86 | #endif |
| 87 | |
| 88 | bool failed = x86_failed || x64_failed || aarch64_failed; |
| 89 | |
| 90 | if (failed) { |
| 91 | if (x86_failed) |
| 92 | printf("** X86 test suite failed **\n"); |
| 93 | |
| 94 | if (x64_failed) |
| 95 | printf("** X64 test suite failed **\n"); |
| 96 | |
| 97 | if (aarch64_failed) |
| 98 | printf("** AArch64 test suite failed **\n"); |
| 99 | |
| 100 | printf("** FAILURE **\n"); |
| 101 | } |
| 102 | else { |
| 103 | printf("** SUCCESS **\n"); |
| 104 | } |
| 105 | |
| 106 | return failed ? 1 : 0; |
| 107 | } |
nothing calls this directly
no test coverage detected