Skip to content

Commit

Permalink
loader_test: Adjust runtime manifest generation so it works and produ…
Browse files Browse the repository at this point in the history
…ces a valid manifest.

This combined with earlier changes lets you run list against it.
  • Loading branch information
rpavlik committed Mar 9, 2020
1 parent 3bb0e8e commit 7c5291f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
13 changes: 13 additions & 0 deletions src/scripts/generate_runtime_manifest.py
Expand Up @@ -45,6 +45,19 @@ def main(argv):
elif opt in ("-b", "--bad"):
generate_badjson_jsons = True

file_text = '{\n'
file_text += ' "file_format_version": "%s",\n' % cur_runtime_json_version
file_text += ' "runtime": {\n'
file_text += ' "library_path": "%s",\n' % library_location
file_text += ' "functions": {\n'
file_text += ' "xrNegotiateLoaderRuntimeInterface":\n'
file_text += ' "xrNegotiateLoaderRuntimeInterface"\n'
file_text += ' }\n'
file_text += ' }\n'
file_text += '}\n'
with open(output_file, 'w') as f:
f.write(file_text)

if generate_badjson_jsons:
# Bad File format versions
####################################
Expand Down
8 changes: 2 additions & 6 deletions src/tests/loader_test/test_runtimes/CMakeLists.txt
Expand Up @@ -34,7 +34,6 @@ set_target_properties(test_runtime PROPERTIES FOLDER ${TESTS_FOLDER})
add_dependencies(test_runtime
xr_global_generated_files
generate_openxr_header
generated_rt_json_files
)
target_include_directories(test_runtime
PRIVATE ${PROJECT_SOURCE_DIR}/src
Expand Down Expand Up @@ -85,8 +84,5 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
)
endif()

add_custom_target(generated_rt_json_files DEPENDS
${PROJECT_BINARY_DIR}/src/tests/loader_test/resources/runtimes/test_runtime.json
)
set_target_properties(generated_rt_json_files PROPERTIES FOLDER ${CODEGEN_FOLDER})

# Add generated file to our sources so we depend on it, and thus trigger geenration.
target_sources(test_runtime PRIVATE ${PROJECT_BINARY_DIR}/src/tests/loader_test/resources/runtimes/test_runtime.json)

0 comments on commit 7c5291f

Please sign in to comment.