From 2338ea5d591d81daaaa8965a2a1a83eeeb9e9694 Mon Sep 17 00:00:00 2001 From: Hojun-Cho Date: Wed, 10 Jun 2026 20:45:46 +0900 Subject: [PATCH] ww: lib tests run via -T test mode; bare mains retired (closes @test conversion) 'ww test' gains the istest build path (-T injection in build_one/ buildone) and do_test/dotest accept -I, mirroring do_run - both twins. The 35 converted lib tests drop their interim bare mains (-T synthesizes the entry from @test fns and rejects a user main); their 35 C run-drivers flip 'ww run' -> 'ww test'; 989_lib_byteid compiles lib tests under -T (8 user-main probe fixtures stay non-T, gated on the fixture field). Abort-on-first-failure stands until the deferred record-and-continue harness lands with the multi-package arc. --- cmd/ww/main.c | 27 +++++++---- lib/ascii/asciitest.ww | 6 --- lib/bufio/bufiotest.ww | 26 ---------- lib/bytes/bytestest.ww | 24 ---------- lib/crypto/sha256/sha256_test.ww | 10 ---- lib/dirs/dirstest.ww | 8 ---- lib/encoding/base32/base32_test.ww | 10 ---- lib/encoding/base64/base64_test.ww | 10 ---- lib/encoding/hex/hextest.ww | 17 ------- lib/encoding/utf8/utf8test.ww | 40 ---------------- lib/errors/errnotest.ww | 7 --- lib/fmt/fmttest.ww | 47 ------------------ lib/fnmatch/fnmatchtest.ww | 12 ----- lib/getopt/getopttest.ww | 14 ------ lib/hash/adler32/adler32_test.ww | 9 ---- lib/hash/crc16/crc16_test.ww | 9 ---- lib/hash/crc32/crc32_test.ww | 10 ---- lib/hash/crc64/crc64_test.ww | 11 ----- lib/hash/siphash/siphash_test.ww | 7 --- lib/log/logtest.ww | 15 ------ lib/math/checked/checked_test.ww | 49 ------------------- lib/math/random/random_test.ww | 9 ---- lib/memio/memiotest.ww | 14 ------ lib/os/ostest.ww | 9 ---- lib/os/stattest.ww | 15 ------ lib/path/pathtest.ww | 12 ----- lib/regex/regex_test.ww | 52 -------------------- lib/shlex/shlextest.ww | 8 ---- lib/strconv/test/ftostest.ww | 13 ----- lib/strconv/test/inttest.ww | 14 ------ lib/strconv/test/stoftest.ww | 8 ---- lib/strings/stringstest.ww | 49 ------------------- lib/temp/temptest.ww | 8 ---- lib/time/timetest.ww | 19 -------- lib/ww/asttest.ww | 5 -- lib/ww/lex/toktest.ww | 8 ---- selfhost/cmd/ww/main.combined.ww | 77 ++++++++++++++++++++++-------- selfhost/cmd/ww/main.ww | 77 ++++++++++++++++++++++-------- test/wcc/902_errno_run.c | 2 +- test/wcc/904_ascii_run.c | 2 +- test/wcc/904_tok_run.c | 2 +- test/wcc/905_nkname_run.c | 2 +- test/wcc/908_ftos_run.c | 2 +- test/wcc/909_stof_run.c | 2 +- test/wcc/922_strconv_int_run.c | 2 +- test/wcc/966_strings_run.c | 2 +- test/wcc/967_bytes_run.c | 2 +- test/wcc/968_utf8_run.c | 2 +- test/wcc/969_checked_run.c | 2 +- test/wcc/970_fmt_run.c | 2 +- test/wcc/971_log_run.c | 2 +- test/wcc/972_fnmatch_run.c | 2 +- test/wcc/973_shlex_run.c | 2 +- test/wcc/974_getenv_run.c | 2 +- test/wcc/975_dirs_run.c | 2 +- test/wcc/976_stat_run.c | 2 +- test/wcc/977_time_run.c | 2 +- test/wcc/979_hex_run.c | 2 +- test/wcc/980_memio_run.c | 2 +- test/wcc/981_temp_run.c | 2 +- test/wcc/982_getopt_run.c | 2 +- test/wcc/983_base32_run.c | 2 +- test/wcc/984_base64_run.c | 2 +- test/wcc/985_adler32_run.c | 2 +- test/wcc/986_crc16_run.c | 2 +- test/wcc/987_crc32_run.c | 2 +- test/wcc/988_crc64_run.c | 2 +- test/wcc/989_lib_byteid.c | 13 +++-- test/wcc/989_path_run.c | 2 +- test/wcc/989_regex_run.c | 2 +- test/wcc/989_sha256_run.c | 2 +- test/wcc/989_siphash_run.c | 2 +- test/wcc/998_bufio_run.c | 2 +- test/wcc/999_random_run.c | 2 +- 74 files changed, 178 insertions(+), 670 deletions(-) diff --git a/cmd/ww/main.c b/cmd/ww/main.c index 9267a17f..9a691a0d 100644 --- a/cmd/ww/main.c +++ b/cmd/ww/main.c @@ -384,7 +384,7 @@ expand(FILE *out, const char *path, struct ImportSet *visited, static int build_one(const char *src, int entry_is_dir, const char *out, const char *objstem, const char *extra_includes, const char *extra_libs, - const char *extra_libdirs) + const char *extra_libdirs, int is_test) { const char *c6 = toolpath("WW_W6C", "w6c"); const char *a6 = toolpath("WW_W6A", "w6a"); @@ -478,7 +478,8 @@ build_one(const char *src, int entry_is_dir, const char *out, } char cmd[4096]; - snprintf(cmd, sizeof cmd, "%s -o %s %s", c6, asmf, combined); + snprintf(cmd, sizeof cmd, "%s %s-o %s %s", c6, is_test ? "-T " : "", + asmf, combined); if (run(cmd) != 0) { fprintf(stderr, "ww: w6c failed\n"); return 1; @@ -714,7 +715,7 @@ do_build(int argc, char **argv) } else { basename_no_ext(resolved, out, sizeof out); } - return build_one(resolved, is_dir, out, objstem, incs, libs, libdirs); + return build_one(resolved, is_dir, out, objstem, incs, libs, libdirs, 0); } static int @@ -739,7 +740,7 @@ do_run(int argc, char **argv) snprintf(tmp, sizeof tmp, "/tmp/ww_run_%d", getpid()); /* objstem = tmp → intermediates land at /tmp/ww_run_.{s,o, * combined.ww}, never next to the source (T3). */ - if (build_one(resolved, is_dir, tmp, tmp, incs, libs, libdirs) != 0) + if (build_one(resolved, is_dir, tmp, tmp, incs, libs, libdirs, 0) != 0) return 1; /* exec the built binary with any trailing argv as its argv. */ pid_t pid = fork(); @@ -764,21 +765,29 @@ do_run(int argc, char **argv) static int do_test(int argc, char **argv) { - const char *target = (argc > 0) ? argv[0] : "."; + const char *src = NULL; + char libs[2048] = {0}; + char libdirs[2048] = {0}; + char incs[2048] = {0}; + char outflag[1024] = {0}; /* -o accepted+ignored: test uses the temp */ + parse_build_flags(argc, argv, incs, sizeof incs, + libdirs, sizeof libdirs, libs, sizeof libs, + outflag, sizeof outflag, &src); + const char *target = src ? src : "."; struct stat st; if (stat(target, &st) != 0) { /* not a literal path — try module resolution and run as * a single test program. */ char resolved[1024]; int is_dir = 0; - if (!resolve_module(target, "", resolved, sizeof resolved, + if (!resolve_module(target, incs, resolved, sizeof resolved, &is_dir)) { fprintf(stderr, "ww test: cannot find %s\n", target); return 1; } char tmp[1024]; snprintf(tmp, sizeof tmp, "/tmp/ww_test_%d", getpid()); - if (build_one(resolved, is_dir, tmp, NULL, "", "", "") != 0) return 1; + if (build_one(resolved, is_dir, tmp, NULL, incs, "", "", 1) != 0) return 1; int rc = run(tmp); unlink(tmp); return rc; @@ -787,7 +796,7 @@ do_test(int argc, char **argv) /* single .ww file — build+run it. */ char tmp[1024]; snprintf(tmp, sizeof tmp, "/tmp/ww_test_%d", getpid()); - if (build_one(target, 0, tmp, NULL, "", "", "") != 0) return 1; + if (build_one(target, 0, tmp, NULL, incs, "", "", 1) != 0) return 1; int rc = run(tmp); unlink(tmp); return rc; @@ -813,7 +822,7 @@ do_test(int argc, char **argv) snprintf(tmp, sizeof tmp, "/tmp/ww_test_%d_%d", getpid(), i); const char *label = strrchr(files[i], '/'); label = label ? label + 1 : files[i]; - int rc = build_one(files[i], 0, tmp, NULL, target, "", ""); + int rc = build_one(files[i], 0, tmp, NULL, target, "", "", 1); if (rc != 0) { fprintf(stderr, "FAIL %s (build)\n", label); fail++; diff --git a/lib/ascii/asciitest.ww b/lib/ascii/asciitest.ww index d4fcec2b..94f60fc1 100644 --- a/lib/ascii/asciitest.ww +++ b/lib/ascii/asciitest.ww @@ -65,9 +65,3 @@ fn checkbuf(in: str, lo: str, up: str) void = { case nomem => void; }; }; - -export fn main() i32 = { - strfold_cases(); - strfold_buf_cases(); - return 0; -}; diff --git a/lib/bufio/bufiotest.ww b/lib/bufio/bufiotest.ww index 26472489..c104d512 100644 --- a/lib/bufio/bufiotest.ww +++ b/lib/bufio/bufiotest.ww @@ -859,29 +859,3 @@ fn errsource() io.stream = { }; bufio.finish(&sc); }; - -export fn main() i32 = { - scanbytecases(); - scanlinecases(); - scanlineoverflow(); - scanbytescases(); - emptystream(); - errorsource(); - boundarycases(); - multifill(); - streamsmallwrite(); - streamautoflush(); - streamlineflush(); - streamflushonwrite(); - streamisbuffered(); - streamunread(); - streamscannerunread(); - streamflushempty(); - streamcloseflushes(); - streamsetflushcustom(); - scanrunecases(); - scanruneinvalid(); - newscannergrow(); - newscanneroverflow(); - return 0; -}; diff --git a/lib/bytes/bytestest.ww b/lib/bytes/bytestest.ww index 9d838433..ef1da824 100644 --- a/lib/bytes/bytestest.ww +++ b/lib/bytes/bytestest.ww @@ -810,27 +810,3 @@ fn expect_tok(toks: [][]u8, i: i32, want: []u8) void = { assert(!(!bytes.equal(b4, h[0:6]))); assert(!(!bytes.equal(a4, z[0:0]))); }; - -export fn main() i32 = { - equal_cases(); - index_byte_cases(); - index_slice_cases(); - rindex_byte_cases(); - rindex_slice_cases(); - contains_cases(); - hasprefix_cases(); - hassuffix_cases(); - tokenize_cases(); - rtokenize_cases(); - peek_token_cases(); - remaining_tokens_cases(); - splitn_cases(); - rsplitn_cases(); - split_cases(); - ltrim_cases(); - rtrim_cases(); - trim_cases(); - cut_cases(); - rcut_cases(); - return 0; -}; diff --git a/lib/crypto/sha256/sha256_test.ww b/lib/crypto/sha256/sha256_test.ww index e12336fd..b3c07633 100644 --- a/lib/crypto/sha256/sha256_test.ww +++ b/lib/crypto/sha256/sha256_test.ww @@ -123,13 +123,3 @@ fn check(msg: []u8, want: str) void = { assert(!(hash.sz(h) != 32: size)); assert(!(hash.bsz(h) != 64: size)); }; - -export fn main() i32 = { - empty(); - abc(); - twoblockpad(); - millionas(); - reentrant(); - sizes(); - return 0; -}; diff --git a/lib/dirs/dirstest.ww b/lib/dirs/dirstest.ww index 9afe7e9a..c1109818 100644 --- a/lib/dirs/dirstest.ww +++ b/lib/dirs/dirstest.ww @@ -129,11 +129,3 @@ fn gettmpdir() str = { let got = dirs.state("myapp"); assert(!(!streq(got, exp))); }; - -export fn main() i32 = { - test_config_xdg_set(); - test_cache_xdg_relative_fallback(); - test_data_unset_fallback(); - test_state_unset_fallback(); - return 0; -}; diff --git a/lib/encoding/base32/base32_test.ww b/lib/encoding/base32/base32_test.ww index f3bcae47..305969a5 100644 --- a/lib/encoding/base32/base32_test.ww +++ b/lib/encoding/base32/base32_test.ww @@ -145,13 +145,3 @@ fn enchexvec(input: str, expect: str) void = { assert(!(base32.decodedsize(8) != 5)); assert(!(base32.decodedsize(16) != 10)); }; - -export fn main() i32 = { - rfc4648_std(); - rfc4648_decode(); - rfc4648_hex(); - roundtrip_all_quintets(); - invalid_inputs(); - sizes(); - return 0; -}; diff --git a/lib/encoding/base64/base64_test.ww b/lib/encoding/base64/base64_test.ww index 00093eef..e9464cb1 100644 --- a/lib/encoding/base64/base64_test.ww +++ b/lib/encoding/base64/base64_test.ww @@ -188,13 +188,3 @@ fn inval_check(enc: *base64.encoding, encoded: str) void = { case let e: errors.invalid => abort(); }; }; - -export fn main() i32 = { - rfc4648_std(); - rfc4648_url(); - urlsafe_distinct(); - decode_invalid(); - sizes(); - roundtrip_all_bytes(); - return 0; -}; diff --git a/lib/encoding/hex/hextest.ww b/lib/encoding/hex/hextest.ww index d81093bb..b9c9f416 100644 --- a/lib/encoding/hex/hextest.ww +++ b/lib/encoding/hex/hextest.ww @@ -154,20 +154,3 @@ fn cafebabe() [8]u8 = { case let e: errors.invalid => abort(); }; }; - -export fn main() i32 = { - encodestr_basic(); - encodestr_zero(); - encodestr_ff(); - encodestr_empty(); - encode_stream(); - decodestr_lower(); - decodestr_upper(); - decodestr_mixed(); - decodestr_empty(); - decodestr_odd(); - decodestr_bad(); - decodestr_bad_mid(); - roundtrip_all_bytes(); - return 0; -}; diff --git a/lib/encoding/utf8/utf8test.ww b/lib/encoding/utf8/utf8test.ww index b339a788..2c1f8c62 100644 --- a/lib/encoding/utf8/utf8test.ww +++ b/lib/encoding/utf8/utf8test.ww @@ -614,43 +614,3 @@ fn streq(a: str, b: str) bool = { i += 1; }; }; - -export fn main() i32 = { - runesz_ranges(); - utf8sz_classify(); - encode_ascii(); - encode_two_byte(); - encode_three_byte(); - encode_four_byte(); - decode_one_byte(); - decode_two_byte(); - decode_three_byte(); - decode_four_byte(); - decode_surrogate(); - decode_overlong(); - decode_out_of_range(); - decode_bad_continuation(); - decode_max_in_range(); - decode_truncated(); - decode_done(); - validate_mixed_ok(); - validate_malformed(); - validate_empty_ok(); - roundtrip(); - prev_done_at_start(); - prev_one_byte(); - prev_two_byte(); - prev_three_byte(); - prev_four_byte(); - prev_mixed_roundtrip(); - prev_continuation_only_more(); - prev_incomplete_invalid(); - prev_surrogate_invalid(); - prev_overlong_invalid(); - prev_extracont_invalid(); - prev_max_in_range(); - prev_min_out_of_range(); - remaining_slice_position(); - strerror_cases(); - return 0; -}; diff --git a/lib/errors/errnotest.ww b/lib/errors/errnotest.ww index 1ef9401e..4d351143 100644 --- a/lib/errors/errnotest.ww +++ b/lib/errors/errnotest.ww @@ -104,10 +104,3 @@ fn errtag(e: errors.error) int = { assert(!(!streq(os.strerror(os.EINVAL), "Invalid argument"))); assert(!(!streq(os.strerror(5), "Unknown error"))); }; - -export fn main() i32 = { - mapping(); - opaquetail(); - strerrortext(); - return 0; -}; diff --git a/lib/fmt/fmttest.ww b/lib/fmt/fmttest.ww index 1f55cef8..87b813d0 100644 --- a/lib/fmt/fmttest.ww +++ b/lib/fmt/fmttest.ww @@ -631,50 +631,3 @@ fn errsource() io.stream = { assert(!(!streq(r, "1.5 -2.5"))); os.free(r.ptr: *void, r.len: u64); }; - -export fn main() i32 = { - fprintbarestr(); - fprintintstr(); - fprintboolrune(); - fprintempty(); - fprintlnmulti(); - fprintlnempty(); - fprintfixedshort(); - fprintclosed(); - fprintf_implicit(); - fprintf_indexed(); - fprintf_literal_braces(); - fprintf_width_right(); - fprintf_width_left(); - fprintf_width_center(); - fprintf_pad_underscore(); - fprintf_base_hex(); - fprintf_base_oct_bin(); - fprintf_prec_int(); - fprintf_prec_str_trunc(); - fprintf_sign_neg(); - fprintfln_basic(); - fprintf_closed(); - bsprintf_basic(); - fprintf_bool_rune(); - bsprintf_trunc(); - bsprintf_width_trunc(); - asprintf_basic(); - asprintf_growth(); - asprintf_empty(); - asprintf_indexed_mods(); - fprintf_f64_basic(); - fprintf_f64_int_valued(); - fprintf_f64_neg(); - fprintf_f64_zero(); - fprintf_f64_small_frac(); - fprintf_f64_huge(); - fprintf_f64_sign_plus(); - fprintf_f64_sign_space(); - fprintf_f64_width_right(); - fprintf_f64_width_left(); - fprint_f64_variadic(); - bsprintf_f64(); - asprintf_f64(); - return 0; -}; diff --git a/lib/fnmatch/fnmatchtest.ww b/lib/fnmatch/fnmatchtest.ww index 76961744..b3894ebe 100644 --- a/lib/fnmatch/fnmatchtest.ww +++ b/lib/fnmatch/fnmatchtest.ww @@ -247,15 +247,3 @@ fn check(pat: str, s: str, expected: bool, flags: i32) void = { let nesc: i32 = 2; // NOESCAPE check("a\\*.c", "a*.c", false, nesc); }; - -export fn main() i32 = { - basic(); - brackets(); - ctype(); - period(); - noescape(); - musl_basic(); - pathname(); - combined(); - return 0; -}; diff --git a/lib/getopt/getopttest.ww b/lib/getopt/getopttest.ww index 941e9096..89537b70 100644 --- a/lib/getopt/getopttest.ww +++ b/lib/getopt/getopttest.ww @@ -476,17 +476,3 @@ fn streq(a: str, b: str) bool = { i += 1; }; }; - -export fn main() i32 = { - flagcluster(); - paramflag(); - separator(); - repeatedflag(); - baredash(); - errortable(); - strerrortext(); - nooptionsbare(); - printusage_cases(); - printhelp_cases(); - return 0; -}; diff --git a/lib/hash/adler32/adler32_test.ww b/lib/hash/adler32/adler32_test.ww index 79e14042..f4b337d2 100644 --- a/lib/hash/adler32/adler32_test.ww +++ b/lib/hash/adler32/adler32_test.ww @@ -43,12 +43,3 @@ fn check(s: str, want: u32) void = { check("'The central enemy of reliability is complexity.' - Geer et al", 3170309588u32); }; - -export fn main() i32 = { - vec_empty(); - vec_helloworld(); - vec_hareiscool(); - vec_bdale(); - vec_geer(); - return 0; -}; diff --git a/lib/hash/crc16/crc16_test.ww b/lib/hash/crc16/crc16_test.ww index 3a59b5fc..c7043ed5 100644 --- a/lib/hash/crc16/crc16_test.ww +++ b/lib/hash/crc16/crc16_test.ww @@ -49,12 +49,3 @@ fn check(s: str, ccitt: u16, cmda: u16, dect: u16, ansi: u16) void = { check("I want peace and I'm willing to fight for it. -- Harry Truman", 0xB0E8u16, 0xFE1Fu16, 0x4659u16, 0x5062u16); }; - -export fn main() i32 = { - vec_empty(); - vec_truman(); - vec_animals(); - vec_twain(); - vec_peace(); - return 0; -}; diff --git a/lib/hash/crc32/crc32_test.ww b/lib/hash/crc32/crc32_test.ww index d53fa9ef..80a03d2d 100644 --- a/lib/hash/crc32/crc32_test.ww +++ b/lib/hash/crc32/crc32_test.ww @@ -52,13 +52,3 @@ fn check(s: str, ieee: u32, cast: u32, koop: u32) void = { check("GNU's not UNIX", 224734747u32, 200511816u32, 332335539u32); }; - -export fn main() i32 = { - vec_empty(); - vec_fire(); - vec_setfire(); - vec_blm(); - vec_unix(); - vec_gnu(); - return 0; -}; diff --git a/lib/hash/crc64/crc64_test.ww b/lib/hash/crc64/crc64_test.ww index 0201534c..d293ecee 100644 --- a/lib/hash/crc64/crc64_test.ww +++ b/lib/hash/crc64/crc64_test.ww @@ -55,14 +55,3 @@ fn check(s: str, ecma: u64, iso: u64) void = { check("Black lives matter", 0x159BB7B6086BF47Eu64, 0xC218CBB390CF44EBu64); }; - -export fn main() i32 = { - vec_empty(); - vec_oscar(); - vec_hegel(); - vec_chapelain(); - vec_unix(); - vec_gnu(); - vec_blm(); - return 0; -}; diff --git a/lib/hash/siphash/siphash_test.ww b/lib/hash/siphash/siphash_test.ww index 8f94735e..1740776b 100644 --- a/lib/hash/siphash/siphash_test.ww +++ b/lib/hash/siphash/siphash_test.ww @@ -68,10 +68,3 @@ fn putstr(s: str, into: []u8, off: i32) i32 = { let empty: [1]u8; assert(!(siphash.sum24(key[0:16], empty[0:0]) != 0x2A51AE0682925836u64)); }; - -export fn main() i32 = { - refkey_msgN(); - ascii(); - empty(); - return 0; -}; diff --git a/lib/log/logtest.ww b/lib/log/logtest.ww index fa625456..2db86ce2 100644 --- a/lib/log/logtest.ww +++ b/lib/log/logtest.ww @@ -238,18 +238,3 @@ fn streq(a: str, b: str) bool = { // can assert WEXITSTATUS == 255 without the test process itself // terminating. lib/os doesn't ship process spawning yet; revisit // when that lands. - -export fn main() i32 = { - defaultwiredtoglobal(); - lprintlnbasic(); - lprintlnsingle(); - lprintlnempty(); - silentwritesnothing(); - setloggerswap(); - lprintflnbasic(); - printflnglobal(); - silentignoresprintfln(); - lprintflnindexed(); - lprintflnmods(); - return 0; -}; diff --git a/lib/math/checked/checked_test.ww b/lib/math/checked/checked_test.ww index 9e756964..4d7f0c63 100644 --- a/lib/math/checked/checked_test.ww +++ b/lib/math/checked/checked_test.ww @@ -383,52 +383,3 @@ import types; assert(!(types.U64_MIN != 0u64)); assert(!(types.RUNE_MIN != '\0')); }; - -export fn main() i32 = { - test_addi8(); - test_addi16(); - test_addi32(); - test_addi64(); - test_addu8(); - test_addu16(); - test_addu32(); - test_addu64(); - test_subi8(); - test_subi16(); - test_subi32(); - test_subi64(); - test_subu8(); - test_subu16(); - test_subu32(); - test_subu64(); - test_muli8(); - test_muli16(); - test_muli32(); - test_mulu8(); - test_mulu16(); - test_mulu32(); - test_sat_addi8(); - test_sat_addi16(); - test_sat_addi32(); - test_sat_addi64(); - test_sat_addu8(); - test_sat_addu16(); - test_sat_addu32(); - test_sat_addu64(); - test_sat_subi8(); - test_sat_subi16(); - test_sat_subi32(); - test_sat_subi64(); - test_sat_subu8(); - test_sat_subu16(); - test_sat_subu32(); - test_sat_subu64(); - test_sat_muli8(); - test_sat_muli16(); - test_sat_muli32(); - test_sat_mulu8(); - test_sat_mulu16(); - test_sat_mulu32(); - test_types_min(); - return 0; -}; diff --git a/lib/math/random/random_test.ww b/lib/math/random/random_test.ww index 714acb29..6183943b 100644 --- a/lib/math/random/random_test.ww +++ b/lib/math/random/random_test.ww @@ -52,12 +52,3 @@ import random; i += 1; }; }; - -export fn main() i32 = { - seq(); - deterministic(); - u32n_inrange(); - u64n_pow2(); - u64n_nonpow2(); - return 0; -}; diff --git a/lib/memio/memiotest.ww b/lib/memio/memiotest.ww index 906a75a2..be175230 100644 --- a/lib/memio/memiotest.ww +++ b/lib/memio/memiotest.ww @@ -524,17 +524,3 @@ fn putstr(s: str, into: []u8, off: i32) i32 = { let c: (void | io.error) = io.close(s); match (c) { case void => {}; case let e: io.error => abort(); }; }; - -export fn main() i32 = { - fixedread(); - fixedwritecases(); - dynamicgrowcases(); - dynamicreset(); - borrowedreadcases(); - stringview(); - dynamicfromseed(); - seekcases(); - emptyseek(); - dynamicseek(); - return 0; -}; diff --git a/lib/os/ostest.ww b/lib/os/ostest.ww index d277e9fd..39e61525 100644 --- a/lib/os/ostest.ww +++ b/lib/os/ostest.ww @@ -106,12 +106,3 @@ fn streq(a: str, b: str) bool = { assert(!(p[4095] != 165u8)); os.free(p.ptr: *void, 4096u64); }; - -export fn main() i32 = { - test_getenv_set(); - test_getenv_empty(); - test_getenv_unset(); - test_getenv_prefix_no_match(); - test_alloc_free_roundtrip(); - return 0; -}; diff --git a/lib/os/stattest.ww b/lib/os/stattest.ww index 023de329..2e995cae 100644 --- a/lib/os/stattest.ww +++ b/lib/os/stattest.ww @@ -204,18 +204,3 @@ fn makebig(n: i32) str = { let bp = makebig(os.PATH_MAX); assert(!(os.exists(bp))); }; - -export fn main() i32 = { - test_stat_regfile(); - test_stat_subdir(); - test_stat_noent(); - test_stat_symlink_follow(); - test_lstat_symlink_nofollow(); - test_fstat_regfile(); - test_exists_regfile(); - test_exists_subdir(); - test_exists_noent(); - test_stat_toolong(); - test_exists_toolong(); - return 0; -}; diff --git a/lib/path/pathtest.ww b/lib/path/pathtest.ww index 140e04fb..a16c1357 100644 --- a/lib/path/pathtest.ww +++ b/lib/path/pathtest.ww @@ -267,15 +267,3 @@ import path; assert(!(pop(&buf) as str != "foo")); assert(!(string(&buf) != "/")); }; - -export fn main() i32 = { - push_cases(); - isroot_cases(); - string_cases(); - dirname_basename_cases(); - abs_cases(); - local_cases(); - parent_cases(); - popsplit_cases(); - return 0; -}; diff --git a/lib/regex/regex_test.ww b/lib/regex/regex_test.ww index fd36a3de..9c346e3f 100644 --- a/lib/regex/regex_test.ww +++ b/lib/regex/regex_test.ww @@ -2568,55 +2568,3 @@ type prrow = struct { i += 1; }; }; - -export fn main() i32 = { - lit_and_match(); - size_aliases_distinct(); - void_aliases_distinct(); - charset_payload(); - repeat_payload(); - struct_shapes_and_finish(); - compile_literal_program(); - compile_any_program(); - compile_empty_program(); - thread_shape(); - newmatch_discriminates(); - result_free_noop(); - strerror_identity(); - is_consuming_kinds(); - delete_thread_middle(); - add_thread_dedup_inherit(); - run_thread_literal_program(); - run_thread_anchored_route(); - search_matches(); - search_early_exit(); - search_no_match(); - test_matches(); - find_cases(); - findall_content(); - findall_fields(); - fold3_programs(); - fold3_compile_errors(); - find_last_groupstart_cases(); - shift_direct(); - fold3_find_cases(); - fold4_programs(); - fold4_charsets(); - fold4_compile_errors(); - fold4_find_cases(); - fold4_findall(); - add_thread_dup_independence(); - fold5_compile_errors(); - run_thread_group_arms(); - fold5_find_cases(); - fold5_optional_group(); - fold5_submatches(); - parse_repetition_cases(); - fold5b_compile_errors(); - fold5b_find_cases(); - fold5b_findall(); - fold6_compile_errors(); - fold6_charsets(); - fold6_find_cases(); - return 0; -}; diff --git a/lib/shlex/shlextest.ww b/lib/shlex/shlextest.ww index e47d8a08..48f21213 100644 --- a/lib/shlex/shlextest.ww +++ b/lib/shlex/shlextest.ww @@ -178,11 +178,3 @@ fn checkquote(in: str, expected: str) void = { let s: str = shlex.strerror(e); assert(!(!streq(s, "Invalid shell syntax"))); }; - -export fn main() i32 = { - test_split(); - test_quote(); - test_quotestr(); - test_strerror(); - return 0; -}; diff --git a/lib/strconv/test/ftostest.ww b/lib/strconv/test/ftostest.ww index 5f23ebb9..d24a9f41 100644 --- a/lib/strconv/test/ftostest.ww +++ b/lib/strconv/test/ftostest.ww @@ -174,16 +174,3 @@ fn chkf32(n: f32, want: str) bool = { assert(!(!rt64(math.f64frombits(0x0010000000000000u64)))); // F64_MIN_NORMAL assert(!(!rt64(math.f64frombits(0x7FEFFFFFFFFFFFFFu64)))); // F64_MAX_NORMAL }; - -export fn main() i32 = { - f64tos_fixed(); - f64tos_scientific(); - f64tos_special(); - f32tos_fixed(); - f32tos_scientific(); - f32tos_extremes(); - f32tos_special(); - f64_roundtrip(); - os.exit(0); - return 0; -}; diff --git a/lib/strconv/test/inttest.ww b/lib/strconv/test/inttest.ww index 336c1517..264e084e 100644 --- a/lib/strconv/test/inttest.ww +++ b/lib/strconv/test/inttest.ww @@ -296,17 +296,3 @@ fn cks(id: i32, got: str, want: str) void = { cks(99, i32tos(-2147483648i32, base.DEC), "-2147483648"); cks(100, u8tos(255u8, base.HEX_LOWER), "ff"); }; - -export fn main() i32 = { - test_stoi64(); - test_stoi64_bases(); - test_stou64(); - test_stou64_bases(); - test_stoi_stou_stoz(); - test_u64tos_bases(); - test_u64tos(); - test_i64tos_bases(); - test_i64tos(); - test_word_wrappers(); - return 0; -}; diff --git a/lib/strconv/test/stoftest.ww b/lib/strconv/test/stoftest.ww index 9d635994..c4b9dc9e 100644 --- a/lib/strconv/test/stoftest.ww +++ b/lib/strconv/test/stoftest.ww @@ -225,11 +225,3 @@ fn nan32(s: str) bool = { assert(!(!ovf32("1.0p+128", base.HEX))); assert(!(!chk32("1.0p-151", base.HEX, 0.0f32))); }; - -export fn main() i32 = { - stof64_dec(); - stof32_dec(); - stof64_hex(); - stof32_hex(); - return 0; -}; diff --git a/lib/strings/stringstest.ww b/lib/strings/stringstest.ww index fbaa4077..01f8f4fb 100644 --- a/lib/strings/stringstest.ww +++ b/lib/strings/stringstest.ww @@ -1671,52 +1671,3 @@ fn expect_str(toks: []str, i: i32, want: str) void = { assert(!(!streq(a7, "abc"))); assert(!(!streq(b7, ""))); }; - -export fn main() i32 = { - dup_cases(); - dupall_cases(); - concat_cases(); - join_cases(); - hasprefix_cases(); - hassuffix_cases(); - contains_cases(); - byteindex_str_cases(); - byteindex_rune_cases(); - rbyteindex_cases(); - index_cases(); - rindex_cases(); - trimprefix_cases(); - trimsuffix_cases(); - ltrim_cases(); - rtrim_cases(); - trim_cases(); - compare_cases(); - sub_cases(); - bytesub_cases(); - utf8_roundtrip_cases(); - iter_empty_cases(); - iter_ascii_cases(); - iter_twobyte_cases(); - iter_threebyte_cases(); - iter_fourbyte_cases(); - iter_mixed_cases(); - iter_prev_at_start_cases(); - iter_prev_ascii_cases(); - iter_full_cases(); - iter_position_cases(); - iter_iterstr_reverse_cases(); - iter_slice_cases(); - tokenize_cases(); - rtokenize_cases(); - peek_token_cases(); - remaining_tokens_cases(); - splitn_cases(); - rsplitn_cases(); - split_cases(); - lpad_cases(); - rpad_cases(); - replace_cases(); - cut_cases(); - rcut_cases(); - return 0; -}; diff --git a/lib/temp/temptest.ww b/lib/temp/temptest.ww index 8927e81f..ba450676 100644 --- a/lib/temp/temptest.ww +++ b/lib/temp/temptest.ww @@ -246,11 +246,3 @@ fn strslice(p: str, lo: i32, hi: i32) str = { assert(!(os.rmdir(d2) != 0)); assert(!(os.rmdir(dsnap) != 0)); }; - -export fn main() i32 = { - namedroundtrip(); - namedoverwrite(); - dirlifecycle(); - diruniqueness(); - return 0; -}; diff --git a/lib/time/timetest.ww b/lib/time/timetest.ww index d5ac9fef..23b34062 100644 --- a/lib/time/timetest.ww +++ b/lib/time/timetest.ww @@ -157,22 +157,3 @@ import time; assert(!(time.compare(a, b) != -1i8)); assert(!(time.compare(b, a) != 1i8)); }; - -export fn main() i32 = { - constants(); - nowmonotonic(); - nowrealtime(); - addzero(); - addpos_nocarry(); - addpos_carry(); - addpos_fullsecond(); - addneg_noborrow(); - addneg_borrow(); - diffsimple(); - diffneg(); - comparelt(); - comparegt(); - compareeq(); - comparensec_only(); - return 0; -}; diff --git a/lib/ww/asttest.ww b/lib/ww/asttest.ww index 2276b5dc..60e71b8a 100644 --- a/lib/ww/asttest.ww +++ b/lib/ww/asttest.ww @@ -100,8 +100,3 @@ fn checkname(k: nkind, want: str) void = { // named value (68); 69 is out of band, exercising the "?" tail. checkname(69: nkind, "?"); }; - -export fn main() i32 = { - nkname_cases(); - return 0; -}; diff --git a/lib/ww/lex/toktest.ww b/lib/ww/lex/toktest.ww index 91fa004f..776d1aca 100644 --- a/lib/ww/lex/toktest.ww +++ b/lib/ww/lex/toktest.ww @@ -307,11 +307,3 @@ fn checkfloat(src: str, want: u64) void = { checkfloat("1.0e308", 0x7FE1CCF385EBC8A0u64); checkfloat("2.225073858507202e-308", 0x0010000000000001u64); }; - -export fn main() i32 = { - tokname_cases(); - kwlookup_cases(); - tokprint_cases(); - floatfold_cases(); - return 0; -}; diff --git a/selfhost/cmd/ww/main.combined.ww b/selfhost/cmd/ww/main.combined.ww index 49c0c6e4..c49e78de 100644 --- a/selfhost/cmd/ww/main.combined.ww +++ b/selfhost/cmd/ww/main.combined.ww @@ -3614,7 +3614,7 @@ type lflags = struct { // touches no C-built code at runtime. The C `ww` driver in cmd/ww/ // still drives the C-built w6c/w6a/w6l. Test 993 pins the two // pipelines to byte-identical output on a corpus. -fn buildone(selfdir: *u8, src: *u8, entryisdir: i32, out: *u8, objstem: *u8, incs: *u8, lf: *lflags) i32 = { +fn buildone(selfdir: *u8, src: *u8, entryisdir: i32, out: *u8, objstem: *u8, incs: *u8, lf: *lflags, istest: i32) i32 = { let c6: *u8 = joinpathlit(selfdir, "w6c_ww"); let a6: *u8 = joinpathlit(selfdir, "w6a_ww"); let l6: *u8 = joinpathlit(selfdir, "w6l_ww"); @@ -3729,15 +3729,17 @@ fn buildone(selfdir: *u8, src: *u8, entryisdir: i32, out: *u8, objstem: *u8, inc }; os.close(cf); - // Step 2: w6c -o .s .combined.ww + // Step 2: w6c [-T] -o .s .combined.ww { - let argv: []*u8 = alloc([], 5u64)!; - argv.len = 5; - argv[0] = "w6c\0".ptr; - argv[1] = "-o\0".ptr; - argv[2] = asmf; - argv[3] = combined; - argv[4] = nil; + let argv: []*u8 = alloc([], 6u64)!; + let p: i32 = 0; + argv[p] = "w6c\0".ptr; p += 1; + if (istest != 0) { argv[p] = "-T\0".ptr; p += 1; }; + argv[p] = "-o\0".ptr; p += 1; + argv[p] = asmf; p += 1; + argv[p] = combined; p += 1; + argv[p] = nil; p += 1; + argv.len = p; if (procrun(c6, argv.ptr) != 0) { cerr("ww: w6c failed\n"); return 1; @@ -4079,7 +4081,7 @@ fn dobuild(selfdir: *u8, argv: **u8, argc: i32, start: i32) i32 = { lf.nlibdirs = nlibdirs; lf.libs = libs.ptr; lf.nlibs = nlibs; - return buildone(selfdir, resolved, isdir, out, objstem, incs.ptr, &lf); + return buildone(selfdir, resolved, isdir, out, objstem, incs.ptr, &lf, 0i32); }; // Format the scratch path /tmp/ww_run_ into buf. Returns NUL- @@ -4235,7 +4237,7 @@ fn dorun(selfdir: *u8, argv: **u8, argc: i32, start: i32) i32 = { lf.nlibs = nlibs; // objstem = tmp → intermediates at /tmp/ww_run_.{s,o,combined.ww}, // never next to the source (T3). - if (buildone(selfdir, resolved, isdir, tmp.ptr, tmp.ptr, incs.ptr, &lf) != 0) { + if (buildone(selfdir, resolved, isdir, tmp.ptr, tmp.ptr, incs.ptr, &lf, 0i32) != 0) { os.remove(pathstr(tmp.ptr)); return 1; }; @@ -4265,11 +4267,11 @@ fn dorun(selfdir: *u8, argv: **u8, argc: i32, start: i32) i32 = { // directory: open the dir, getdents64, build+run each *_test.ww, // report ok/FAIL per file, return 0 iff all pass. -fn runsingletest(selfdir: *u8, src: *u8) i32 = { +fn runsingletest(selfdir: *u8, src: *u8, incs: *u8) i32 = { let tmp: []u8 = alloc([], (os.PATH_MAX: u64))!; tmp.len = os.PATH_MAX; makeruntmp(tmp.ptr); - if (buildone(selfdir, src, 0, tmp.ptr, nil, "\0".ptr, nil) != 0) { + if (buildone(selfdir, src, 0, tmp.ptr, nil, incs, nil, 1i32) != 0) { os.remove(pathstr(tmp.ptr)); return 1; }; @@ -4324,7 +4326,7 @@ fn rundirtests(selfdir: *u8, dir: *u8) i32 = { let tmp: []u8 = alloc([], (os.PATH_MAX: u64))!; tmp.len = os.PATH_MAX; makeruntmp(tmp.ptr); - let bres: i32 = buildone(selfdir, path.ptr, 0, tmp.ptr, nil, tincs.ptr, nil); + let bres: i32 = buildone(selfdir, path.ptr, 0, tmp.ptr, nil, tincs.ptr, nil, 1i32); if (bres != 0) { fail += 1; cerr("FAIL "); @@ -4360,18 +4362,55 @@ fn rundirtests(selfdir: *u8, dir: *u8) i32 = { }; fn dotest(selfdir: *u8, argv: **u8, argc: i32, start: i32) i32 = { - let target: *u8; - if (start >= argc) { + // -I parsing mirrors dobuild/dorun so a single-file test can resolve + // transitive imports (e.g. 905_nkname asttest → tok); coupled to the + // -T flip (task #5/#10). + let target: *u8 = nil; + let incs: []u8 = alloc([], (os.PATH_MAX: u64) * 2u64)!; + incs.len = ((os.PATH_MAX: u64) * 2u64): i32; + let incoff: u64 = 0u64; + cstrseal(incs.ptr, 0u64); + + let i: i32 = start; + for (i < argc) { + let p: *u8 = argv[i]; + if (p[0u64] == 45u8) { // '-' + if (p[1u64] == 73u8) { // '-I' + let dir: *u8 = nil; + if (p[2u64] != 0u8) { + dir = p + 2u64; + } else { + if (i + 1 >= argc) { + cerr("ww test: -I needs an argument\n"); + return 2; + }; + i += 1; + dir = argv[i]; + }; + if (incoff > 0u64) { + incs[incoff] = 58u8; // ':' + incoff += 1u64; + }; + incoff = cstrinto(incs.ptr, incoff, dir); + cstrseal(incs.ptr, incoff); + } else { + cerr("ww test: unknown flag\n"); + return 2; + }; + } else { + if (target == nil) { target = p; }; + }; + i += 1; + }; + if (target == nil) { let dot: [2]u8 = ['.': u8, 0u8]; target = &dot[0]; - } else { - target = argv[start]; }; // single-file mode: literal *.ww that exists if (cstrendswithlit(target, ".ww")) { if (os.access(pathstr(target), 0i32) == 0) { - return runsingletest(selfdir, target); + return runsingletest(selfdir, target, incs.ptr); }; }; diff --git a/selfhost/cmd/ww/main.ww b/selfhost/cmd/ww/main.ww index 844b4af3..3ed0ecfc 100644 --- a/selfhost/cmd/ww/main.ww +++ b/selfhost/cmd/ww/main.ww @@ -828,7 +828,7 @@ type lflags = struct { // touches no C-built code at runtime. The C `ww` driver in cmd/ww/ // still drives the C-built w6c/w6a/w6l. Test 993 pins the two // pipelines to byte-identical output on a corpus. -fn buildone(selfdir: *u8, src: *u8, entryisdir: i32, out: *u8, objstem: *u8, incs: *u8, lf: *lflags) i32 = { +fn buildone(selfdir: *u8, src: *u8, entryisdir: i32, out: *u8, objstem: *u8, incs: *u8, lf: *lflags, istest: i32) i32 = { let c6: *u8 = joinpathlit(selfdir, "w6c_ww"); let a6: *u8 = joinpathlit(selfdir, "w6a_ww"); let l6: *u8 = joinpathlit(selfdir, "w6l_ww"); @@ -943,15 +943,17 @@ fn buildone(selfdir: *u8, src: *u8, entryisdir: i32, out: *u8, objstem: *u8, inc }; os.close(cf); - // Step 2: w6c -o .s .combined.ww + // Step 2: w6c [-T] -o .s .combined.ww { - let argv: []*u8 = alloc([], 5u64)!; - argv.len = 5; - argv[0] = "w6c\0".ptr; - argv[1] = "-o\0".ptr; - argv[2] = asmf; - argv[3] = combined; - argv[4] = nil; + let argv: []*u8 = alloc([], 6u64)!; + let p: i32 = 0; + argv[p] = "w6c\0".ptr; p += 1; + if (istest != 0) { argv[p] = "-T\0".ptr; p += 1; }; + argv[p] = "-o\0".ptr; p += 1; + argv[p] = asmf; p += 1; + argv[p] = combined; p += 1; + argv[p] = nil; p += 1; + argv.len = p; if (procrun(c6, argv.ptr) != 0) { cerr("ww: w6c failed\n"); return 1; @@ -1293,7 +1295,7 @@ fn dobuild(selfdir: *u8, argv: **u8, argc: i32, start: i32) i32 = { lf.nlibdirs = nlibdirs; lf.libs = libs.ptr; lf.nlibs = nlibs; - return buildone(selfdir, resolved, isdir, out, objstem, incs.ptr, &lf); + return buildone(selfdir, resolved, isdir, out, objstem, incs.ptr, &lf, 0i32); }; // Format the scratch path /tmp/ww_run_ into buf. Returns NUL- @@ -1449,7 +1451,7 @@ fn dorun(selfdir: *u8, argv: **u8, argc: i32, start: i32) i32 = { lf.nlibs = nlibs; // objstem = tmp → intermediates at /tmp/ww_run_.{s,o,combined.ww}, // never next to the source (T3). - if (buildone(selfdir, resolved, isdir, tmp.ptr, tmp.ptr, incs.ptr, &lf) != 0) { + if (buildone(selfdir, resolved, isdir, tmp.ptr, tmp.ptr, incs.ptr, &lf, 0i32) != 0) { os.remove(pathstr(tmp.ptr)); return 1; }; @@ -1479,11 +1481,11 @@ fn dorun(selfdir: *u8, argv: **u8, argc: i32, start: i32) i32 = { // directory: open the dir, getdents64, build+run each *_test.ww, // report ok/FAIL per file, return 0 iff all pass. -fn runsingletest(selfdir: *u8, src: *u8) i32 = { +fn runsingletest(selfdir: *u8, src: *u8, incs: *u8) i32 = { let tmp: []u8 = alloc([], (os.PATH_MAX: u64))!; tmp.len = os.PATH_MAX; makeruntmp(tmp.ptr); - if (buildone(selfdir, src, 0, tmp.ptr, nil, "\0".ptr, nil) != 0) { + if (buildone(selfdir, src, 0, tmp.ptr, nil, incs, nil, 1i32) != 0) { os.remove(pathstr(tmp.ptr)); return 1; }; @@ -1538,7 +1540,7 @@ fn rundirtests(selfdir: *u8, dir: *u8) i32 = { let tmp: []u8 = alloc([], (os.PATH_MAX: u64))!; tmp.len = os.PATH_MAX; makeruntmp(tmp.ptr); - let bres: i32 = buildone(selfdir, path.ptr, 0, tmp.ptr, nil, tincs.ptr, nil); + let bres: i32 = buildone(selfdir, path.ptr, 0, tmp.ptr, nil, tincs.ptr, nil, 1i32); if (bres != 0) { fail += 1; cerr("FAIL "); @@ -1574,18 +1576,55 @@ fn rundirtests(selfdir: *u8, dir: *u8) i32 = { }; fn dotest(selfdir: *u8, argv: **u8, argc: i32, start: i32) i32 = { - let target: *u8; - if (start >= argc) { + // -I parsing mirrors dobuild/dorun so a single-file test can resolve + // transitive imports (e.g. 905_nkname asttest → tok); coupled to the + // -T flip (task #5/#10). + let target: *u8 = nil; + let incs: []u8 = alloc([], (os.PATH_MAX: u64) * 2u64)!; + incs.len = ((os.PATH_MAX: u64) * 2u64): i32; + let incoff: u64 = 0u64; + cstrseal(incs.ptr, 0u64); + + let i: i32 = start; + for (i < argc) { + let p: *u8 = argv[i]; + if (p[0u64] == 45u8) { // '-' + if (p[1u64] == 73u8) { // '-I' + let dir: *u8 = nil; + if (p[2u64] != 0u8) { + dir = p + 2u64; + } else { + if (i + 1 >= argc) { + cerr("ww test: -I needs an argument\n"); + return 2; + }; + i += 1; + dir = argv[i]; + }; + if (incoff > 0u64) { + incs[incoff] = 58u8; // ':' + incoff += 1u64; + }; + incoff = cstrinto(incs.ptr, incoff, dir); + cstrseal(incs.ptr, incoff); + } else { + cerr("ww test: unknown flag\n"); + return 2; + }; + } else { + if (target == nil) { target = p; }; + }; + i += 1; + }; + if (target == nil) { let dot: [2]u8 = ['.': u8, 0u8]; target = &dot[0]; - } else { - target = argv[start]; }; // single-file mode: literal *.ww that exists if (cstrendswithlit(target, ".ww")) { if (os.access(pathstr(target), 0i32) == 0) { - return runsingletest(selfdir, target); + return runsingletest(selfdir, target, incs.ptr); }; }; diff --git a/test/wcc/902_errno_run.c b/test/wcc/902_errno_run.c index f72a7940..bed10e6f 100644 --- a/test/wcc/902_errno_run.c +++ b/test/wcc/902_errno_run.c @@ -39,7 +39,7 @@ main(void) const char *src = "lib/errors/errnotest.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); (void)cwd; int rc = runwait(cmd); if (rc != 0) { diff --git a/test/wcc/904_ascii_run.c b/test/wcc/904_ascii_run.c index f43679cb..fbe4a293 100644 --- a/test/wcc/904_ascii_run.c +++ b/test/wcc/904_ascii_run.c @@ -38,7 +38,7 @@ main(void) const char *src = "lib/ascii/asciitest.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "ascii_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/904_tok_run.c b/test/wcc/904_tok_run.c index e832fbf5..b636045c 100644 --- a/test/wcc/904_tok_run.c +++ b/test/wcc/904_tok_run.c @@ -41,7 +41,7 @@ main(void) const char *src = "lib/ww/lex/toktest.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "tok_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/905_nkname_run.c b/test/wcc/905_nkname_run.c index 4f760c0f..05c25d0a 100644 --- a/test/wcc/905_nkname_run.c +++ b/test/wcc/905_nkname_run.c @@ -46,7 +46,7 @@ main(void) char path[1024], inc[1024], cmd[3072]; snprintf(path, sizeof path, "%s/%s", cwd, src); snprintf(inc, sizeof inc, "%s/lib/ww/lex", cwd); - snprintf(cmd, sizeof cmd, "%s/ww run -I %s %s", bin, inc, path); + snprintf(cmd, sizeof cmd, "%s/ww test -I %s %s", bin, inc, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "nkname_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/908_ftos_run.c b/test/wcc/908_ftos_run.c index a9253a18..b4c72e70 100644 --- a/test/wcc/908_ftos_run.c +++ b/test/wcc/908_ftos_run.c @@ -44,7 +44,7 @@ main(void) const char *src = "lib/strconv/test/ftostest.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "ftos_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/909_stof_run.c b/test/wcc/909_stof_run.c index 06674616..e7cd92bd 100644 --- a/test/wcc/909_stof_run.c +++ b/test/wcc/909_stof_run.c @@ -44,7 +44,7 @@ main(void) const char *src = "lib/strconv/test/stoftest.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "stof_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/922_strconv_int_run.c b/test/wcc/922_strconv_int_run.c index 7d7012d7..34947f7d 100644 --- a/test/wcc/922_strconv_int_run.c +++ b/test/wcc/922_strconv_int_run.c @@ -43,7 +43,7 @@ main(void) const char *src = "lib/strconv/test/inttest.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "strconv_int_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/966_strings_run.c b/test/wcc/966_strings_run.c index 1bcf09d3..df0fe8ea 100644 --- a/test/wcc/966_strings_run.c +++ b/test/wcc/966_strings_run.c @@ -38,7 +38,7 @@ main(void) const char *src = "lib/strings/stringstest.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); (void)cwd; int rc = runwait(cmd); if (rc != 0) { diff --git a/test/wcc/967_bytes_run.c b/test/wcc/967_bytes_run.c index 28be2420..bc3e418d 100644 --- a/test/wcc/967_bytes_run.c +++ b/test/wcc/967_bytes_run.c @@ -38,7 +38,7 @@ main(void) const char *src = "lib/bytes/bytestest.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "bytes_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/968_utf8_run.c b/test/wcc/968_utf8_run.c index 60d30b46..448e6ad3 100644 --- a/test/wcc/968_utf8_run.c +++ b/test/wcc/968_utf8_run.c @@ -40,7 +40,7 @@ main(void) const char *src = "lib/encoding/utf8/utf8test.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "utf8_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/969_checked_run.c b/test/wcc/969_checked_run.c index d751ea2b..d22e8f57 100644 --- a/test/wcc/969_checked_run.c +++ b/test/wcc/969_checked_run.c @@ -40,7 +40,7 @@ main(void) const char *src = "lib/math/checked/checked_test.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "checked_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/970_fmt_run.c b/test/wcc/970_fmt_run.c index 7ec9027c..73e8f7b5 100644 --- a/test/wcc/970_fmt_run.c +++ b/test/wcc/970_fmt_run.c @@ -41,7 +41,7 @@ main(void) const char *src = "lib/fmt/fmttest.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); (void)cwd; int rc = runwait(cmd); if (rc != 0) { diff --git a/test/wcc/971_log_run.c b/test/wcc/971_log_run.c index c5176e9a..0969126a 100644 --- a/test/wcc/971_log_run.c +++ b/test/wcc/971_log_run.c @@ -41,7 +41,7 @@ main(void) const char *src = "lib/log/logtest.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); (void)cwd; int rc = runwait(cmd); if (rc != 0) { diff --git a/test/wcc/972_fnmatch_run.c b/test/wcc/972_fnmatch_run.c index f7b5439b..19689878 100644 --- a/test/wcc/972_fnmatch_run.c +++ b/test/wcc/972_fnmatch_run.c @@ -41,7 +41,7 @@ main(void) const char *src = "lib/fnmatch/fnmatchtest.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); (void)cwd; int rc = runwait(cmd); if (rc != 0) { diff --git a/test/wcc/973_shlex_run.c b/test/wcc/973_shlex_run.c index 115a3f87..8f48febf 100644 --- a/test/wcc/973_shlex_run.c +++ b/test/wcc/973_shlex_run.c @@ -41,7 +41,7 @@ main(void) const char *src = "lib/shlex/shlextest.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "shlex_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/974_getenv_run.c b/test/wcc/974_getenv_run.c index 3e29347d..f395ad29 100644 --- a/test/wcc/974_getenv_run.c +++ b/test/wcc/974_getenv_run.c @@ -54,7 +54,7 @@ main(void) const char *src = "lib/os/ostest.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "getenv_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/975_dirs_run.c b/test/wcc/975_dirs_run.c index 9bc85192..c0b11ed1 100644 --- a/test/wcc/975_dirs_run.c +++ b/test/wcc/975_dirs_run.c @@ -67,7 +67,7 @@ main(void) const char *src = "lib/dirs/dirstest.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); /* Cleanup regardless of pass/fail — no residue under /tmp. */ diff --git a/test/wcc/976_stat_run.c b/test/wcc/976_stat_run.c index 6701de06..f97bc012 100644 --- a/test/wcc/976_stat_run.c +++ b/test/wcc/976_stat_run.c @@ -85,7 +85,7 @@ main(void) const char *src = "lib/os/stattest.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); char rmcmd[256]; diff --git a/test/wcc/977_time_run.c b/test/wcc/977_time_run.c index 50f50619..d4794dc8 100644 --- a/test/wcc/977_time_run.c +++ b/test/wcc/977_time_run.c @@ -38,7 +38,7 @@ main(void) const char *src = "lib/time/timetest.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "time_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/979_hex_run.c b/test/wcc/979_hex_run.c index f6a605b9..4548ba14 100644 --- a/test/wcc/979_hex_run.c +++ b/test/wcc/979_hex_run.c @@ -38,7 +38,7 @@ main(void) const char *src = "lib/encoding/hex/hextest.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "hex_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/980_memio_run.c b/test/wcc/980_memio_run.c index eaa5caf0..9813e080 100644 --- a/test/wcc/980_memio_run.c +++ b/test/wcc/980_memio_run.c @@ -40,7 +40,7 @@ main(void) const char *src = "lib/memio/memiotest.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "memio_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/981_temp_run.c b/test/wcc/981_temp_run.c index 47e0c39c..2aad76c0 100644 --- a/test/wcc/981_temp_run.c +++ b/test/wcc/981_temp_run.c @@ -39,7 +39,7 @@ main(void) const char *src = "lib/temp/temptest.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "temp_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/982_getopt_run.c b/test/wcc/982_getopt_run.c index e19e873c..90d6c8e4 100644 --- a/test/wcc/982_getopt_run.c +++ b/test/wcc/982_getopt_run.c @@ -40,7 +40,7 @@ main(void) const char *src = "lib/getopt/getopttest.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); (void)cwd; int rc = runwait(cmd); if (rc != 0) { diff --git a/test/wcc/983_base32_run.c b/test/wcc/983_base32_run.c index 0ddec4b4..ec9dc814 100644 --- a/test/wcc/983_base32_run.c +++ b/test/wcc/983_base32_run.c @@ -40,7 +40,7 @@ main(void) const char *src = "lib/encoding/base32/base32_test.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "base32_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/984_base64_run.c b/test/wcc/984_base64_run.c index 19b2fc91..fb7a0836 100644 --- a/test/wcc/984_base64_run.c +++ b/test/wcc/984_base64_run.c @@ -40,7 +40,7 @@ main(void) const char *src = "lib/encoding/base64/base64_test.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "base64_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/985_adler32_run.c b/test/wcc/985_adler32_run.c index a6651edc..2cc6584c 100644 --- a/test/wcc/985_adler32_run.c +++ b/test/wcc/985_adler32_run.c @@ -40,7 +40,7 @@ main(void) const char *src = "lib/hash/adler32/adler32_test.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "adler32_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/986_crc16_run.c b/test/wcc/986_crc16_run.c index 6976c659..29a07036 100644 --- a/test/wcc/986_crc16_run.c +++ b/test/wcc/986_crc16_run.c @@ -40,7 +40,7 @@ main(void) const char *src = "lib/hash/crc16/crc16_test.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "crc16_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/987_crc32_run.c b/test/wcc/987_crc32_run.c index d6719b0a..aa89ed29 100644 --- a/test/wcc/987_crc32_run.c +++ b/test/wcc/987_crc32_run.c @@ -40,7 +40,7 @@ main(void) const char *src = "lib/hash/crc32/crc32_test.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "crc32_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/988_crc64_run.c b/test/wcc/988_crc64_run.c index 6c4df5df..1af08831 100644 --- a/test/wcc/988_crc64_run.c +++ b/test/wcc/988_crc64_run.c @@ -40,7 +40,7 @@ main(void) const char *src = "lib/hash/crc64/crc64_test.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "crc64_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/989_lib_byteid.c b/test/wcc/989_lib_byteid.c index cc513548..2c54631d 100644 --- a/test/wcc/989_lib_byteid.c +++ b/test/wcc/989_lib_byteid.c @@ -291,14 +291,19 @@ check_one(const char *bin, const char *cwd, const struct ent *e, int idx) char cs[512], ws[512]; snprintf(cs, sizeof cs, "%s/c.s", td); snprintf(ws, sizeof ws, "%s/w.s", td); - snprintf(cmd, sizeof cmd, "timeout 180 %s/w6c %s > %s 2>/dev/null", - bin, comb, cs); + /* Fixtures are main-less @test files: -T synthesizes the entry and + * keeps the @test fns symmetrically (non-T drops them cstage-side, + * task #6, so byte-id needs -T). Import-probes carry their own + * `fn main()`, which -T loud-rejects (910), so they stay non-T. */ + const char *tflag = e->fixture ? "-T " : ""; + snprintf(cmd, sizeof cmd, "timeout 180 %s/w6c %s%s > %s 2>/dev/null", + bin, tflag, comb, cs); if (runwait(cmd) != 0) { fprintf(stderr, "lib_byteid FAIL: %s — w6c rejected\n", label); goto out; } - snprintf(cmd, sizeof cmd, "timeout 180 %s/w6c_ww -o %s %s >/dev/null 2>&1", - bin, ws, comb); + snprintf(cmd, sizeof cmd, "timeout 180 %s/w6c_ww %s-o %s %s >/dev/null 2>&1", + bin, tflag, ws, comb); int wrc = runwait(cmd); if (e->mode == M_WWREJECT) { diff --git a/test/wcc/989_path_run.c b/test/wcc/989_path_run.c index 3e9f2a49..c14c9c91 100644 --- a/test/wcc/989_path_run.c +++ b/test/wcc/989_path_run.c @@ -38,7 +38,7 @@ main(void) const char *src = "lib/path/pathtest.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "path_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/989_regex_run.c b/test/wcc/989_regex_run.c index 77fa211a..f61e338a 100644 --- a/test/wcc/989_regex_run.c +++ b/test/wcc/989_regex_run.c @@ -47,7 +47,7 @@ main(void) * regression of the ha:946-952 rune-advancement guard into an * infinite loop (frees are no-ops, so OOM is the only other * exit) — timeout converts the hang into a loud 124. */ - snprintf(cmd, sizeof cmd, "timeout 180 %s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "timeout 180 %s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "regex_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/989_sha256_run.c b/test/wcc/989_sha256_run.c index 89666c08..63f29c9a 100644 --- a/test/wcc/989_sha256_run.c +++ b/test/wcc/989_sha256_run.c @@ -41,7 +41,7 @@ main(void) const char *src = "lib/crypto/sha256/sha256_test.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "sha256_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/989_siphash_run.c b/test/wcc/989_siphash_run.c index 6cf2809c..a27d6067 100644 --- a/test/wcc/989_siphash_run.c +++ b/test/wcc/989_siphash_run.c @@ -40,7 +40,7 @@ main(void) const char *src = "lib/hash/siphash/siphash_test.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "siphash_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/998_bufio_run.c b/test/wcc/998_bufio_run.c index 8ef875fd..07c77962 100644 --- a/test/wcc/998_bufio_run.c +++ b/test/wcc/998_bufio_run.c @@ -47,7 +47,7 @@ main(void) const char *src = "lib/bufio/bufiotest.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "bufio_run FAIL: %s exited %d\n", src, rc); diff --git a/test/wcc/999_random_run.c b/test/wcc/999_random_run.c index 50080bab..60b348ef 100644 --- a/test/wcc/999_random_run.c +++ b/test/wcc/999_random_run.c @@ -43,7 +43,7 @@ main(void) const char *src = "lib/math/random/random_test.ww"; char path[1024], cmd[2048]; snprintf(path, sizeof path, "%s/%s", cwd, src); - snprintf(cmd, sizeof cmd, "%s/ww run %s", bin, path); + snprintf(cmd, sizeof cmd, "%s/ww test %s", bin, path); int rc = runwait(cmd); if (rc != 0) { fprintf(stderr, "random_run FAIL: %s exited %d\n", src, rc);