From ae389b9480d46091bfd9b6843aebdc48aa577c16 Mon Sep 17 00:00:00 2001 From: Andrey Listopadov Date: Mon, 28 Aug 2023 22:13:21 +0300 Subject: Update fennel-test, and add test runner script --- utils/build | 17 +++++++++++++++++ utils/run-tests | 8 ++++++++ 2 files changed, 25 insertions(+) create mode 100644 utils/build create mode 100644 utils/run-tests (limited to 'utils') diff --git a/utils/build b/utils/build new file mode 100644 index 0000000..4c3c3db --- /dev/null +++ b/utils/build @@ -0,0 +1,17 @@ +(fn spit-lib [path to] + (with-open [lib (io.open path)] + (each [line (lib:lines)] + ;; patching compile-time variable used to store macro module + ;; namr because when loafing the combined file it will always + ;; equal the the main module and will break macros in vendored + ;; libraries. + (case (line:match "%(local lib%-name %(or %.%.%. (.*)") + name (to:write (.. "(local lib-name (or " name "\n")) + _ (to:write line "\n"))))) + +(with-open [cljlib (io.open "./cljlib.fnl" :w)] + (let [main (io.open "src/cljlib.fnl")] + (each [line (main:lines)] + (case (line:match ";;;###include (.*)") + (path) (spit-lib path cljlib) + _ (cljlib:write line "\n"))))) diff --git a/utils/run-tests b/utils/run-tests new file mode 100644 index 0000000..e70fae1 --- /dev/null +++ b/utils/run-tests @@ -0,0 +1,8 @@ +(local t (require :fennel-test.fennel-test)) + +(local test-modules + [:tests.core + :tests.fn + :tests.macros]) + +(t.run-tests test-modules) -- cgit v1.2.3