diff --git a/nimcheck.nimble b/nimcheck.nimble index 579950d..cfe66df 100644 --- a/nimcheck.nimble +++ b/nimcheck.nimble @@ -5,51 +5,56 @@ author = "molodetz" description = "Universal source code validation framework - validates source files across all common languages with tokenizer-based analysis, auto-detection, and JSON diagnostics." license = "MIT" srcDir = "src" +binDir = "bin" +bin = @["nimcheck"] # Dependencies requires "nim >= 2.0.0" +import std/os + # Tasks +proc runTestFile(fileName: string, extraFlags: string = "") = + let testPath = thisDir() / "tests" / fileName + exec "nim c " & extraFlags & " -r \"" & testPath & "\"" + task test, "Run all tests": - exec "nim c -r tests/test_all.nim" + runTestFile("test_all.nim") task test_nim, "Run Nim-specific tests": - exec "nim c -r tests/test_nim.nim" + runTestFile("test_nim.nim") task test_python, "Run Python-specific tests": - exec "nim c -r tests/test_python.nim" + runTestFile("test_python.nim") task test_bash, "Run Bash-specific tests": - exec "nim c -r tests/test_bash.nim" + runTestFile("test_bash.nim") task test_js, "Run JavaScript-specific tests": - exec "nim c -r tests/test_javascript.nim" + runTestFile("test_javascript.nim") task test_php, "Run PHP-specific tests": - exec "nim c -r tests/test_php.nim" + runTestFile("test_php.nim") task test_html, "Run HTML-specific tests": - exec "nim c -r tests/test_html.nim" + runTestFile("test_html.nim") task test_jinja, "Run Jinja-specific tests": - exec "nim c -r tests/test_jinja.nim" + runTestFile("test_jinja.nim") task test_json, "Run JSON-specific tests": - exec "nim c -r tests/test_json.nim" + runTestFile("test_json_exhaustive.nim") task test_yaml, "Run YAML-specific tests": - exec "nim c -r tests/test_yaml.nim" + runTestFile("test_yaml_exhaustive.nim") task test_toml, "Run TOML-specific tests": - exec "nim c -r tests/test_toml.nim" + runTestFile("test_toml_exhaustive.nim") task test_mixed, "Run mixed file tests": - exec "nim c -r tests/test_mixed.nim" + runTestFile("test_mixed.nim") task debug, "Run tests in debug mode": - exec "nim c -d:nimcheckDebug -r tests/test_all.nim" - -task build, "Build the library": - exec "nim c --lib src/nimcheck.nim" + runTestFile("test_all.nim", "-d:nimcheckDebug") # End