Make regression suite scripts work on posix as well.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@600 67173fc5-114c-0410-ac8e-9d2fd5bffc1fpull/1/head
parent
9fd2245eb1
commit
2d19e7cbbe
|
@ -68,9 +68,7 @@ def process_dir(d, outfile, file_filter):
|
|||
outf = os.path.join(os.getcwd(), settings.database_name,
|
||||
utils.hashing(fullp, pp))
|
||||
|
||||
cmd = utils.assimp_bin_path + " dump \"" + fullp + \
|
||||
"\" " + outf + " -b -s " + pp
|
||||
|
||||
cmd = [utils.assimp_bin_path,"dump",fullp,outf,"-b","-s",pp]
|
||||
outfile.write("assimp dump "+"-"*80+"\n")
|
||||
outfile.flush()
|
||||
if subprocess.call(cmd, stdout=outfile, stderr=outfile, shell=False):
|
||||
|
|
|
@ -178,8 +178,8 @@ def process_dir(d, outfile_results, zipin, result):
|
|||
outfile_expect = mkoutputdir_andgetpath(fullpath, filehash, "EXPECT")
|
||||
outfile_results.write("assimp dump "+"-"*80+"\n")
|
||||
outfile_results.flush()
|
||||
command = utils.assimp_bin_path + " dump \"" + fullpath + \
|
||||
"\" " + outfile_actual + " -b -s " + pppreset
|
||||
|
||||
command = [utils.assimp_bin_path,"dump",fullpath,outfile_actual,"-b","-s",pppreset]
|
||||
r = subprocess.call(command, **shellparams)
|
||||
|
||||
if r and not failure:
|
||||
|
@ -202,13 +202,14 @@ def process_dir(d, outfile_results, zipin, result):
|
|||
|
||||
outfile_results.write("assimp cmpdump "+"-"*80+"\n")
|
||||
outfile_results.flush()
|
||||
command = utils.assimp_bin_path + ' cmpdump "' + outfile_actual + '" "' \
|
||||
+ outfile_expect + '"'
|
||||
|
||||
command = [utils.assimp_bin_path,'cmpdump',outfile_actual,outfile_expect]
|
||||
if subprocess.call(command, **shellparams) != 0:
|
||||
result.fail(fullpath, outfile_expect, pppreset, DATABASE_VALUE_MISMATCH)
|
||||
continue
|
||||
result.ok(fullpath, pppreset, COMPARE_SUCCESS, len(input_expected))
|
||||
|
||||
result.ok(fullpath, pppreset, COMPARE_SUCCESS,
|
||||
len(input_expected))
|
||||
|
||||
# -------------------------------------------------------------------------------
|
||||
def del_folder_with_contents(folder):
|
||||
|
|
|
@ -46,11 +46,20 @@
|
|||
def hashing(file,pp):
|
||||
""" Map an input file and a postprocessing config to an unique hash.
|
||||
|
||||
The hash is used to store the item in the database. The buildin
|
||||
hash() function is used. The hash is a string.
|
||||
|
||||
The hash is used to store the item in the database. It
|
||||
needs to be persistent across different python implementations
|
||||
and platforms, so we implement the hashing manually.
|
||||
"""
|
||||
return hex(hash(file+":"+pp))
|
||||
|
||||
def myhash(instring):
|
||||
# sdbm hash
|
||||
res = 0
|
||||
for t in instring:
|
||||
res = (ord(t) + (res<<6) + (res<<16) - res) % 2**32
|
||||
os
|
||||
return res
|
||||
|
||||
return hex(myhash(file.replace('\\','/')+":"+pp))
|
||||
|
||||
|
||||
assimp_bin_path = None
|
||||
|
@ -87,19 +96,21 @@ def find_assimp_or_die():
|
|||
search = [os.path.join("..","..","bin","assimpcmd_release-dll_x64","assimp.exe"),
|
||||
os.path.join("..","..","bin","x64","assimp")]
|
||||
|
||||
elif os.name == "posix":
|
||||
search = [os.path.join("..","..","bin","gcc","assimp"),
|
||||
os.path.join("/usr","local","bin")]
|
||||
else:
|
||||
print("Unsupported operating system")
|
||||
sys.exit(-5)
|
||||
|
||||
assimp_bin_path = locate_file(search)
|
||||
if assimp_bin_path is None:
|
||||
print("Can't locate assimp_cmd binary")
|
||||
sys.exit(-5)
|
||||
|
||||
print("Located assimp/assimp_cmd binary at ",assimp_bin_path)
|
||||
elif os.name == "posix":
|
||||
#search = [os.path.join("..","..","bin","gcc","assimp"),
|
||||
# os.path.join("/usr","local","bin",'assimp')]
|
||||
assimp_bin_path = "assimp"
|
||||
print("Taking system-wide assimp binary")
|
||||
else:
|
||||
print("Unsupported operating system")
|
||||
sys.exit(-5)
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Reference in New Issue