Skip to content

Commit

Permalink
ci: improve the output
Browse files Browse the repository at this point in the history
The markup ##[...] makes GHA groups outputs together, making it easy to
compare results across runs.
  • Loading branch information
sorawee committed Aug 31, 2023
1 parent 37605c0 commit 0013e5c
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions tests/circomlib-test.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,29 @@

(define-check (check-result filename expected)
(printf "=== checking ~a ===\n" filename)
(printf "##[group]~a\n" filename)
(define-values (in out) (make-pipe))
(define orig-out (current-output-port))
(define string-port (open-output-string))
(parameterize ([current-namespace (make-base-namespace)]
[current-command-line-arguments
(vector "--solver" "cvc5"
"--timeout" "5000"
"--weak"
"--verbose" "1"
"--r1cs" (~a (build-path benchmark-dir
(format "~a.r1cs" filename))))]
[current-output-port out])
(define thd (thread (λ () (copy-port in orig-out string-port))))
(time (dynamic-require picus #f))
(close-output-port out)
(thread-wait thd))
(define-values (cpu real gc)
(parameterize ([current-namespace (make-base-namespace)]
[current-command-line-arguments
(vector "--solver" "cvc5"
"--timeout" "5000"
"--weak"
"--verbose" "1"
"--r1cs"
(~a (build-path benchmark-dir
(format "~a.r1cs" filename))))]
[current-output-port out])
(define thd (thread (λ () (copy-port in orig-out string-port))))
(match-define-values (_ cpu real gc)
(time-apply (λ () (dynamic-require picus #f)) '()))
(close-output-port out)
(thread-wait thd)
(values cpu real gc)))
(printf "##[endgroup]\n")
(printf "cpu: ~a; real: ~a; gc: ~a\n" cpu real gc)
(check-regexp-match
(match expected
['safe #px"(?m:^# weak uniqueness: safe\\.$)"]
Expand Down

0 comments on commit 0013e5c

Please sign in to comment.