diff --git a/Makefile b/Makefile index af76d8385..c24c63459 100644 --- a/Makefile +++ b/Makefile @@ -270,8 +270,8 @@ build/%: | $(NIMBLEDEPS_STAMP) build deps librln compile-test: | $(NIMBLEDEPS_STAMP) build deps librln echo -e $(BUILD_MSG) "$(TEST_FILE)" "\"$(TEST_NAME)\"" && \ - nimble buildTest $(TEST_FILE) && \ - nimble execTest $(TEST_FILE) "\"$(TEST_NAME)\"" + TEST_FILE="$(TEST_FILE)" nimble buildTest && \ + TEST_FILE="$(TEST_FILE)" TEST_NAME="$(TEST_NAME)" nimble execTest ################ ## Waku tools ## diff --git a/waku.nimble b/waku.nimble index a366142ea..6ef8fcecf 100644 --- a/waku.nimble +++ b/waku.nimble @@ -80,10 +80,7 @@ proc getNimParams(): string = proc buildModule(filePath, params = "", lang = "c"): bool = if not dirExists "build": mkDir "build" - # allow something like "nim nimbus --verbosity:0 --hints:off nimbus.nims" var extra_params = params - for i in 2 ..< paramCount() - 1: - extra_params &= " " & paramStr(i) if not fileExists(filePath): echo "File to build not found: " & filePath @@ -447,20 +444,21 @@ task lightpushwithmix, "Build lightpushwithmix": buildBinary name, "examples/lightpush_mix/" task buildTest, "Test custom target": - let filepath = paramStr(paramCount()) + let filepath = getEnv("TEST_FILE") + if filepath == "": + quit "Missing TEST_FILE environment variable" discard buildModule(filepath) import std/strutils task execTest, "Run test": - # Expects to be parameterized with test case name in quotes - # preceded with the nim source file name and path - # If no test case name is given still it requires empty quotes `""` - let filepath = paramStr(paramCount() - 1) - var testSuite = paramStr(paramCount()).strip(chars = {'\"'}) + let filepath = getEnv("TEST_FILE") + if filepath == "": + quit "Missing TEST_FILE environment variable" + var testSuite = getEnv("TEST_NAME").strip(chars = {'\"'}) if testSuite != "": testSuite = " \"" & testSuite & "\"" - exec "build/" & filepath & ".bin " & testSuite + exec "build/" & filepath & ".bin" & testSuite ### C Bindings let chroniclesParams =