7d7845acb5
Some checks failed
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (Release) (push) Waiting to run
linux-arm-gcc / linux-gcc-arm (Debug) (push) Waiting to run
linux-arm-gcc / linux-gcc-arm (Release) (push) Waiting to run
linux-arm-gcc / linux-gcc-armhf (Debug) (push) Waiting to run
linux-arm-gcc / linux-gcc-armhf (Release) (push) Waiting to run
linux-mips-gcc / linux-gcc-mipsel (Debug) (push) Waiting to run
linux-mips-gcc / linux-gcc-mipsel (Release) (push) Waiting to run
linux-mips64-gcc / linux-gcc-mips64el (Debug) (push) Waiting to run
linux-mips64-gcc / linux-gcc-mips64el (Release) (push) Waiting to run
linux-riscv64-gcc / linux-gcc-riscv64 (Debug) (push) Waiting to run
linux-riscv64-gcc / linux-gcc-riscv64 (Release) (push) Waiting to run
linux-x64-clang / linux-clang (Debug) (push) Waiting to run
linux-x64-clang / linux-clang (Release) (push) Waiting to run
linux-x64-gcc / linux-gcc (Debug) (push) Waiting to run
linux-x64-gcc / linux-gcc (Release) (push) Waiting to run
linux-x86-gcc / linux-gcc (Debug) (push) Waiting to run
linux-x86-gcc / linux-gcc (Release) (push) Waiting to run
android / build (push) Failing after 7m1s
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (Debug) (push) Has been cancelled
44 lines
1.5 KiB
Python
44 lines
1.5 KiB
Python
#!/usr/bin/env python
|
|
|
|
import os
|
|
import sys
|
|
import subprocess
|
|
import shutil
|
|
|
|
CMAKE = '@CMAKE_COMMAND@'
|
|
CMAKE_BUILD_TYPE = '@CMAKE_BUILD_TYPE@'
|
|
TMPDIR = '@TMPDIR@'
|
|
SRCDIR = '@SRCDIR@'
|
|
GFLAGS_DIR = '@gflags_BINARY_DIR@'
|
|
|
|
if __name__ == "__main__":
|
|
if len(sys.argv) != 4:
|
|
sys.stderr.write(' '.join(['usage:', sys.argv[0], '<test_name> <srcdir> <expect_fail:0|1>\n']))
|
|
sys.exit(1)
|
|
test_name = sys.argv[1]
|
|
srcdir = sys.argv[2]
|
|
expect_fail = (sys.argv[3].lower() in ['true', 'yes', 'on', '1'])
|
|
bindir = os.path.join(TMPDIR, test_name)
|
|
if TMPDIR == '':
|
|
sys.stderr.write('Temporary directory not set!\n')
|
|
sys.exit(1)
|
|
# create build directory
|
|
if os.path.isdir(bindir): shutil.rmtree(bindir)
|
|
os.makedirs(bindir)
|
|
# configure the build tree
|
|
if subprocess.call([CMAKE, '-DCMAKE_BUILD_TYPE:STRING='+CMAKE_BUILD_TYPE,
|
|
'-Dgflags_DIR:PATH='+GFLAGS_DIR,
|
|
'-DTEST_NAME:STRING='+test_name, srcdir], cwd=bindir) != 0:
|
|
sys.stderr.write('Failed to configure the build tree!\n')
|
|
sys.exit(1)
|
|
# build the test project
|
|
exit_code = subprocess.call([CMAKE, '--build', bindir, '--config', CMAKE_BUILD_TYPE], cwd=bindir)
|
|
if expect_fail == True:
|
|
if exit_code == 0:
|
|
sys.stderr.write('Build expected to fail, but it succeeded!\n')
|
|
sys.exit(1)
|
|
else:
|
|
sys.stderr.write('Build failed as expected\n')
|
|
exit_code = 0
|
|
sys.exit(exit_code)
|