Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions test/models/test_models.in
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ par1d = datadir+"1d.par"
par2d = datadir+"2d.par"

def fail(cmd):
print "[Failed]"
print "Directory was: `" + check_dir + "'"
print "Command was: '" + cmd + "'"
print("[Failed]")
print("Directory was: `" + check_dir + "'")
print("Command was: '" + cmd + "'")
sys.exit(1)

def runCheck(check):
Expand All @@ -149,40 +149,40 @@ def runCheck(check):
if check['output'] != "":
run_cmd += " -o " + check['output']

print check['name']
print " run:\t\t", # we need the last comma to avoid newline
print(check['name'])
print(" run:\t\t", end='')
sys.stdout.flush()

devnull = open("/dev/null", "w")
code = call(run_cmd.split(), stdout=devnull)
devnull.close()
if code == 0:
print "[OK]"
print("[OK]")
else:
fail(run_cmd)

out_cmd = prefix + "/bin/" + "ester output " + check['output']
fin = open(check['template'], "r")
checkFile = check['output']+".check"

print " output:\t", # we need the last comma to avoid newline
print(" output:\t", end='')
sys.stdout.flush()

fout = open(checkFile, "w")
code = call(out_cmd.split(), stdin=fin, stdout=fout)
fin.close()
fout.close()
if code == 0:
print "[OK]"
print("[OK]")
else:
fail(run_cmd)

print " compare:\t", # we need the last comma to avoid newline
print(" compare:\t", end='')
sys.stdout.flush()

fcmp = compare(checkFile, check['ref'])
if fcmp == True:
print "[OK]"
print("[OK]")
else:
fail(run_cmd)

Expand Down