nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.56k stars 1.47k forks source link

testament shouldn't be tied to nim repo's test suite when distributed as an external tool #16830

Open timotheecour opened 3 years ago

timotheecour commented 3 years ago

testament was published as an external tool as an after thought; if it is to remain a valid tool for testing 3rd party code it should be stripped from logic that's specific to nim's own test suite.

Here are just 2 examples:

Example 1

# tests/flags/tmain.nim:
doAssert true

testament all

Current Output

Error: unhandled exception: cannot open: tests/flags/tgenscript.nim [IOError]

Expected Output

should not reference tests/flags/tgenscript.nim, which is a file specific to nim repo

Example 2

testament all calls these: progress[all]: 1/6 starting: cat: debugger progress[all]: 2/6 starting: cat: examples progress[all]: 3/6 starting: cat: lib progress[all]: 4/6 starting: cat: ic progress[all]: 5/6 starting: cat: megatest apart from megatest, the other categories don't make sense for testament as external tool

Possible Solution

separate out all logic specific to nim repo so it doesn't affect the testament tool that's distributed as a binary for 3rd party repos

Additional Information

Araq commented 3 years ago

Totally agree, but the fix can be as simple as a bunch of if statements and a --nimsTestsuite flag. Or maybe see if tests is relative to ../bin which contains nim.exe.

timotheecour commented 3 years ago

see https://github.com/nim-lang/Nim/pull/16831