summary refs log tree commit diff stats
path: root/testament/lib
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2019-01-13 00:00:39 -0800
committerAndreas Rumpf <rumpf_a@web.de>2019-01-13 09:00:39 +0100
commit9af85fb69f26dcae5fba7881a597d78f6bc7ffc8 (patch)
treed267ba0b76363369bd8907d5e4924eac1e85e7eb /testament/lib
parentf5cc2e2de567b36d33778ddf263b7a440f1d3b11 (diff)
downloadNim-9af85fb69f26dcae5fba7881a597d78f6bc7ffc8.tar.gz
fixes #10273 execShellCmd now returns nonzero when child killed with signal + other fixes (#10274)
* s/exitStatus(...)/exitStatusLikeShell(...)/
* fix #10273 execShellCmd now returns nonzero when child exits with signal
* test case for #10249 and explanation for the bug
* fix test failure
* add tests/nim.cfg
Diffstat (limited to 'testament/lib')
-rw-r--r--testament/lib/stdtest/specialpaths.nim31
1 files changed, 31 insertions, 0 deletions
diff --git a/testament/lib/stdtest/specialpaths.nim b/testament/lib/stdtest/specialpaths.nim
new file mode 100644
index 000000000..3c8b2338c
--- /dev/null
+++ b/testament/lib/stdtest/specialpaths.nim
@@ -0,0 +1,31 @@
+#[
+todo: move findNimStdLibCompileTime, findNimStdLib here
+]#
+
+import os
+
+# Note: all the const paths defined here are known at compile time and valid
+# so long Nim repo isn't relocated after compilation.
+# This means the binaries they produce will embed hardcoded paths, which
+# isn't appropriate for some applications that need to be relocatable.
+
+const sourcePath = currentSourcePath()
+  # robust way to derive other paths here
+  # We don't depend on PATH so this is robust to having multiple nim
+  # binaries
+
+const nimRootDir* = sourcePath.parentDir.parentDir.parentDir.parentDir
+  ## root of Nim repo
+
+const stdlibDir* = nimRootDir / "lib"
+  # todo: make nimeval.findNimStdLibCompileTime use this
+
+const systemPath* = stdlibDir / "system.nim"
+
+const buildDir* = nimRootDir / "build"
+  ## refs #10268: all testament generated files should go here to avoid
+  ## polluting .gitignore
+
+static:
+  # sanity check
+  doAssert fileExists(systemPath)