Commit | Line | Data |
---|---|---|
b10b93de | 1 | #!/bin/sh |
8722d99a | 2 | exec guile -q -s "$0" "$@" |
b10b93de RB |
3 | !# |
4 | ||
5 | (define (test-system-cmd) | |
6 | (if (not (boolean? (system))) | |
7 | (begin | |
8 | (simple-format | |
9 | #t | |
10 | "test-system-cmds: (system) did not return a boolean\n") | |
11 | (exit 1))) | |
b518c6a0 LC |
12 | |
13 | ;; Note: Use double quotes since simple quotes are not supported by | |
14 | ;; `cmd.exe' on Windows. | |
15 | (let ((rs (status:exit-val (system "guile -c \"(exit 42)\"")))) | |
b10b93de RB |
16 | (if (not (= 42 rs)) |
17 | (begin | |
18 | (simple-format | |
19 | #t | |
20 | "test-system-cmds: system exit status was ~S rather than 42\n" | |
21 | rs) | |
22 | (exit 1))))) | |
23 | ||
24 | (define (test-system*-cmd) | |
25 | (let ((rs (status:exit-val (system* "guile" "-c" "(exit 42)")))) | |
26 | (if (not (= 42 rs)) | |
27 | (begin | |
28 | (simple-format | |
29 | #t | |
30 | "test-system-cmds: system* exit status was ~S rather than 42\n" | |
31 | rs) | |
32 | (exit 1))))) | |
33 | ||
34 | (if (defined? 'system) | |
35 | (test-system-cmd)) | |
36 | ||
37 | (if (defined? 'system*) | |
38 | (test-system*-cmd)) | |
39 | ||
40 | (exit 0) | |
41 | ||
42 | ;; Local Variables: | |
43 | ;; mode: scheme | |
b518c6a0 | 44 | ;; End: |