Add failing ORC thread-safety regressions and run all suites with nimble test
This commit is contained in:
1 parent
15af03e5c5
commit
c1c8a3c072
8 files changed
+342
-2
No files matched your search
@@ -14,6 +14,42 @@ requires @["nim >= 2.2.0", "zero_functional"]
|
||||
# from https://git.jdb-software.com/jdb/nim-packages
|
||||
requires "timeutils"
|
||||
|
||||
task test, "Run unittests for the package.":
|
||||
exec "nimble c src/namespaced_logging.nim"
|
||||
proc runUnitTests() =
|
||||
exec "nimble c --mm:orc --threads:on src/namespaced_logging.nim"
|
||||
exec "src/namespaced_logging.out"
|
||||
|
||||
proc runRegressionTests() =
|
||||
exec "nimble c --mm:orc --threads:on -d:multithreaded --out:tests/bin/writer_child tests/writer_child.nim"
|
||||
exec "nimble c --mm:orc --threads:on --out:tests/bin/regressions tests/regressions.nim"
|
||||
exec "tests/bin/regressions"
|
||||
|
||||
proc runThreadSafetyTests() =
|
||||
exec "nimble c --mm:orc --threads:on --passC:-fsanitize=thread --passC:-g --passL:-fsanitize=thread --out:tests/bin/thread_safety tests/thread_safety.nim"
|
||||
exec "bash tests/run_tsan.sh tests/bin/thread_safety"
|
||||
|
||||
task test, "Run all tests, including ThreadSanitizer, and report all failing suites.":
|
||||
var failedSuites: seq[string] = @[]
|
||||
template runSuite(name: string, action: untyped) =
|
||||
echo "Running test suite: ", name
|
||||
try:
|
||||
action
|
||||
echo "PASS: ", name
|
||||
except OSError as err:
|
||||
echo "FAIL: ", name, ": ", err.msg
|
||||
failedSuites.add(name)
|
||||
|
||||
runSuite("unit", runUnitTests())
|
||||
runSuite("regression", runRegressionTests())
|
||||
runSuite("thread safety", runThreadSafetyTests())
|
||||
if failedSuites.len > 0:
|
||||
echo "Failed test suites: ", failedSuites
|
||||
quit(1)
|
||||
|
||||
task testUnit, "Run the existing embedded unit tests under ORC.":
|
||||
runUnitTests()
|
||||
|
||||
task testRegression, "Run ownership, configuration, and shutdown regressions.":
|
||||
runRegressionTests()
|
||||
|
||||
task testThreadSafety, "Run ORC ownership tests with ThreadSanitizer (Linux).":
|
||||
runThreadSafetyTests()
|
||||
Reference in new issue
Block a user