Reworked search for executable files in tests (#630)

This commit is contained in:
Nikita Karpey 2020-02-25 17:29:09 +00:00 committed by GitHub
parent 9c01847b21
commit 885645686e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,16 +112,18 @@ def filtered_test(func):
return wrapper
def path_to_executable(program_name):
path = "."
if sys.platform.startswith("win"):
if 'APPVEYOR_BUILD_FOLDER' not in os.environ: os.environ['APPVEYOR_BUILD_FOLDER'] = "."
return os.path.join(
os.environ['APPVEYOR_BUILD_FOLDER'],
'build',
'tests',
program_name + ".EXE"
)
else:
return os.path.join("build", "tests", program_name)
path = os.path.join(path, os.environ['APPVEYOR_BUILD_FOLDER'])
path = os.path.join(path, "build", "tests")
for executable in [
os.path.join(path, program_name),
os.path.join(path, program_name + ".EXE"),
os.path.join(path, program_name + ".exe")]:
if os.path.isfile(executable):
return executable
assert False, "Unable to find executable file {}".format(program_name)
def available_use_options_by_name():
enabled_use_options = []