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))) | |
12 | ||
13 | (let ((rs (status:exit-val (system "guile -c '(exit 42)'")))) | |
14 | (if (not (= 42 rs)) | |
15 | (begin | |
16 | (simple-format | |
17 | #t | |
18 | "test-system-cmds: system exit status was ~S rather than 42\n" | |
19 | rs) | |
20 | (exit 1))))) | |
21 | ||
22 | (define (test-system*-cmd) | |
23 | (let ((rs (status:exit-val (system* "guile" "-c" "(exit 42)")))) | |
24 | (if (not (= 42 rs)) | |
25 | (begin | |
26 | (simple-format | |
27 | #t | |
28 | "test-system-cmds: system* exit status was ~S rather than 42\n" | |
29 | rs) | |
30 | (exit 1))))) | |
31 | ||
32 | (if (defined? 'system) | |
33 | (test-system-cmd)) | |
34 | ||
35 | (if (defined? 'system*) | |
36 | (test-system*-cmd)) | |
37 | ||
38 | (exit 0) | |
39 | ||
40 | ;; Local Variables: | |
41 | ;; mode: scheme | |
42 | ;; End: |