#!/usr/bin/env -S jai -quiet run_tests.jai +Autorun MEMORY_DEBUGGER :: false; HELP :: #string STR_END Commands: -lk Run Landlock test -sc Run Seccomp test -tc Run visual test for `Termcolors` STR_END; main :: () { #if MEMORY_DEBUGGER defer report_memory_leaks(); crash.opinionated_init(); args := get_command_line_arguments(); if array_find(args, "help") || array_find(args, "-help") || array_find(args, "-h") { log("%", HELP); return; } if array_find(args, "-tc") { tc.tests_visual(); return; } else if array_find(args, "-sc") { sc.run(); return; } else if array_find(args, "-lk") { lk.run(); return; } ok := true; { qtrace("Test Suite", color=.BLUE, features=.TIME | .CPU_COUNTER); ok &= bp.run(); ok &= rc.run(); ok &= cl.run(); ok &= df.run(); ok &= sp.run(); ok &= lx.run(); ok &= mt.run(); } log("\n---------------------------------------------------------"); if ok then log("All tests passed"); else log_error("Tests failed"); log("\n"); } #import "Basic"()(MEMORY_DEBUGGER = MEMORY_DEBUGGER); tc :: #import,file "termcolors.jai"; bp :: #import,file "bitpack.jai"; rc :: #import,file "rectcut.jai"; cl :: #import,file "colored.jai"; df :: #import,file "datefmt.jai"; sp :: #import,file "string.jai"; lx :: #import,file "lexer.jai"; sc :: #import,file "seccomp.jai"; lk :: #import,file "landlock.jai"; mt :: #import,file "math.jai"; #import,file "../0x2_Qtrace.jai"; crash :: #import,file "../0x2_Crashed.jai";