1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
#!@theme_d_guile@ \
-e main -s
!#
;; Copyright (C) 2018-2019 Tommi Höynälänmaa
;; Distributed under GNU General Public License version 3,
;; see file doc/GPL-3.
(import (theme-d common theme-d-config))
(import (theme-d testing test-info))
(init-theme-d-config)
(define gl-theme-d-run-path
(get-theme-d-config-var 'run-path))
(define gl-theme-d-run-split-path
(get-theme-d-config-var 'run-split-path))
(define gl-log-filename "run-test-programs.log")
(define (get-str-test-name i)
(string-append "test" (number->string i)))
(define (get-test-filename i split?)
(if split?
(string-append (get-str-test-name i) ".build")
(string-append (get-str-test-name i) ".go")))
(define (get-test-path i split?)
(let ((filename (get-test-filename i split?)))
(string-append "../theme-d-code/tests/" filename)))
(define (get-custom-file-path filename)
(string-append "../theme-d-code/tests/" filename))
(define (run-tests log-file)
(do ((i 1 (+ i 1))) ((> i nr-of-tests))
(if (and (not (member i no-run))
(not (member i modules))
(not (member i l-only-modular-linking)))
(let* ((split? (memv i l-split-linking))
(path (get-test-path i split?))
(filename (get-test-filename i split?))
(str-run-cmd
(if split? gl-theme-d-run-split-path gl-theme-d-run-path)))
(display filename log-file)
(display ": " log-file)
(display "Starting test ")
(display i)
(newline)
(if (= (system (string-append str-run-cmd " " path)) 0)
(display "ok" log-file)
(display "error" log-file))
(display "Finished test ")
(display i)
(newline)
(newline log-file)))))
(define (main args)
(let ((log-file (open-output-file gl-log-filename)))
(run-tests log-file)
(close log-file)))
|