diff --git a/.gitignore b/.gitignore index 4ecde076..f24a27ed 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,9 @@ build/ # Coverage data shall be put in an ignored coverage/ directory coverage/ +# Shallow clone of the repo will be placed her for use with testground +scratch/ + # Nimble packages /vendor/.nimble diff --git a/Makefile b/Makefile index 7200eb44..f4502083 100644 --- a/Makefile +++ b/Makefile @@ -24,8 +24,10 @@ LINK_PCRE := 0 clean \ coverage \ deps \ + hello_codex \ libbacktrace \ test \ + testground \ update ifeq ($(NIM_PARAMS),) @@ -130,6 +132,14 @@ coverage: genhtml coverage/coverage.f.info --output-directory coverage/report if which open >/dev/null; then (echo -e "\e[92mOpening\e[39m HTML coverage report in browser..." && open coverage/report/index.html) || true; fi +testground: + mkdir -p scratch && rm -rf scratch/* && git clone --depth=1 "file://$${PWD}" "scratch/$$(basename $${PWD})" + testground plan import --from=testground/hello_codex + testground run single --builder=docker:generic --runner=local:docker --plan=hello_codex --testcase=hello_codex --instances=2 + +hello_codex: | build deps + $(ENV_SCRIPT) nim hello_codex codex.nims + # usual cleaning clean: | clean-common rm -rf build diff --git a/codex.nimble b/codex.nimble index c137a222..3dda997c 100644 --- a/codex.nimble +++ b/codex.nimble @@ -59,6 +59,9 @@ proc test(name: string, srcDir = "tests/", lang = "c") = task codex, "build codex binary": buildBinary "codex", params = "-d:chronicles_runtime_filtering -d:chronicles_log_level=TRACE" +task hello_codex, "build hello_codex binary": + buildBinary "hello_codex", srcDir = "testground/hello_codex/", params = "-d:chronicles_runtime_filtering -d:chronicles_log_level=TRACE" + task testCodex, "Build & run Codex tests": test "testCodex"