Logo

index : 0x2lib

Library extension for Jai

  • summary
  • about
  • tree
  • log
  • branches
<< path: root/public/0x2lib.git/html/tests/run_tests.jai blob: 5c9e7605a9ce0a1310fed2f31b8f94ec1ef7c512 [raw] [clear marker]

        
0#!/usr/bin/env -S jai -quiet run_tests.jai +Autorun
1
2MEMORY_DEBUGGER :: false;
3
4HELP :: #string STR_END
5Commands:
6 -lk Run Landlock test
7 -sc Run Seccomp test
8 -tc Run visual test for `Termcolors`
9
10STR_END;
11
12
13main :: () {
14 #if MEMORY_DEBUGGER defer report_memory_leaks();
15 crash.opinionated_init();
16
17 args := get_command_line_arguments();
18
19 if array_find(args, "help") || array_find(args, "-help") || array_find(args, "-h") {
20 log("%", HELP);
21 return;
22 }
23
24 if array_find(args, "-tc") {
25 tc.tests_visual();
26 return;
27 }
28 else if array_find(args, "-sc") {
29 sc.run();
30 return;
31 }
32 else if array_find(args, "-lk") {
33 lk.run();
34 return;
35 }
36
37
38 ok := true;
39 {
40 qtrace("Test Suite", color=.BLUE, features=.TIME | .CPU_COUNTER);
41
42 ok &= bp.run();
43 ok &= rc.run();
44 ok &= cl.run();
45 ok &= df.run();
46 ok &= sp.run();
47 ok &= lx.run();
48 ok &= mt.run();
49 }
50
51 log("\n---------------------------------------------------------");
52 if ok then log("All tests passed"); else log_error("Tests failed");
53 log("\n");
54}
55
56
57#import "Basic"()(MEMORY_DEBUGGER = MEMORY_DEBUGGER);
58
59tc :: #import,file "termcolors.jai";
60bp :: #import,file "bitpack.jai";
61rc :: #import,file "rectcut.jai";
62cl :: #import,file "colored.jai";
63df :: #import,file "datefmt.jai";
64sp :: #import,file "string.jai";
65lx :: #import,file "lexer.jai";
66sc :: #import,file "seccomp.jai";
67lk :: #import,file "landlock.jai";
68mt :: #import,file "math.jai";
69
70#import,file "../0x2_Qtrace.jai";
71crash :: #import,file "../0x2_Crashed.jai";
72
73
Copyright 2026  E766CB298A6D1E64 | Git-Thing heavily inspired by cgit