Commits

Cat's Eye Technologies committed a514ab1

Test with both ghc and Hugs.

Comments (0)

Files changed (3)

 
     -> Tests for functionality "Interpret Flobnar program"
 
-    -> Functionality "Interpret Flobnar program" is implemented by
-    -> shell command
-    -> "ghc src/Flobnar.hs -e "do c <- readFile \"%(test-body-file)\"; putStr $ showRun c""
-
 Basics of Execution
 -------------------
 
+module Main where
+
+import System.Environment
+import Flobnar
+
+main = do
+    [fileName] <- getArgs
+    c <- readFile fileName
+    putStr $ showRun c
 #!/bin/sh
-falderal -b README.markdown
+
+if [ x`which ghc` = x -a x`which runhugs` = x ]; then
+    echo "Neither ghc nor runhugs found on search path"
+    exit 1
+fi
+
+touch fixture.markdown
+
+if [ ! x`which ghc` = x ]; then
+    cat >>fixture.markdown <<EOF
+    -> Functionality "Interpret Flobnar program" is implemented by
+    -> shell command
+    -> "ghc src/Flobnar.hs -e "do c <- readFile \"%(test-body-file)\"; putStr $ showRun c""
+
+EOF
+fi
+
+if [ ! x`which runhugs` = x ]; then
+    cat >>fixture.markdown <<EOF
+    -> Functionality "Interpret Flobnar program" is implemented by
+    -> shell command
+    -> "runhugs src/Main.hs %(test-body-file)"
+
+EOF
+fi
+
+falderal -b fixture.markdown README.markdown
+rm -f fixture.markdown