|
|
|
@ -51,19 +51,35 @@ def equal_binaries(path_original, path):
|
|
|
|
|
|
|
|
|
|
diffs = binary_original - binary
|
|
|
|
|
|
|
|
|
|
comparisons = np.array([abs(x) < 0.001 for x in diffs]) #NO ME DA TAMPOCO CON ESTE ERROR
|
|
|
|
|
print("ORIGINAL")
|
|
|
|
|
#print(binary_original)
|
|
|
|
|
|
|
|
|
|
print("MIO")
|
|
|
|
|
#print(binary)
|
|
|
|
|
|
|
|
|
|
for i,x in enumerate(diffs):
|
|
|
|
|
#print(x)
|
|
|
|
|
if (abs(x) > 0.01).any():
|
|
|
|
|
print("fallo")
|
|
|
|
|
print("ORIGINAL")
|
|
|
|
|
print(binary_original[i][0])
|
|
|
|
|
print("MIO")
|
|
|
|
|
print(binary[i][0])
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
comparisons = np.array([(abs(x) < 0.01).all() for x in diffs]) #NO ME DA TAMPOCO CON ESTE ERROR
|
|
|
|
|
|
|
|
|
|
return comparisons.all()
|
|
|
|
|
|
|
|
|
|
if comparisons.all():
|
|
|
|
|
return True
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
binaries = ['Cmap', 'D', 'P', 'V']
|
|
|
|
|
|
|
|
|
|
def test():
|
|
|
|
|
os.chdir('../..') #LO COMENTE PARA EVITAR VOLVER A CORRERLO
|
|
|
|
|
#config_file = os.path.abspath("./tests/integration/conf_test.ini")
|
|
|
|
|
#os.system("CONFIG_FILE_PATH="+ config_file + " mpirun python mpirunner.py")
|
|
|
|
|
config_file = os.path.abspath("./tests/integration/conf_test.ini")
|
|
|
|
|
os.system("CONFIG_FILE_PATH="+ config_file + " mpirun python mpirunner.py")
|
|
|
|
|
|
|
|
|
|
#are_equal = are_dir_trees_equal("./tests/integration/tmp_output","./test_loop")
|
|
|
|
|
|
|
|
|
@ -74,8 +90,12 @@ def test():
|
|
|
|
|
|
|
|
|
|
if not equal_binaries(path_original, path):
|
|
|
|
|
print("Failure :( on {}".format(i))
|
|
|
|
|
os.system("rm -rf ./tests/integration/tmp_output")
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
print("Success!")
|
|
|
|
|
os.system("rm -rf ./tests/integration/tmp_output")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test()
|
|
|
|
|
test()
|