[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
s.popinet at niwa.co.nz
Fri May 15 02:52:11 UTC 2009
The following commit has been merged in the upstream branch:
commit 6cfbf24e3cca4081fc034e58a24f326a32646ca6
Author: Stephane Popinet <s.popinet at niwa.co.nz>
Date: Tue Jul 5 12:31:04 2005 +1000
Cleanup of test script for doc/examples
darcs-hash:20050705023104-fbd8f-10d766976f0729aff48dc01bb34b6dce5edb4afd.gz
diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am
index 5c32368..2467a9a 100644
--- a/doc/examples/Makefile.am
+++ b/doc/examples/Makefile.am
@@ -18,8 +18,8 @@ EXTRA_DIST = \
TESTS = test.sh
test.sh: $(EXAMPLES)
- echo "python test.py $(EXAMPLES)" > test.sh
- chmod +x test.sh
+ @echo "python test.py $(EXAMPLES)" > test.sh
+ @chmod +x test.sh
bin_SCRIPTS = \
gfs2doc
diff --git a/doc/examples/gfs2tex.py b/doc/examples/gfs2tex.py
index c162b9d..c1734cc 100644
--- a/doc/examples/gfs2tex.py
+++ b/doc/examples/gfs2tex.py
@@ -216,10 +216,8 @@ class Example:
" print $0 \"\\nTime { iend = 1 }\";" +
"else print $0;"
"}' < " + self.name + ".gfs > " + self.name + ".tmp && " +\
- "mv -f " + self.name + ".tmp " + self.name + ".gfs && " +\
- "`awk '{if($1 == \"#\" && $2 == \"Command:\")"+\
- " for (i = 3; i <= NF; i++) printf (\"%s \", $i);" +\
- "}' < " + self.name + ".gfs` 2>&1")
+ "mv -f " + self.name + ".tmp " + self.name + ".gfs && ( " +\
+ self.command + " ) 2>&1")
lines = out.readlines()
status = out.close()
os.system("rm -r -f " + wdname)
diff --git a/doc/examples/test.py b/doc/examples/test.py
index 20b4305..797b612 100644
--- a/doc/examples/test.py
+++ b/doc/examples/test.py
@@ -3,13 +3,30 @@ import os
import os.path
import gfs2tex
+n = 0
+failed = 0
for start in sys.argv[1:]:
for root, dirs, files in os.walk(start,topdown=True):
if not ".xvpics" in root:
example = gfs2tex.Example(root)
status,msg = example.test()
if status != None:
- print root + ": FAIL"
- print " ".join(msg)
+ print "FAIL:",root
+ if len(msg) > 0:
+ print " ".join(msg)
+ failed += 1
else:
- print root + ": PASS"
+ print "PASS:",root
+ n += 1
+
+if failed:
+ msg = repr(failed) + " of " + repr(n) + " tests failed"
+else:
+ msg = "All " + repr(n) + " tests passed"
+
+print len(msg)*"="
+print msg
+print len(msg)*"="
+
+if failed:
+ sys.exit(1)
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list