Skip to content

Commit

Permalink
path cleanup, separated data and scripts; removed xl tests (replaced …
Browse files Browse the repository at this point in the history
…by visual mode)
  • Loading branch information
thunil committed Sep 1, 2014
1 parent 6d6bfc6 commit 5a7caaf
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 89 deletions.
1 change: 1 addition & 0 deletions tools/testdata/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Reference data for test runs is stored and generated here - either download it from the mantaflow website, or generate it by calling "MANTA_GEN_TEST_DATA=1 manta/tools/tests/runTests.py <path-to-mantaflow-executable>"
14 changes: 13 additions & 1 deletion tools/tests/helperGeneric.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,21 @@
def outputFilename( file, gridname ):
return file +"_"+ gridname + "_out.uni"

def referenceFilename( file, gridname ):
# original, simpler...
def referenceFilename_old( file, gridname ):
return file +"_"+ gridname + "_ref.uni"

# new version, extract directory & basename...
def referenceFilename( file, gridname ):
(name,ext) = os.path.splitext( os.path.basename(file) )
return dataDirectory(file)+"/"+ name +"_"+ gridname + ".uni"

def dataDirectory( file ):
# extract path from script call
basename = os.path.basename(file)
basedir = os.path.dirname (file)
return basedir +"/"+ "../testdata"


def getGenRefFileSetting( ):
# check env var for generate data setting
Expand Down
36 changes: 15 additions & 21 deletions tools/tests/runTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Simple script to run all base tests
# The test scripts are named test_XXXX_description.py
# They are assumed to be in ascending order or complexity.
# They are assumed to be in ascending order of complexity.
#
# Rough ordering:
# 0xxx tests are very basic (mostly single operator calls)
Expand Down Expand Up @@ -33,22 +33,9 @@
manta = sys.argv[1]
print "Using mantaflow executable '" + manta + "' "

# check parameters:
# xl - whether complex/large tests should be run
if(len(sys.argv)>2):
for i in range(2, len(sys.argv)):
if(sys.argv[i].lower() == "xl"):
print "Running XL tests! This can take a while..."
filePrefix = "xltest_"
else:
print "Error: unknown parameter '" + sys.argv[i] +"' "
exit(1);

files = os.popen("ls "+str(filePrefix)+"????_*.py").read()
#print "Debug - using test scene files: "+files

# NT_DEBUG , todo use , extract file name!
datadir = "./data"
# store test data in separate directory
datadir = dataDirectory(sys.argv[0])
if not os.path.exists( datadir ):
os.makedirs( datadir )

Expand All @@ -57,7 +44,6 @@
print "Tests results will not be evaluated...\n"

currdate = os.popen("date \"+%y%m%d%H%M\"").read()
#currdate.rstrip(" \n")
currdate = str(currdate)[:-1]

# in visual mode, also track runtimes
Expand All @@ -73,6 +59,16 @@
# limit the runs for debugging
visModeDebugCount = 0

# extract path from script call
basedir = os.path.dirname (sys.argv[0])
#os.path.splitext(base)

files = os.popen("ls "+basedir+"/"+str(filePrefix)+"????_*.py").read()
#print "Debug - using test scene files: "+files


# ready to go...

num = 0
numOks = 0
numFail = 0
Expand Down Expand Up @@ -122,7 +118,7 @@
os.popen("./helperGnuplot.sh %s"%(timefile))

# for debugging, only execute a few files
visModeDebugCount += 1
#visModeDebugCount += 1


if getGenRefFileSetting():
Expand All @@ -140,9 +136,7 @@
os.popen( "mv -f ./test_*.ppm %s"%(visModeTrashDir) )
exit(0)

print
print " ============================================= "
print
print "\n ============================================= \n"
print "Test summary: " + str(numOks) + " passed, " + str(numFail) + " failed. (from "+str(num) + " files) "

if (numFail==0) and (numOks==0):
Expand Down
67 changes: 0 additions & 67 deletions tools/tests/xltest_0001_plume3d.py

This file was deleted.

0 comments on commit 5a7caaf

Please sign in to comment.