Revert "fix make test <test> issue"

This reverts commit ccfe59b247022eca73d10cccd404b7b556d20f11.
This commit is contained in:
Ivan FB 2026-04-03 01:11:18 +02:00
parent 97a9a792d4
commit d01d92d7cd
No known key found for this signature in database
GPG Key ID: DF0C67A04C543270
2 changed files with 12 additions and 10 deletions

View File

@ -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)\"" && \
TEST_FILE="$(TEST_FILE)" nimble buildTest && \
TEST_FILE="$(TEST_FILE)" TEST_NAME="$(TEST_NAME)" nimble execTest
nimble buildTest $(TEST_FILE) && \
nimble execTest $(TEST_FILE) "\"$(TEST_NAME)\""
################
## Waku tools ##

View File

@ -80,7 +80,10 @@ 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
@ -444,21 +447,20 @@ task lightpushwithmix, "Build lightpushwithmix":
buildBinary name, "examples/lightpush_mix/"
task buildTest, "Test custom target":
let filepath = getEnv("TEST_FILE")
if filepath == "":
quit "Missing TEST_FILE environment variable"
let filepath = paramStr(paramCount())
discard buildModule(filepath)
import std/strutils
task execTest, "Run test":
let filepath = getEnv("TEST_FILE")
if filepath == "":
quit "Missing TEST_FILE environment variable"
var testSuite = getEnv("TEST_NAME").strip(chars = {'\"'})
# 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 = {'\"'})
if testSuite != "":
testSuite = " \"" & testSuite & "\""
exec "build/" & filepath & ".bin" & testSuite
exec "build/" & filepath & ".bin " & testSuite
### C Bindings
let chroniclesParams =