Skip to content

Commit

Permalink
test refc in Nim 2.0 and newer in addition to ORC (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
tersec authored Jun 26, 2024
1 parent 9d8ef49 commit f1e8f67
Showing 1 changed file with 32 additions and 26 deletions.
58 changes: 32 additions & 26 deletions regex.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,46 @@ skipDirs = @["tests", "bench", "docs"]
requires "nim >= 1.6.0"
requires "unicodedb >= 0.7.2"

template execTest(lang, target: static string) =
doAssert lang in ["c", "js"]
exec "nim " & lang & " --mm:refc " & target
if NimMajor >= 2:
exec "nim " & lang & " --mm:orc " & target

task test2, "Test":
exec "nim c -r -o:bin/regex src/regex.nim"
exec "nim c -r -o:bin/litopt src/regex/litopt.nim"
exec "nim c -r -o:bin/nfatype src/regex/nfatype.nim"
exec "nim c -r tests/tests2.nim"
exec "nim c -r -d:forceRegexAtRuntime tests/tests2.nim"
exec "nim c -r -d:forceRegexAtRuntime -d:noRegexOpt tests/tests2.nim"
exec "nim c -r -d:noRegexOpt tests/tests2.nim"
exec "nim c -d:runTestAtCT tests/tests2.nim"
exec "nim c -r tests/tests_misc.nim"
exec "nim c -r -d:forceRegexAtRuntime tests/tests_misc.nim"
exec "nim c -r -d:forceRegexAtRuntime -d:noRegexOpt tests/tests_misc.nim"
exec "nim c -r -d:noRegexOpt tests/tests_misc.nim"
execTest "c", "-r -o:bin/regex src/regex.nim"
execTest "c", "-r -o:bin/litopt src/regex/litopt.nim"
execTest "c", "-r -o:bin/nfatype src/regex/nfatype.nim"
execTest "c", "-r tests/tests2.nim"
execTest "c", "-r -d:forceRegexAtRuntime tests/tests2.nim"
execTest "c", "-r -d:forceRegexAtRuntime -d:noRegexOpt tests/tests2.nim"
execTest "c", "-r -d:noRegexOpt tests/tests2.nim"
execTest "c", "-d:runTestAtCT tests/tests2.nim"
execTest "c", "-r tests/tests_misc.nim"
execTest "c", "-r -d:forceRegexAtRuntime tests/tests_misc.nim"
execTest "c", "-r -d:forceRegexAtRuntime -d:noRegexOpt tests/tests_misc.nim"
execTest "c", "-r -d:noRegexOpt tests/tests_misc.nim"
# JS
exec "nim js -r src/regex.nim"
exec "nim js -r tests/tests2.nim"
exec "nim js -r -d:forceRegexAtRuntime tests/tests2.nim"
exec "nim js -r tests/tests_misc.nim"
exec "nim js -r -d:forceRegexAtRuntime tests/tests_misc.nim"
execTest "js", "-r src/regex.nim"
execTest "js", "-r tests/tests2.nim"
execTest "js", "-r -d:forceRegexAtRuntime tests/tests2.nim"
execTest "js", "-r tests/tests_misc.nim"
execTest "js", "-r -d:forceRegexAtRuntime tests/tests_misc.nim"
# test release/danger mode
exec "nim c -r -d:release -o:bin/regex src/regex.nim"
exec "nim c -r -d:danger -o:bin/regex src/regex.nim"
execTest "c", "-r -d:release -o:bin/regex src/regex.nim"
execTest "c", "-r -d:danger -o:bin/regex src/regex.nim"
# Test runnable examples
exec "nim doc -o:./docs/ugh/ugh.html ./src/regex.nim"

task oldtest, "Test":
# OLD DEPRECATED API TESTS
exec "nim c -r tests/tests.nim"
exec "nim c -r -d:forceRegexAtRuntime tests/tests.nim"
exec "nim c -r -d:forceRegexAtRuntime -d:noRegexOpt tests/tests.nim"
exec "nim c -r -d:noRegexOpt tests/tests.nim"
exec "nim c -d:runTestAtCT tests/tests.nim"
exec "nim js -r tests/tests.nim"
exec "nim js -r -d:forceRegexAtRuntime tests/tests.nim"
execTest "c", "-r tests/tests.nim"
execTest "c", "-r -d:forceRegexAtRuntime tests/tests.nim"
execTest "c", "-r -d:forceRegexAtRuntime -d:noRegexOpt tests/tests.nim"
execTest "c", "-r -d:noRegexOpt tests/tests.nim"
execTest "c", "-d:runTestAtCT tests/tests.nim"
execTest "js", "-r tests/tests.nim"
execTest "js", "-r -d:forceRegexAtRuntime tests/tests.nim"

task test, "Test":
exec "nimble test2"
Expand Down

0 comments on commit f1e8f67

Please sign in to comment.