You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
testament currently relies on files known at CT in several places eg:
testament/lib/stdtest/specialpaths.nim
nimRoot eg:
of"r", "run":
# "/pathto/tests/stdlib/nre/captures.nim" -> "stdlib" + "tests/stdlib/nre/captures.nim"var subPath = p.key.stringlet nimRoot = currentSourcePath /"../.."# makes sure points to this regardless of cwd or which nim is used to compile this.doAssertdirExists(nimRoot/testsDir) # sanity checkif subPath.isAbsolute: subPath = subPath.relativePath(nimRoot)
(EDIT) getCurrentCompilerExe
bug 1
this can cause problems if testament is installed (eg via choosenim)
Just the testament installed has issues, if I compile testament by myself, it is fine
nim c -r testament/testament.nim r tests/errmsgs/t1154.nim ok
testament/testament.exe r tests/errmsgs/t1154.nim ok
testament r tests/errmsgs/t1154.nim
testament.nim(798, 14) dirExists(nimRoot / testsDir) [AssertionDefect]
nim r testament/testament.nim r tests/bar/tbar.nim
testament/testament --nim:/pathto/nim r tests/bar/tbar.nim
work with testament as a tool for user projects
etc
solution 1
don't install testament and require users to compile and run it themselves
solution 2
use some logic analog to getPrefixDir in compiler/options.nim that infers location of prefixDir and allows overriding it at runtime.
Not ideal if it prevents having nimRootDir, stdlibDir, testsDir, buildDir etc known at CT
solution 3
maybe simply a targetted fix for bug 1 can be made, eg by inferring the location of nimRoot or testsDir at runtime from the input file passed to testament r inputfile, eg:
testament r /pathto/tests/stdlib/nre/captures.nim
=>
"stdlib" + "tests/stdlib/nre/captures.nim"
by walking up the inputfile until we find the right directory; a question is how to do that reliably so that for eg it's not fooled by: nim r /pathto/tests/sub/tests/tbar.nim
testament currently relies on files known at CT in several places eg:
testament/lib/stdtest/specialpaths.nim
nimRoot
eg:bug 1
this can cause problems if
testament
is installed (eg via choosenim)according to @xflywind:
EDIT: now shows:
constraints
should work in various conditions eg:
etc
solution 1
solution 2
getPrefixDir
in compiler/options.nim that infers location ofprefixDir
and allows overriding it at runtime.Not ideal if it prevents having nimRootDir, stdlibDir, testsDir, buildDir etc known at CT
solution 3
maybe simply a targetted fix for bug 1 can be made, eg by inferring the location of nimRoot or testsDir at runtime from the input file passed to
testament r inputfile
, eg:testament r /pathto/tests/stdlib/nre/captures.nim
=>
"stdlib" + "tests/stdlib/nre/captures.nim"
by walking up the inputfile until we find the right directory; a question is how to do that reliably so that for eg it's not fooled by:
nim r /pathto/tests/sub/tests/tbar.nim
links
testament r tests/js/foo
now works; testament now honors --targets nim-lang/Nim#16163 (comment)The text was updated successfully, but these errors were encountered: