[tests] modify load-path to find the parent directory

Find the parent directory programmatically.
This commit is contained in:
Christopher Lam
2018-07-02 08:58:05 +08:00
committed by John Ralls
parent d12ee9a4fc
commit 5c8af37901
2 changed files with 7 additions and 4 deletions

View File

@@ -26,7 +26,9 @@
(run-test-proper)))
(define (coverage-test tester)
(add-to-load-path "/home/chris/sources/gnucash/gnucash/report/business-reports")
(let* ((currfile (dirname (current-filename)))
(path (string-take currfile (string-rindex currfile #\/))))
(add-to-load-path path))
(call-with-values
(lambda()
(with-code-coverage tester))

View File

@@ -50,11 +50,12 @@
(run-test-proper)))
(define (coverage-test)
(define %test-vm (make-vm))
(add-to-load-path "/home/chris/sources/gnucash/gnucash/report/standard-reports")
(let* ((currfile (dirname (current-filename)))
(path (string-take currfile (string-rindex currfile #\/))))
(add-to-load-path path))
(call-with-values
(lambda()
(with-code-coverage %test-vm run-test-proper))
(with-code-coverage run-test-proper))
(lambda (data result)
(let ((port (open-output-file "/tmp/lcov.info")))
(coverage-data->lcov data port)