Some API
This commit is contained in:
parent
adb64cd49c
commit
f6fa2a0031
24
gherken.scm
24
gherken.scm
|
@ -8,6 +8,7 @@
|
|||
utf8
|
||||
(chicken irregex)
|
||||
(chicken port)
|
||||
(chicken file)
|
||||
shell
|
||||
medea
|
||||
srfi-1
|
||||
|
@ -16,7 +17,7 @@
|
|||
srfi-123
|
||||
srfi-152
|
||||
srfi-197)
|
||||
(export given)
|
||||
(export given run-features)
|
||||
(begin
|
||||
(define lang-registry (make-hash-table))
|
||||
|
||||
|
@ -24,4 +25,25 @@
|
|||
(syntax-rules ()
|
||||
((given picklex args ...)
|
||||
(hash-table-set! lang-registry picklex (lambda args ...)))))
|
||||
|
||||
(define (run-pickle data tags)
|
||||
#t)
|
||||
|
||||
(define (run-feature filename tags)
|
||||
(let ((pickles (chain (capture ("./gherkinexe" "--no-ast" "--no-source" filename))
|
||||
(string-trim-both _)
|
||||
(string-split _ "\n")
|
||||
(string-join _ ", ")
|
||||
(list "[" _ "]")
|
||||
(string-concatenate _)
|
||||
(with-input-from-string _ read-json))))
|
||||
(map
|
||||
(lambda (x) (run-pickle x tags))
|
||||
pickles)))
|
||||
|
||||
(define (run-features dir #!rest tags)
|
||||
(let ((featurefiles (find-files dir test: '(: (* any) ".feature"))))
|
||||
(map
|
||||
(lambda (x) (run-feature x tags))
|
||||
featurefiles)))
|
||||
))
|
||||
|
|
Loading…
Reference in New Issue