new var declaration syntax
This commit is contained in:
16
test.zr
16
test.zr
@@ -1,6 +1,6 @@
|
||||
func run_test[x: str] : void
|
||||
let build_blacklist = ["examples/puzzles", "examples/raylib.zr", "examples/chip8.zr", "examples/sqlite_todo.zr"]
|
||||
let run_blacklist = ["/aoc", "guess_number.zr", "tcp_server.zr", "udp_server.zr"]
|
||||
build_blacklist := ["examples/puzzles", "examples/raylib.zr", "examples/chip8.zr", "examples/sqlite_todo.zr"]
|
||||
run_blacklist := ["/aoc", "guess_number.zr", "tcp_server.zr", "udp_server.zr"]
|
||||
|
||||
for i in 0..build_blacklist->size
|
||||
if str.equal(x, array.nth(build_blacklist, i))
|
||||
@@ -9,10 +9,10 @@ func run_test[x: str] : void
|
||||
|
||||
io.printf("Building %s...\n", x)
|
||||
|
||||
let build_start_time = os.time()
|
||||
build_start_time := os.time()
|
||||
if must(os.run_shell_command?(str.concat("./target/release/zern ", x))) != 0
|
||||
os.exit(1)
|
||||
let build_end_time = os.time()
|
||||
build_end_time := os.time()
|
||||
|
||||
io.printf("%dms\n", build_end_time - build_start_time)
|
||||
|
||||
@@ -25,19 +25,19 @@ func run_test[x: str] : void
|
||||
|
||||
io.printf("Running %s...\n", x)
|
||||
|
||||
let run_cmd = "./out"
|
||||
run_cmd := "./out"
|
||||
if str.equal(x, "examples/curl.zr")
|
||||
run_cmd = str.concat(run_cmd, " http://example.com")
|
||||
|
||||
let run_start_time = os.time()
|
||||
run_start_time := os.time()
|
||||
if must(os.run_shell_command?(run_cmd)) != 0
|
||||
os.exit(1)
|
||||
let run_end_time = os.time()
|
||||
run_end_time := os.time()
|
||||
|
||||
io.printf("Running %s took %dms\n", x, run_end_time - run_start_time)
|
||||
|
||||
func run_directory[dir: str] : void
|
||||
let files: Array = must(os.list_directory?(dir))
|
||||
files : Array = must(os.list_directory?(dir))
|
||||
for i in 0..files->size
|
||||
run_test(str.concat(dir, array.nth(files, i)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user