You've already forked guix-tribes
e635b7af84
Source: guix-tribes master419bea8fe5Base: previous supertest-devb378db1e22Mode: tree sync, preserving dev channel authorization
17 lines
477 B
Scheme
17 lines
477 B
Scheme
(define-module (tests support)
|
|
#:use-module (ice-9 match)
|
|
#:use-module (srfi srfi-13)
|
|
#:export (run-tests-when-script))
|
|
|
|
(define (script-invocation? argv file-name)
|
|
(match argv
|
|
((program . _)
|
|
(and (string? program)
|
|
(or (string=? program file-name)
|
|
(string-suffix? (string-append "/" file-name) program))))
|
|
(_ #f)))
|
|
|
|
(define (run-tests-when-script file-name thunk)
|
|
(when (script-invocation? (command-line) file-name)
|
|
(thunk)))
|