configurejson2cmake: Fix non-inline compile tests
If there's no test dir set, use "config.tests" as default value, and perform the check for the existence of CMakeLists.txt in configurejson2cmake, not the configure.cmake file. Change-Id: I8d3be8f2b68767c7592665c374022353c2dc6c57 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
parent
343865201a
commit
1057d568bb
@ -533,19 +533,15 @@ def parseTest(ctx, test, data, cm_fh):
|
||||
details = test
|
||||
|
||||
if isinstance(details, str):
|
||||
if not ctx["test_dir"]:
|
||||
print(f" XXXX UNHANDLED TEST SUB-TYPE {details} in test description")
|
||||
return
|
||||
|
||||
cm_fh.write(
|
||||
f"""
|
||||
if(EXISTS "${{CMAKE_CURRENT_SOURCE_DIR}}/{ctx['test_dir']}/{data['test']}/CMakeLists.txt")
|
||||
qt_config_compile_test("{data['test']}"
|
||||
LABEL "{data['label']}"
|
||||
PROJECT_PATH "${{CMAKE_CURRENT_SOURCE_DIR}}/{ctx['test_dir']}/{data['test']}")
|
||||
endif()
|
||||
rel_test_project_path = f"{ctx['test_dir']}/{details}"
|
||||
if posixpath.exists(f"{ctx['project_dir']}/{rel_test_project_path}/CMakeLists.txt"):
|
||||
cm_fh.write(
|
||||
f"""
|
||||
qt_config_compile_test("{details}"
|
||||
LABEL "{data['label']}"
|
||||
PROJECT_PATH "${{CMAKE_CURRENT_SOURCE_DIR}}/{rel_test_project_path}")
|
||||
"""
|
||||
)
|
||||
)
|
||||
return
|
||||
|
||||
head = details.get("head", "")
|
||||
@ -1077,8 +1073,9 @@ def processSubconfigs(path, ctx, data):
|
||||
|
||||
|
||||
def processJson(path, ctx, data):
|
||||
ctx["project_dir"] = path
|
||||
ctx["module"] = data.get("module", "global")
|
||||
ctx["test_dir"] = data.get("testDir", "")
|
||||
ctx["test_dir"] = data.get("testDir", "config.tests")
|
||||
|
||||
ctx = processFiles(ctx, data)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user