From ca88c0899277a8e897538bda5b1bca2f2747cd61 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 3 Jan 2023 22:01:28 +0000 Subject: 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. --- build-aux/test-corpus.scm | 13 +++++++------ 1 file 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)) -- cgit v1.2.3