aboutsummaryrefslogtreecommitdiff
path: root/build-aux
diff options
context:
space:
mode:
authorArun Isaac2023-01-03 22:01:28 +0000
committerArun Isaac2023-01-03 22:03:10 +0000
commitca88c0899277a8e897538bda5b1bca2f2747cd61 (patch)
treea3034b0eade1350de473edd9dd38367b0805d210 /build-aux
parent8b3e2681c0465498192b98abe784f248ebb29086 (diff)
downloadguile-email-ca88c0899277a8e897538bda5b1bca2f2747cd61.tar.gz
guile-email-ca88c0899277a8e897538bda5b1bca2f2747cd61.tar.lz
guile-email-ca88c0899277a8e897538bda5b1bca2f2747cd61.zip
build-aux: Pass fail directory from main in test-corpus.scm.
* build-aux/test-corpus.scm (test-corpus): Accept fail-directory argument. * build-aux/test-corpus.scm (main): Pass fail-directory argument to test-corpus.
Diffstat (limited to 'build-aux')
-rw-r--r--build-aux/test-corpus.scm13
1 files changed, 7 insertions, 6 deletions
diff --git a/build-aux/test-corpus.scm b/build-aux/test-corpus.scm
index 025837c..740233e 100644
--- a/build-aux/test-corpus.scm
+++ b/build-aux/test-corpus.scm
@@ -53,8 +53,9 @@ parse-email fails to FAIL-DIRECTORY."
(@@ (email email)
read-next-email-in-mbox))
-(define (test-corpus corpus)
- "Test CORPUS, a directory containing mbox files."
+(define (test-corpus corpus fail-directory)
+ "Test CORPUS, a directory containing mbox files. Write emails on which
+the parser failed to FAIL-DIRECTORY."
(for-each (lambda (mbox)
(let ((mbox-path (string-append corpus "/" mbox)))
(display (format "~a~%" mbox-path))
@@ -67,7 +68,7 @@ parse-email fails to FAIL-DIRECTORY."
(lambda ()
(parse-email bv))
(lambda _
- (write-failed-email corpus mbox index bv)))))))
+ (write-failed-email fail-directory corpus mbox index bv)))))))
(const #t)
read-next-email-in-mbox
port)))))
@@ -75,9 +76,9 @@ parse-email fails to FAIL-DIRECTORY."
(define (main fail-directory)
;; Test corpora.
- (test-corpus "guix-commits")
- (test-corpus "guix-patches")
- (test-corpus "bug-guix")
+ (test-corpus "guix-commits" fail-directory)
+ (test-corpus "guix-patches" fail-directory)
+ (test-corpus "bug-guix" fail-directory)
;; If fail directory has any emails, then error out.
(unless (null? (directory-files fail-directory))