diff --git a/redo-ifcreate.py b/redo-ifcreate.py index 25ffe0c..96b567f 100755 --- a/redo-ifcreate.py +++ b/redo-ifcreate.py @@ -14,5 +14,6 @@ try: sys.exit(1) else: f.add_dep('c', t) + state.commit() except KeyboardInterrupt: sys.exit(200) diff --git a/t/.gitignore b/t/.gitignore index cce02cf..60b3c7a 100644 --- a/t/.gitignore +++ b/t/.gitignore @@ -18,3 +18,6 @@ test2.args /deltest2 /always1 /always1.log +/ifcreate[12].log +/ifcreate[12].dep +/ifcreate[12] diff --git a/t/clean.do b/t/clean.do index c1ae562..4b76a1c 100644 --- a/t/clean.do +++ b/t/clean.do @@ -1,5 +1,5 @@ redo example/clean curse/clean deps/clean "space dir/clean" stamp/clean rm -f c c.c c.c.c c.c.c.b c.c.c.b.b d mode1 makedir.log chdir1 deltest2 \ hello [by]ellow *.o *~ .*~ *.log CC LD passfail silence silence.do \ - touch1 touch1.do always1 + touch1 touch1.do always1 ifcreate[12].dep ifcreate[12] rm -rf makedir diff --git a/t/ifcreate-test.do b/t/ifcreate-test.do new file mode 100644 index 0000000..73586f1 --- /dev/null +++ b/t/ifcreate-test.do @@ -0,0 +1,21 @@ +rm -f exists ifcreate[12] ifcreate[12].log ifcreate[12].dep +. ./skip-if-minimal-do.sh +touch exists +redo-ifcreate exists 2>/dev/null && exit 91 +rm exists +redo-ifcreate exists || exit 92 + +for d in 1 2; do + redo ifcreate$d + [ "$(wc -l >ifcreate1.log diff --git a/t/ifcreate2.do b/t/ifcreate2.do new file mode 100644 index 0000000..3fcfe8a --- /dev/null +++ b/t/ifcreate2.do @@ -0,0 +1,7 @@ +cd .. +if [ -e t/ifcreate2.dep ]; then + redo-ifchange t/ifcreate2.dep +else + redo-ifcreate t/ifcreate2.dep +fi +echo $$ >>t/ifcreate2.log diff --git a/t/test.do b/t/test.do index 3a6594b..1a8ba21 100644 --- a/t/test.do +++ b/t/test.do @@ -2,4 +2,4 @@ redo-ifchange all ./hello >&2 redo deltest deltest2 test.args test2.args passfailtest chdirtest \ curse/test deps/test "space dir/test" modetest makedir2 \ - silencetest touchtest stamp/test alwaystest + silencetest touchtest stamp/test alwaystest ifcreate-test