Package gnu.kawa.util

Class RunTestScript

  • All Implemented Interfaces:
    Runnable

    public class RunTestScript
    extends Object
    implements Runnable
    A utility for simple one-file test cases. The test case is a self-contained file contining the program/script to run, with the expected out and/or diagnostic embedded as comments. Here is a simple Scheme example:
     (define xx (* 2 10))
     (format #t "xx=~s~%" xx)
     ;; Output: xx=20
     

    Directives

    The following assumes Scheme, with a line-comment ";;", start-block-comment "#|" and end-block-comment "|#".

    ;; Kawa-options: options
    Add options to the kawa command, i.e. after the class name. The options are split into space-separated words, though you can use single or double quotes to include spaces in words. (The quoting is like in Unix shells, in that a quote does not start or end a word. Instead, a word can contain zero or more quote-delimited segments.) The characters %F are replaced by the source file name. The default for options is --diagnostic-strip-directories %F.
    ;; Java-options: options
    Add options to the java command, before the class name. The options are parsed the same way as for Kawa-options.
    ;; Output: line
    Expect line literally in the output stream.
    ;; Output-pattern: pattern
    Expect a line matching the regex pattern in the output.
    #|Output:
    The following lines, ending with a line containing just the matching end-block-comment |#, are expected literally in the output stream.
    ;; Diagnostic: line
    Expect line literally in the error stream.
    ;; Diagnostic-pattern: pattern
    Expect a line matching the regex pattern in the error stream.
    #|Diagnostic:
    The following lines, ending with a line containing just the matching end-block-comment |#, are expected literally in the error stream.
    • Constructor Detail

      • RunTestScript

        public RunTestScript​(String filename,
                             Language language)
      • RunTestScript

        public RunTestScript​(String filename)
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface Runnable
      • main

        public static void main​(String[] args)