From 3b172de07d3f0d66bab3cddca7c8c3639cd899fa Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Tue, 4 Feb 2025 13:50:21 -0600 Subject: [PATCH] use parent most "tester" style --- .github/workflows/tests.yml | 2 +- config.nims | 5 ----- tests/cli/lib.nim | 2 +- tests/tester.nim | 2 ++ 4 files changed, 4 insertions(+), 7 deletions(-) create mode 100644 tests/tester.nim diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index afc529b..52cc35e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,4 +23,4 @@ jobs: - name: Run Tests run: | nim develop - nim test + nim r tests/tester diff --git a/config.nims b/config.nims index d86a0e5..4dec927 100644 --- a/config.nims +++ b/config.nims @@ -1,11 +1,6 @@ import std/os except getCurrentDir import std/[strformat, strutils] -task test, "run tests": - const testDir = thisDir() / "tests" - selfExec fmt"r {testDir}/tbbansi.nim" - selfExec fmt"r {testDir}/cli/tester.nim" - task develop, "install cligen for development": exec "nimble install -l 'cligen@1.7.5'" diff --git a/tests/cli/lib.nim b/tests/cli/lib.nim index 32cb126..168d9ca 100644 --- a/tests/cli/lib.nim +++ b/tests/cli/lib.nim @@ -1,6 +1,6 @@ import std/[compilesettings, os, osproc, strutils, times, unittest, terminal] -const pathToSrc = querySetting(SingleValueSetting.projectPath) +const pathToSrc = currentSourcePath().parentDir() const binDir = pathToSrc / "bin" const hwylCliSrc = pathToSrc / "../../src/hwylterm/hwylcli.nim" let hwylCliWriteTime = getFileInfo(hwylCliSrc).lastWriteTime diff --git a/tests/tester.nim b/tests/tester.nim new file mode 100644 index 0000000..2d69306 --- /dev/null +++ b/tests/tester.nim @@ -0,0 +1,2 @@ +import ./tbbansi +import ./cli/tester