-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
598478f
commit 985293b
Showing
4 changed files
with
47 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,4 +40,4 @@ jobs: | |
run: v . | ||
|
||
- name: Run tests | ||
run: v -g run . | ||
run: v -g test . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
module main | ||
|
||
import strings | ||
import os | ||
|
||
fn test_all() { | ||
mut subdir := 'tests' | ||
mut app := &App{ | ||
sb: strings.new_builder(1000) | ||
} | ||
|
||
// All tests | ||
mut test_names := os.ls('tests') or { return } | ||
test_names.sort() | ||
mut tests_ok := true | ||
for test_name in test_names { | ||
println('===========================================') | ||
create_json(subdir, test_name) | ||
// A separate instance for each test | ||
mut app2 := &App{ | ||
sb: strings.new_builder(1000) | ||
} | ||
app2.run_test(subdir, test_name) or { | ||
eprintln('Error running test ${test_name}: ${err}') | ||
break | ||
} | ||
tests_ok &&= app2.tests_ok | ||
} | ||
// if !app.tests_ok { | ||
if !tests_ok { | ||
exit(1) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters