native test framework
This commit is contained in:
@@ -103,6 +103,9 @@ print_usage :: proc() {
|
||||
fmt.eprintln(
|
||||
" brolang build [root] (reads root/build.bro; writes root/build/name)",
|
||||
)
|
||||
fmt.eprintln(
|
||||
" brolang test [root] (reads root/build.bro; writes and runs root/build/name-test)",
|
||||
)
|
||||
fmt.eprintln(
|
||||
" brolang new <project-path>",
|
||||
)
|
||||
@@ -122,6 +125,10 @@ is_build_command :: proc(arg: string) -> bool {
|
||||
return arg == "build"
|
||||
}
|
||||
|
||||
is_test_command :: proc(arg: string) -> bool {
|
||||
return arg == "test"
|
||||
}
|
||||
|
||||
is_new_command :: proc(arg: string) -> bool {
|
||||
return arg == "new"
|
||||
}
|
||||
@@ -609,6 +616,14 @@ main :: proc() {
|
||||
root := os2.args[2] if len(os2.args) == 3 else ""
|
||||
os2.exit(compiler.run_build(root))
|
||||
}
|
||||
if len(os2.args) >= 2 && is_test_command(os2.args[1]) {
|
||||
if len(os2.args) > 3 {
|
||||
print_usage()
|
||||
os2.exit(2)
|
||||
}
|
||||
root := os2.args[2] if len(os2.args) == 3 else ""
|
||||
os2.exit(compiler.run_tests(root))
|
||||
}
|
||||
if len(os2.args) >= 2 && is_new_command(os2.args[1]) {
|
||||
if len(os2.args) != 3 {
|
||||
print_usage()
|
||||
|
||||
Reference in New Issue
Block a user