Skip to content

Commit

Permalink
Clean up first test.
Browse files Browse the repository at this point in the history
  • Loading branch information
nominolo committed Dec 14, 2011
1 parent 7054371 commit 7feb9e9
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 34 deletions.
1 change: 1 addition & 0 deletions tests/Makefile
@@ -1,2 +1,3 @@
test:
make -C test1
make -C create-output-dirs
5 changes: 2 additions & 3 deletions tests/create-output-dirs/Makefile
Expand Up @@ -4,7 +4,6 @@ ROOT=../..

.PHONY: test
test:
@echo "Hello"
echo "foo" > A.txt
$(RUNHS) -i$(ROOT)/src cakefile.hs
diff -u A.txt build/A.txt
Expand All @@ -13,5 +12,5 @@ test:
echo "bar" >> A.txt
$(RUNHS) -i$(ROOT)/src cakefile.hs
diff -u A.txt build/A.txt
rm A.txt build/A.txt
rm -r build
rm A.txt build/A.txt .cake-db
rm -r build
8 changes: 0 additions & 8 deletions tests/test1/A.txt

This file was deleted.

1 change: 0 additions & 1 deletion tests/test1/B.txt

This file was deleted.

18 changes: 18 additions & 0 deletions tests/test1/Makefile
@@ -0,0 +1,18 @@
include ../testconfig.mk

ROOT=../..

.PHONY: test
test:
echo "foo" > A.txt
echo "bar" > B.txt
$(RUNHS) -i$(ROOT)/src cakefile.hs
echo "foo\nbar" > AB.txt.expected
diff -u AB.txt AB.txt.expected
$(RUNHS) -i$(ROOT)/src cakefile.hs
diff -u AB.txt AB.txt.expected
echo "FOO" >> A.txt
$(RUNHS) -i$(ROOT)/src cakefile.hs
echo "foo\nFOO\nbar" > AB.txt.expected
diff -u AB.txt AB.txt.expected
rm A.txt B.txt AB.txt AB.txt.expected .cake-db
23 changes: 1 addition & 22 deletions tests/test1/cakefile.hs
@@ -1,27 +1,6 @@
import Development.Cake
import Control.Monad.IO.Class ( liftIO )
import Control.Concurrent ( threadDelay )
--import Control.Monad.Exception ( throwIO )

main = cake $ do
"AB.txt" *> \out -> do
liftIO $ threadDelay (10 * seconds)
cat ["A.txt", "B.txt"] out

"CD.txt" *> \out ->
cat ["C.txt", "D.txt"] out

"ABCD.txt" *> \out ->
cat ["AB.txt", "CD.txt", "GH.txt"] out

"EF.txt" *> \out ->
fail "This rule is silly"

"GH.txt" *> \out -> do
cat ["A.txt", "AB.txt"] out
-- liftIO (readFile "mueanounaoe")
return ()

want ["ABCD.txt"]

seconds = 1000000
want ["AB.txt"]

0 comments on commit 7feb9e9

Please sign in to comment.