mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-04 06:53:12 +00:00
Fix using 'make test <nim source file>', it was failing to run properly without specified test case (#3550)
This commit is contained in:
parent
228e637c9f
commit
6cf3644097
4
Makefile
4
Makefile
@ -257,9 +257,9 @@ build/%: | build deps librln
|
|||||||
$(ENV_SCRIPT) nim buildone $(NIM_PARAMS) waku.nims $*
|
$(ENV_SCRIPT) nim buildone $(NIM_PARAMS) waku.nims $*
|
||||||
|
|
||||||
compile-test: | build deps librln
|
compile-test: | build deps librln
|
||||||
echo -e $(BUILD_MSG) "$(TEST_FILE)" && \
|
echo -e $(BUILD_MSG) "$(TEST_FILE)" "\"$(TEST_NAME)\"" && \
|
||||||
$(ENV_SCRIPT) nim buildTest $(NIM_PARAMS) waku.nims $(TEST_FILE) && \
|
$(ENV_SCRIPT) nim buildTest $(NIM_PARAMS) waku.nims $(TEST_FILE) && \
|
||||||
$(ENV_SCRIPT) nim execTest $(NIM_PARAMS) waku.nims $(TEST_FILE) "$(TEST_NAME)"
|
$(ENV_SCRIPT) nim execTest $(NIM_PARAMS) waku.nims $(TEST_FILE) "\"$(TEST_NAME)\""; \
|
||||||
|
|
||||||
################
|
################
|
||||||
## Waku tools ##
|
## Waku tools ##
|
||||||
|
|||||||
10
waku.nimble
10
waku.nimble
@ -165,9 +165,17 @@ task buildTest, "Test custom target":
|
|||||||
let filepath = paramStr(paramCount())
|
let filepath = paramStr(paramCount())
|
||||||
discard buildModule(filepath)
|
discard buildModule(filepath)
|
||||||
|
|
||||||
|
import std/strutils
|
||||||
|
|
||||||
task execTest, "Run test":
|
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)
|
let filepath = paramStr(paramCount() - 1)
|
||||||
exec "build/" & filepath & ".bin" & " test \"" & paramStr(paramCount()) & "\""
|
var testSuite = paramStr(paramCount()).strip(chars = {'\"'})
|
||||||
|
if testSuite != "":
|
||||||
|
testSuite = " \"" & testSuite & "\""
|
||||||
|
exec "build/" & filepath & ".bin " & testSuite
|
||||||
|
|
||||||
### C Bindings
|
### C Bindings
|
||||||
let chroniclesParams =
|
let chroniclesParams =
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user