-
Notifications
You must be signed in to change notification settings - Fork 115
/
crypto-test.ss
33 lines (30 loc) · 1.07 KB
/
crypto-test.ss
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
;;; -*- Gerbil -*-
;;; (C) fare at tunes.org
;;; :std/crypto unit-tests
(import :std/test
:std/iter
:std/misc/process
:std/text/hex
:std/crypto
:std/make
:gerbil/compiler)
(export crypto-test)
(defsyntax (source-file stx)
(##container->path (##locat-container (stx-source stx))))
(def here (path-directory (source-file)))
(def crypto-test
(test-suite "test :std/crypto"
(test-case "static compilation with libcrypto"
(def test-dir "/tmp/test.out")
(def src (path-expand "crypto/digest-test.ss" here))
(def exe (path-expand "digest-test.exe" test-dir))
(create-directory* test-dir)
(compile-module
src [invoke-gsc: #t optimize: #f verbose: #f debug: #f static: #t
output-dir: test-dir
gsc-options: [(include-gambit-sharp)...]])
(compile-exe
src [invoke-gsc: #t output-file: exe optimize: #f verbose: #f debug: #f static: #t
output-dir: test-dir
gsc-options: [(include-gambit-sharp)...]])
(check (run-process/batch [exe]) => (void)))))