diff options
| author | Arun Isaac | 2025-11-26 22:14:59 +0000 |
|---|---|---|
| committer | Arun Isaac | 2025-11-26 22:14:59 +0000 |
| commit | 0ddb39f71db5074dc46984552f21c23a1248b904 (patch) | |
| tree | cf1db2a7e2dc3a1b3811ef6c8f71f4a1b60d8e69 /.guix/e2e-tests.scm | |
| parent | 87d6ec51f47915702b60d9298a8df98edc3f1306 (diff) | |
| download | ravanan-0ddb39f71db5074dc46984552f21c23a1248b904.tar.gz ravanan-0ddb39f71db5074dc46984552f21c23a1248b904.tar.lz ravanan-0ddb39f71db5074dc46984552f21c23a1248b904.zip | |
guix: Do not require listing E2E test files.
It is not worth the trouble listing each E2E test file individually and compling them in separate derivations.
Diffstat (limited to '.guix/e2e-tests.scm')
| -rw-r--r-- | .guix/e2e-tests.scm | 94 |
1 files changed, 35 insertions, 59 deletions
diff --git a/.guix/e2e-tests.scm b/.guix/e2e-tests.scm index eaa249c..5e4792a 100644 --- a/.guix/e2e-tests.scm +++ b/.guix/e2e-tests.scm @@ -22,69 +22,45 @@ #:use-module (guix gexp) #:use-module (ice-9 match)) -(define (ccwl-compile source-file) - #~(begin - (use-modules (rnrs io ports) - (srfi srfi-26) - (ice-9 match) - (ice-9 popen)) +(define (e2e-tools-gexp sources-directory) + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (rnrs io ports) + (srfi srfi-26) + (ice-9 match) + (ice-9 popen) + (guix build utils)) - (define (call-with-input-pipe command proc) - (match command - ((prog args ...) - (let ((port #f)) - (dynamic-wind - (lambda () - (set! port (apply open-pipe* OPEN_READ prog args))) - (cut proc port) - (lambda () - (unless (zero? (close-pipe port)) - (error "Command invocation failed" command)))))))) + (define (call-with-input-pipe command proc) + (match command + ((prog args ...) + (let ((port #f)) + (dynamic-wind + (lambda () + (set! port (apply open-pipe* OPEN_READ prog args))) + (cut proc port) + (lambda () + (unless (zero? (close-pipe port)) + (error "Command invocation failed" command)))))))) - (call-with-output-file #$output - (cut display - (call-with-input-pipe '(#$(file-append ccwl "/bin/ccwl") - "compile" - #$source-file) - get-string-all) - <>)))) - -(define e2e-tools-ccwl-sources - `(("capture-output-file.scm" - . ,(local-file "../e2e-tests/tools/capture-output-file.scm")) - ("capture-output-file-with-parameter-reference.scm" - . ,(local-file "../e2e-tests/tools/capture-output-file-with-parameter-reference.scm")) - ("capture-stdout" - . ,(local-file "../e2e-tests/tools/capture-stdout.scm")) - ("checksum" - . ,(local-file "../e2e-tests/tools/checksum.scm")) - ("decompress-compile-run" - . ,(local-file "../e2e-tests/tools/decompress-compile-run.scm")) - ("inline-javascript-requirement" - . ,(local-file "../e2e-tests/tools/inline-javascript-requirement.scm")) - ("hello-world.scm" - . ,(local-file "../e2e-tests/tools/hello-world.scm")) - ("pass-stdin" - . ,(local-file "../e2e-tests/tools/pass-stdin.scm")) - ("prefix-arguments" - . ,(local-file "../e2e-tests/tools/prefix-arguments.scm")) - ("scatter" - . ,(local-file "../e2e-tests/tools/scatter.scm")) - ("spell-check" - . ,(local-file "../e2e-tests/tools/spell-check.scm")) - ("staging-input-files" - . ,(local-file "../e2e-tests/tools/staging-input-files.scm")))) + (mkdir #$output) + (for-each (lambda (source-file) + (call-with-output-file (string-append #$output + "/" + (basename source-file ".scm") + ".cwl") + (cut display + (call-with-input-pipe (list #$(file-append ccwl "/bin/ccwl") + "compile" + source-file) + get-string-all) + <>))) + (find-files #$sources-directory "\\.scm$"))))) (define e2e-tools - (file-union "e2e-tools" - (map (match-lambda - ((ccwl-source-filename . ccwl-source-file) - (let ((cwl-filename (string-append (basename ccwl-source-filename ".scm") - ".cwl"))) - (list cwl-filename - (computed-file cwl-filename - (ccwl-compile ccwl-source-file)))))) - e2e-tools-ccwl-sources))) + (computed-file "e2e-tools" + (e2e-tools-gexp (local-file "../e2e-tests/tools" + #:recursive? #t)))) (define e2e-test-suite (file-union "e2e-test-suite" |
