Commit d1c98e66 authored by Simon Marlow's avatar Simon Marlow
Browse files

fix tests for Windows

parent fa018dc7
:unset +s
:l ../shell.hs
:def shell (\s -> do shell s; return "")
-- first, tidy up:
:! rm -f *.hi *.o *~
:! cp D1.hs D.hs
:shell rm -f *.hi *.o *~
:shell cp D1.hs D.hs
-- load the program (all interpreted)
:load A
......@@ -13,21 +17,21 @@
main
-- touch a module + recompile
:! sleep 1
:! touch C.hs
:shell sleep 1
:shell touch C.hs
:reload
-- make sure `main' still works
main
-- compile D & reload
:! $HC $HC_OPTS -no-recomp -c D.hs
:shell $HC $HC_OPTS -no-recomp -c D.hs
:reload
main
-- change D, recompile & reload
:! cp D2.hs D.hs
:! $HC $HC_OPTS -no-recomp -c D.hs
:shell cp D2.hs D.hs
:shell $HC $HC_OPTS -no-recomp -c D.hs
:reload
:load A
......
:unset +s
:unset +t
:l ../shell.hs
:def shell (\s -> do shell s; return "")
-- first, clean up:
:! rm -f *.hi *.o *~
:! cp A1.hs A.hs
:shell rm -f *.hi *.o *~
:shell cp A1.hs A.hs
:load D
-- compile A & reload
:! $HC $HC_OPTS -no-recomp -c A.hs
:shell $HC $HC_OPTS -no-recomp -c A.hs
:reload
B.g 42
......@@ -15,9 +19,9 @@ B.g 42
B.g 42
-- swap A2 for A, compile & reload
:! sleep 1
:! cp A2.hs A.hs
:! $HC $HC_OPTS -no-recomp -c A.hs
:shell sleep 1
:shell cp A2.hs A.hs
:shell $HC $HC_OPTS -no-recomp -c A.hs
:reload
-- the system should ignore the compiled version and compile its own.
......@@ -33,7 +37,7 @@ B.g 42
B.g 42
-- remove A.o: system should recompile A
:! rm A.o
:shell rm A.o
:reload
B.g 42
......
......@@ -7,22 +7,25 @@
-- versions of each module, and make sure each combination behaves
-- sensibly.
:l ../shell.hs
:def shell (\s -> do shell s; return "")
-- clean up
:! rm -f *.o *.hi
:! cp D1.hs D.hs
:shell rm -f *.o *.hi
:shell cp D1.hs D.hs
:load A
:type a
a 42
-- sigh; sleep 1, because the filesystem only stores times in seconds
:! sleep 1; cp D2.hs D.hs
:shell sleep 1; cp D2.hs D.hs
:reload
:type (Main.a,B.b,C.c,D.d)
a 42
-- compile D, check that :reload doesn't pick it up
:! $HC $HC_OPTS -c D.hs
:shell $HC $HC_OPTS -c D.hs
:reload
:type (Main.a,B.b,C.c,D.d)
a 42
......@@ -33,44 +36,44 @@ a 42
a 42
-- D,C compiled
:! $HC $HC_OPTS -c C.hs
:shell $HC $HC_OPTS -c C.hs
:load A
:type (Main.a,B.b,C.c,D.d)
a 42
-- D,C,B compiled
:! $HC $HC_OPTS -c B.hs
:shell $HC $HC_OPTS -c B.hs
:load A
:type (Main.a,B.b,C.c,D.d)
a 42
-- D,C,B,A compiled
:! $HC $HC_OPTS -c A.hs
:shell $HC $HC_OPTS -c A.hs
:load A
:type (Main.a,B.b,C.c,D.d)
a 42
-- D,C,A compiled (better not use A.o)
:! rm B.o
:shell rm B.o
:load A
:type (Main.a,B.b,C.c,D.d)
a 42
-- D,A compiled (better not use A.o)
:! rm C.o
:shell rm C.o
:load A
:type (Main.a,B.b,C.c,D.d)
a 42
-- A compiled (better not use A.o)
:! rm D.o
:shell rm D.o
:load A
:type (Main.a,B.b,C.c,D.d)
a 42
-- A,B,C compiled (better not use A.o, B.o, C.o)
:! $HC $HC_OPTS --make -v0 A
:! rm D.o
:shell $HC $HC_OPTS --make -v0 A
:shell rm D.o
:load A
:type (Main.a,B.b,C.c,D.d)
a 42
{-# OPTIONS -cpp #-}
-- Used to present a consistent shell view for :! commands in GHCi
-- scripts. We're assuming cygwin is installed in C:/cygwin.
import System.Cmd
#ifdef mingw32_HOST_OS
shell s = system ("c:/cygwin/bin/sh.exe -c '" ++ s ++ "'")
#else
shell s = system s
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment