Adding shared testing

This commit is contained in:
Jeremy 2023-11-21 10:51:00 -06:00
parent fcef25276e
commit e4c498e844
No known key found for this signature in database
GPG Key ID: B4C8300FEC395042

View File

@ -159,7 +159,8 @@ def build(matrix):
f"-D{matrix['symbols']}=On", f"-D{matrix['symbols']}=On",
f"-D{matrix['demangle']}=On", f"-D{matrix['demangle']}=On",
"-DCPPTRACE_BACKTRACE_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/include/backtrace.h", "-DCPPTRACE_BACKTRACE_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/include/backtrace.h",
"-DCPPTRACE_BUILD_TESTING=On" "-DCPPTRACE_BUILD_TESTING=On",
f"-DBUILD_SHARED_LIBS={'On' if matrix['shared'] else 'Off'}"
] ]
if matrix['symbols'] == "CPPTRACE_GET_SYMBOLS_WITH_LIBDL": if matrix['symbols'] == "CPPTRACE_GET_SYMBOLS_WITH_LIBDL":
args.append("-DCPPTRACE_BUILD_TEST_RDYNAMIC=On") args.append("-DCPPTRACE_BUILD_TEST_RDYNAMIC=On")
@ -178,7 +179,8 @@ def build(matrix):
f"-D{matrix['unwind']}=On", f"-D{matrix['unwind']}=On",
f"-D{matrix['symbols']}=On", f"-D{matrix['symbols']}=On",
f"-D{matrix['demangle']}=On", f"-D{matrix['demangle']}=On",
"-DCPPTRACE_BUILD_TESTING=On" "-DCPPTRACE_BUILD_TESTING=On",
f"-DBUILD_SHARED_LIBS={'On' if matrix['shared'] else 'Off'}"
] ]
if matrix["compiler"] == "g++": if matrix["compiler"] == "g++":
args.append("-GUnix Makefiles") args.append("-GUnix Makefiles")
@ -201,7 +203,8 @@ def build_full_or_auto(matrix):
f"-DCMAKE_CXX_STANDARD={matrix['std']}", f"-DCMAKE_CXX_STANDARD={matrix['std']}",
f"-DCPPTRACE_USE_EXTERNAL_LIBDWARF=On", f"-DCPPTRACE_USE_EXTERNAL_LIBDWARF=On",
f"-DCPPTRACE_BACKTRACE_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/include/backtrace.h", f"-DCPPTRACE_BACKTRACE_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/include/backtrace.h",
"-DCPPTRACE_BUILD_TESTING=On" "-DCPPTRACE_BUILD_TESTING=On",
f"-DBUILD_SHARED_LIBS={'On' if matrix['shared'] else 'Off'}"
] ]
if matrix["config"] != "": if matrix["config"] != "":
args.append(f"{matrix['config']}") args.append(f"{matrix['config']}")
@ -217,7 +220,8 @@ def build_full_or_auto(matrix):
f"-DCMAKE_C_COMPILER={get_c_compiler_counterpart(matrix['compiler'])}", f"-DCMAKE_C_COMPILER={get_c_compiler_counterpart(matrix['compiler'])}",
f"-DCMAKE_CXX_STANDARD={matrix['std']}", f"-DCMAKE_CXX_STANDARD={matrix['std']}",
f"-DCPPTRACE_USE_EXTERNAL_LIBDWARF=On", f"-DCPPTRACE_USE_EXTERNAL_LIBDWARF=On",
"-DCPPTRACE_BUILD_TESTING=On" "-DCPPTRACE_BUILD_TESTING=On",
f"-DBUILD_SHARED_LIBS={'On' if matrix['shared'] else 'Off'}"
] ]
if matrix["config"] != "": if matrix["config"] != "":
args.append(f"{matrix['config']}") args.append(f"{matrix['config']}")
@ -326,6 +330,10 @@ def main():
"--all", "--all",
action="store_true" action="store_true"
) )
parser.add_argument(
"--shared",
action="store_true"
)
args = parser.parse_args() args = parser.parse_args()
if platform.system() == "Linux": if platform.system() == "Linux":
@ -356,6 +364,7 @@ def main():
"CPPTRACE_DEMANGLE_WITH_CXXABI", "CPPTRACE_DEMANGLE_WITH_CXXABI",
#"CPPTRACE_DEMANGLE_WITH_NOTHING", #"CPPTRACE_DEMANGLE_WITH_NOTHING",
], ],
"shared": [args.shared]
} }
exclude = [] exclude = []
run_matrix(matrix, exclude, build_and_test) run_matrix(matrix, exclude, build_and_test)
@ -363,7 +372,8 @@ def main():
"compiler": compilers, "compiler": compilers,
"target": ["Debug"], "target": ["Debug"],
"std": ["11", "20"], "std": ["11", "20"],
"config": [""] "config": [""],
"shared": [args.shared]
} }
exclude = [] exclude = []
run_matrix(matrix, exclude, build_and_test_full_or_auto) run_matrix(matrix, exclude, build_and_test_full_or_auto)
@ -392,7 +402,8 @@ def main():
"demangle": [ "demangle": [
"CPPTRACE_DEMANGLE_WITH_CXXABI", "CPPTRACE_DEMANGLE_WITH_CXXABI",
#"CPPTRACE_DEMANGLE_WITH_NOTHING", #"CPPTRACE_DEMANGLE_WITH_NOTHING",
] ],
"shared": [args.shared]
} }
exclude = [] exclude = []
run_matrix(matrix, exclude, build_and_test) run_matrix(matrix, exclude, build_and_test)
@ -400,7 +411,8 @@ def main():
"compiler": compilers, "compiler": compilers,
"target": ["Debug"], "target": ["Debug"],
"std": ["11", "20"], "std": ["11", "20"],
"config": [""] "config": [""],
"shared": [args.shared]
} }
exclude = [] exclude = []
run_matrix(matrix, exclude, build_and_test_full_or_auto) run_matrix(matrix, exclude, build_and_test_full_or_auto)
@ -431,7 +443,8 @@ def main():
"demangle": [ "demangle": [
"CPPTRACE_DEMANGLE_WITH_CXXABI", "CPPTRACE_DEMANGLE_WITH_CXXABI",
"CPPTRACE_DEMANGLE_WITH_NOTHING", "CPPTRACE_DEMANGLE_WITH_NOTHING",
] ],
"shared": [args.shared]
} }
exclude = [ exclude = [
{ {
@ -484,7 +497,8 @@ def main():
"compiler": compilers, "compiler": compilers,
"target": ["Debug"], "target": ["Debug"],
"std": ["11", "20"], "std": ["11", "20"],
"config": [""] "config": [""],
"shared": [args.shared]
} }
exclude = [] exclude = []
run_matrix(matrix, exclude, build_and_test_full_or_auto) run_matrix(matrix, exclude, build_and_test_full_or_auto)