Add an option to have ctest apply the required test migration #68
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Generate cmake targets that invoke
testdata_tom
to apply the test schema. Use cmake here in order to be able to invoke the binary independend of debug suffices or binary paths. A Generator expression could also have emitted$<TARGET_FILE:testdata_tom>
in oder to determine the filename of the emitted binaries, however,file(GENERATE OUTPUT)
does not support target dependend generator expression, whilefile(CONFIGURE)
andconfigure_file
do not support generator expressions at all.Rather then generating additional test cases for the
testdata_tom
binary and adding them to a ctest testsuite in a fixture where the migration is a FIXTURE_SETUP to the other tests to ensure it gets executed prior to the other unit tests, generate a CTestCustom.cmake script, which, unlike the content in CMakeLists.txt, gets executed at test-time, so a variation of the environment variables is detected.Add a new environment variable named
DB_AUTOMIGRATE
to enable schema migration prior to the test suite invokation. CTestCustom.cmake is way less capable to process cmake options then CMakeLists.txt, due to CMP0012 causing "ON" to be interpreted as false until cmake-4.0 which removes legacy support for CMP0012.Therefore, keep the ctest definition simple for the time being
Fixes #67 .