diff --git a/Makefile b/Makefile index 7894bed..e2e7b86 100644 --- a/Makefile +++ b/Makefile @@ -71,6 +71,12 @@ build-waku-nat: @echo "Start building waku nat-libs" $(MAKE) -C vendor/nwaku nat-libs @echo "Completed building nat-libs" + +.PHONY: tests +tests: | build-waku-librln build-waku-nat nim_chat_poc.nims + echo -e $(BUILD_MSG) "build/$@" && \ + $(ENV_SCRIPT) nim tests $(NIM_PARAMS) nim_chat_poc.nims + ########## ## Example ## diff --git a/nim_chat_poc.nimble b/nim_chat_poc.nimble index 40ec79e..329bcf3 100644 --- a/nim_chat_poc.nimble +++ b/nim_chat_poc.nimble @@ -33,6 +33,13 @@ proc buildBinary(name: string, srcDir = "./", params = "", lang = "c") = exec "nim " & lang & " --out:build/" & name & " --mm:refc " & extra_params & " " & srcDir & name & ".nim" + +proc test(name: string, params = "-d:chronicles_log_level=DEBUG", lang = "c") = + buildBinary name, "tests/", params + exec "build/" & name + +task tests, "Build & run tests": + test "all_tests", "-d:chronicles_log_level=DEBUG -d:chronosStrictException" task waku_example, "Build Waku based simple example": let name = "waku_example" diff --git a/tests/all_tests.nim b/tests/all_tests.nim new file mode 100644 index 0000000..f6df9b7 --- /dev/null +++ b/tests/all_tests.nim @@ -0,0 +1 @@ +# import indivdual test suites