Add static work path for initial modules testing
This commit is contained in:
parent
02f954d829
commit
b163e585ef
@ -19,6 +19,7 @@ Options:
|
|||||||
-d, --dump Force dump waveforms.
|
-d, --dump Force dump waveforms.
|
||||||
-r, --norestart Do not restart testbench with waveform dump enabled if
|
-r, --norestart Do not restart testbench with waveform dump enabled if
|
||||||
test failed (true by default)
|
test failed (true by default)
|
||||||
|
-s, --static Use static work dir for initial debug purposes
|
||||||
-n, --nocolor Do not use color for print log
|
-n, --nocolor Do not use color for print log
|
||||||
-j, --jobs NUM Use NUM threads for running testbenches. If <=0
|
-j, --jobs NUM Use NUM threads for running testbenches. If <=0
|
||||||
use as many threads as there are processors in the system.
|
use as many threads as there are processors in the system.
|
||||||
|
|||||||
45
utest.scm
45
utest.scm
@ -50,6 +50,7 @@
|
|||||||
(define utest/restart-dump (make-parameter #f))
|
(define utest/restart-dump (make-parameter #f))
|
||||||
(define utest/keep-output (make-parameter #f))
|
(define utest/keep-output (make-parameter #f))
|
||||||
(define utest/verbose (make-parameter #f))
|
(define utest/verbose (make-parameter #f))
|
||||||
|
(define utest/static (make-parameter #f))
|
||||||
(define utest/nocolor (make-parameter #f))
|
(define utest/nocolor (make-parameter #f))
|
||||||
(define utest/base-path (make-parameter ""))
|
(define utest/base-path (make-parameter ""))
|
||||||
(define utest/work-path (make-parameter ""))
|
(define utest/work-path (make-parameter ""))
|
||||||
@ -802,12 +803,21 @@
|
|||||||
(makefile-name (caddr test)))
|
(makefile-name (caddr test)))
|
||||||
(let* ((name (proc 'name))
|
(let* ((name (proc 'name))
|
||||||
(name (if name name "noname"))
|
(name (if name name "noname"))
|
||||||
(work (mkdtemp (format "~a/~a~a-~a-~a-XXXXXX"
|
(work
|
||||||
base WORK_DIR_PREFIX
|
(if (utest/static)
|
||||||
makefile-name
|
(let ((dir-name
|
||||||
(string-map (lambda (c) (if (char-whitespace? c) #\_ c))
|
(format "~a/~a~a-static"
|
||||||
(string-downcase name))
|
base WORK_DIR_PREFIX
|
||||||
(current-time)))))
|
makefile-name)))
|
||||||
|
(when (not (access? dir-name W_OK))
|
||||||
|
(mkdir dir-name))
|
||||||
|
dir-name)
|
||||||
|
(mkdtemp (format "~a/~a~a-~a-~a-XXXXXX"
|
||||||
|
base WORK_DIR_PREFIX
|
||||||
|
makefile-name
|
||||||
|
(string-map (lambda (c) (if (char-whitespace? c) #\_ c))
|
||||||
|
(string-downcase name))
|
||||||
|
(current-time))))))
|
||||||
;; Execute test
|
;; Execute test
|
||||||
(let* ((p #f)
|
(let* ((p #f)
|
||||||
(o (with-output-to-string
|
(o (with-output-to-string
|
||||||
@ -940,9 +950,13 @@
|
|||||||
(find-paths-rec
|
(find-paths-rec
|
||||||
(lambda (p t)
|
(lambda (p t)
|
||||||
(and (eq? t 'directory)
|
(and (eq? t 'directory)
|
||||||
(string-match
|
(or
|
||||||
(format "^~a.*-[0-9]{10}-.{6}$" WORK_DIR_PREFIX)
|
(string-match
|
||||||
(basename p))))
|
(format "^~a.*-[0-9]{10}-.{6}$" WORK_DIR_PREFIX)
|
||||||
|
(basename p))
|
||||||
|
(string-match
|
||||||
|
(format "^~a.*-static$" WORK_DIR_PREFIX)
|
||||||
|
(basename p)))))
|
||||||
base)
|
base)
|
||||||
(fold
|
(fold
|
||||||
(lambda (makefile work-dirs)
|
(lambda (makefile work-dirs)
|
||||||
@ -951,9 +965,13 @@
|
|||||||
(find-paths-rec
|
(find-paths-rec
|
||||||
(lambda (p t)
|
(lambda (p t)
|
||||||
(and (eq? t 'directory)
|
(and (eq? t 'directory)
|
||||||
(string-match
|
(or
|
||||||
(format "^~a~a.*-[0-9]{10}-.{6}$" WORK_DIR_PREFIX (basename makefile))
|
(string-match
|
||||||
(basename p))))
|
(format "^~a~a.*-[0-9]{10}-.{6}$" WORK_DIR_PREFIX (basename makefile))
|
||||||
|
(basename p))
|
||||||
|
(string-match
|
||||||
|
(format "^~a~a.*-static$" WORK_DIR_PREFIX (basename makefile))
|
||||||
|
(basename p)))))
|
||||||
(dirname makefile))))
|
(dirname makefile))))
|
||||||
'() (find-files-rec-regexp MAKEFILE_NAME_REGEXP base)))))
|
'() (find-files-rec-regexp MAKEFILE_NAME_REGEXP base)))))
|
||||||
(if (null? work-dirs)
|
(if (null? work-dirs)
|
||||||
@ -999,6 +1017,7 @@
|
|||||||
(* " -d, --dump Force dump waveforms.")
|
(* " -d, --dump Force dump waveforms.")
|
||||||
(* " -r, --norestart Do not restart testbench with waveform dump enabled if")
|
(* " -r, --norestart Do not restart testbench with waveform dump enabled if")
|
||||||
(* " test failed (true by default)")
|
(* " test failed (true by default)")
|
||||||
|
(* " -s, --static Use static work dir for initial debug purposes")
|
||||||
(* " -n, --nocolor Do not use color for print log")
|
(* " -n, --nocolor Do not use color for print log")
|
||||||
(* " -j, --jobs NUM Use NUM threads for running testbenches. If <=0")
|
(* " -j, --jobs NUM Use NUM threads for running testbenches. If <=0")
|
||||||
(* " use as many threads as there are processors in the system.")
|
(* " use as many threads as there are processors in the system.")
|
||||||
@ -1025,6 +1044,7 @@
|
|||||||
(let* ((optspec `((keep (single-char #\k))
|
(let* ((optspec `((keep (single-char #\k))
|
||||||
(dump (single-char #\d) (value #f))
|
(dump (single-char #\d) (value #f))
|
||||||
(norestart (single-char #\r) (value #f))
|
(norestart (single-char #\r) (value #f))
|
||||||
|
(static (single-char #\s) (value #f))
|
||||||
(nocolor (single-char #\n) (value #f))
|
(nocolor (single-char #\n) (value #f))
|
||||||
(verbose (single-char #\v) (value #f))
|
(verbose (single-char #\v) (value #f))
|
||||||
(jobs (single-char #\j) (value #t) (predicate ,string->number))
|
(jobs (single-char #\j) (value #t) (predicate ,string->number))
|
||||||
@ -1051,6 +1071,7 @@
|
|||||||
(utest/keep-output (option-ref options 'keep #f))
|
(utest/keep-output (option-ref options 'keep #f))
|
||||||
(utest/force-dump (option-ref options 'dump #f))
|
(utest/force-dump (option-ref options 'dump #f))
|
||||||
(utest/restart-dump (not (option-ref options 'norestart #f)))
|
(utest/restart-dump (not (option-ref options 'norestart #f)))
|
||||||
|
(utest/static (option-ref options 'static #f))
|
||||||
(utest/nocolor (option-ref options 'nocolor #f))
|
(utest/nocolor (option-ref options 'nocolor #f))
|
||||||
(utest/verbose (option-ref options 'verbose #f))
|
(utest/verbose (option-ref options 'verbose #f))
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user