diff options
| author | Arun Isaac | 2025-11-27 18:21:49 +0000 |
|---|---|---|
| committer | Arun Isaac | 2025-11-27 18:21:49 +0000 |
| commit | d75e207bb14eb5460a139c3383ba4249d689b679 (patch) | |
| tree | 4ffcd48f4ad5e0e385730c89f6a2862cbc84c067 | |
| parent | 0b85ece2ec47609187fc86cfd3c7ee4519e96b37 (diff) | |
| download | ccwl-d75e207bb14eb5460a139c3383ba4249d689b679.tar.gz ccwl-d75e207bb14eb5460a139c3383ba4249d689b679.tar.lz ccwl-d75e207bb14eb5460a139c3383ba4249d689b679.zip | |
Use guile-run64 for tests.
| -rw-r--r-- | .guix/ccwl-package.scm | 8 | ||||
| -rw-r--r-- | Makefile | 10 | ||||
| -rw-r--r-- | build-aux/test-driver.scm | 92 | ||||
| -rw-r--r-- | tests/ccwl.scm | 3 | ||||
| -rw-r--r-- | tests/ui.scm | 5 |
5 files changed, 16 insertions, 102 deletions
diff --git a/.guix/ccwl-package.scm b/.guix/ccwl-package.scm index a70e3e0..d585daa 100644 --- a/.guix/ccwl-package.scm +++ b/.guix/ccwl-package.scm @@ -1,5 +1,5 @@ ;;; ccwl --- Concise Common Workflow Language -;;; Copyright © 2021, 2023–2024 Arun Isaac <arunisaac@systemreboot.net> +;;; Copyright © 2021, 2023–2025 Arun Isaac <arunisaac@systemreboot.net> ;;; ;;; This file is part of ccwl. ;;; @@ -20,6 +20,7 @@ #:use-module ((gnu packages bioinformatics) #:prefix guix:) #:use-module ((gnu packages emacs) #:select (emacs-minimal)) #:use-module ((gnu packages fonts) #:select (font-charter font-fira-code)) + #:use-module ((gnu packages guile-xyz) #:select (guile-run64)) #:use-module ((guix build-system guile) #:select (%guile-build-system-modules)) #:use-module (guix gexp) #:use-module (guix git-download) @@ -34,7 +35,10 @@ "ccwl-checkout" #:recursive? #t #:select? (or (git-predicate (dirname (current-source-directory))) - (const #t)))))) + (const #t)))) + (native-inputs + (modify-inputs (package-native-inputs guix:ccwl) + (prepend guile-run64))))) (define ccwl-website-gexp (let ((development-profile diff --git a/Makefile b/Makefile index f4487d9..5a9b07f 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # ccwl --- Concise Common Workflow Language -# Copyright © 2022, 2024 Arun Isaac <arunisaac@systemreboot.net> +# Copyright © 2022, 2024–2025 Arun Isaac <arunisaac@systemreboot.net> # # This file is part of ccwl. # @@ -24,12 +24,12 @@ GIT = git GPG = gpg GUILD = guild GUILE = guile +GUILE_RUN64 = guile-run64 LZIP = lzip SKRIBILO = skribilo FIND_DEPENDENCIES = build-aux/find-dependencies.scm GENERATE_CWL_OUTPUT = build-aux/generate-cwl-output.sh -TEST_DRIVER = build-aux/test-driver.scm top_level_module_dir = $(project) sources = $(wildcard $(top_level_module_dir)/*.scm) @@ -46,7 +46,7 @@ fonts = $(addprefix $(GUIX_ENVIRONMENT)/share/fonts/web/, charter_regular.woff2 distribute_files = $(sources) $(scripts) $(tests) $(test_data) \ $(doc_sources) doc/skribilo.scm $(doc_data) $(DOC_SCM) $(DOC_OTHER) \ pre-inst-env guix.scm Makefile configure configure.scm \ - $(FIND_DEPENDENCIES) $(GENERATE_CWL_OUTPUT) $(TEST_DRIVER) \ + $(FIND_DEPENDENCIES) $(GENERATE_CWL_OUTPUT) \ COPYING NEWS.org README.org scmdir = $(datarootdir)/guile/site/$(guile_effective_version)/$(top_level_module_dir) @@ -63,8 +63,8 @@ all: $(objects) # Run tests -check: $(tests) $(TEST_DRIVER) - $(GUILE) --no-auto-compile -L . $(TEST_DRIVER) $(tests) +check: + ./pre-inst-env $(GUILE_RUN64) $(tests) # Build documentation diff --git a/build-aux/test-driver.scm b/build-aux/test-driver.scm deleted file mode 100644 index adac481..0000000 --- a/build-aux/test-driver.scm +++ /dev/null @@ -1,92 +0,0 @@ -;;; ccwl --- Concise Common Workflow Language -;;; Copyright © 2021, 2022 Arun Isaac <arunisaac@systemreboot.net> -;;; -;;; This file is part of ccwl. -;;; -;;; ccwl is free software: you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation, either version 3 of the License, or -;;; (at your option) any later version. -;;; -;;; ccwl is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;;; General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with ccwl. If not, see <https://www.gnu.org/licenses/>. - -;;; Commentary: - -;; This is a better test driver for Guile's (srfi srfi-64). -;; -;; TODO: Improve Guile's test driver so this module won't be -;; necessary. - -;;; Code: - -(use-modules (ice-9 format) - (ice-9 match) - (srfi srfi-26) - (srfi srfi-64) - (term ansi-color)) - -(define (color color-symbol str color?) - (if color? - (colorize-string str color-symbol) - str)) - -(define red (cut color 'RED <> <>)) -(define green (cut color 'GREEN <> <>)) -(define magenta (cut color 'MAGENTA <> <>)) - -(define (my-gnu-runner color?) - (let ((runner (test-runner-null))) - (test-runner-on-group-begin! runner - (lambda (runner suite-name count) - (format #t (magenta "%%%% ~a~%" color?) suite-name))) - (test-runner-on-group-end! runner - (lambda _ - (newline))) - (test-runner-on-test-end! runner - (lambda (runner) - (let ((name (test-runner-test-name runner)) - (result (string-upcase - (symbol->string (test-result-kind runner)))) - (result-alist (test-result-alist runner))) - (format #t "~a ~a~%" - (case (test-result-kind runner) - ((pass) (green result color?)) - (else (red result color?))) - name) - ;; If test did not pass, print details. - (unless (eq? (test-result-kind runner) 'pass) - (format (current-error-port) - "~a:~a~%expected: ~s~%actual: ~s~%" - (assq-ref result-alist 'source-file) - (assq-ref result-alist 'source-line) - (match (assq-ref result-alist 'source-form) - (('test-assert _ ...) #t) - (_ (assq-ref result-alist 'expected-value))) - (assq-ref result-alist 'actual-value)))))) - runner)) - -(match (command-line) - ((_ test-files ...) - (let ((runner (my-gnu-runner #t))) - (test-with-runner runner - (for-each load-from-path test-files) - (display (magenta "SUMMARY" #t)) - (newline) - (format #t "PASS: ~a -FAIL: ~a -XPASS: ~a -XFAIL: ~a -SKIP: ~a -" - (test-runner-pass-count runner) - (test-runner-fail-count runner) - (test-runner-xpass-count runner) - (test-runner-xfail-count runner) - (test-runner-skip-count runner)) - (exit (zero? (test-runner-fail-count runner))))))) diff --git a/tests/ccwl.scm b/tests/ccwl.scm index 2d755ad..e10d9f2 100644 --- a/tests/ccwl.scm +++ b/tests/ccwl.scm @@ -1,5 +1,5 @@ ;;; ccwl --- Concise Common Workflow Language -;;; Copyright © 2021–2024 Arun Isaac <arunisaac@systemreboot.net> +;;; Copyright © 2021–2025 Arun Isaac <arunisaac@systemreboot.net> ;;; ;;; This file is part of ccwl. ;;; @@ -20,6 +20,7 @@ (srfi srfi-1) (srfi srfi-64) (srfi srfi-71) + (ice-9 match) (ccwl ccwl) (ccwl conditions)) diff --git a/tests/ui.scm b/tests/ui.scm index a5741c0..115a20e 100644 --- a/tests/ui.scm +++ b/tests/ui.scm @@ -1,5 +1,5 @@ ;;; ccwl --- Concise Common Workflow Language -;;; Copyright © 2023 Arun Isaac <arunisaac@systemreboot.net> +;;; Copyright © 2023, 2025 Arun Isaac <arunisaac@systemreboot.net> ;;; ;;; This file is part of ccwl. ;;; @@ -16,7 +16,8 @@ ;;; You should have received a copy of the GNU General Public License ;;; along with ccwl. If not, see <https://www.gnu.org/licenses/>. -(use-modules (srfi srfi-64) +(use-modules (srfi srfi-26) + (srfi srfi-64) (term ansi-color) (ccwl ui) (ccwl conditions)) |
