From ea2a5acbaaaa8d07114110d03dd5026a55e74af7 Mon Sep 17 00:00:00 2001 From: "Michael Bradley, Jr" Date: Tue, 16 Aug 2022 09:25:25 -0500 Subject: [PATCH] [wip] support in Makefile, codex.nimble; git ignore scratch/ --- .gitignore | 3 +++ Makefile | 10 ++++++++++ codex.nimble | 3 +++ 3 files changed, 16 insertions(+) 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 55d5b441..f8660d24 100644 --- a/Makefile +++ b/Makefile @@ -24,8 +24,10 @@ LINK_PCRE := 0 clean \ coverage \ deps \ + hello_codex \ libbacktrace \ test \ + testground \ update ifeq ($(NIM_PARAMS),) @@ -123,6 +125,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 4113fb25..c36e02c7 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"