test-system-cmds 930 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/sh
  2. exec guile -q -s "$0" "$@"
  3. !#
  4. (define (test-system-cmd)
  5. (if (not (boolean? (system)))
  6. (begin
  7. (simple-format
  8. #t
  9. "test-system-cmds: (system) did not return a boolean\n")
  10. (exit 1)))
  11. (let ((rs (status:exit-val (system "guile -c '(exit 42)'"))))
  12. (if (not (= 42 rs))
  13. (begin
  14. (simple-format
  15. #t
  16. "test-system-cmds: system exit status was ~S rather than 42\n"
  17. rs)
  18. (exit 1)))))
  19. (define (test-system*-cmd)
  20. (let ((rs (status:exit-val (system* "guile" "-c" "(exit 42)"))))
  21. (if (not (= 42 rs))
  22. (begin
  23. (simple-format
  24. #t
  25. "test-system-cmds: system* exit status was ~S rather than 42\n"
  26. rs)
  27. (exit 1)))))
  28. (if (defined? 'system)
  29. (test-system-cmd))
  30. (if (defined? 'system*)
  31. (test-system*-cmd))
  32. (exit 0)
  33. ;; Local Variables:
  34. ;; mode: scheme
  35. ;; End: