On Wed, 2020-07-22 at 13:31 -0700, Joe Slater wrote: > Use a static TESTDATADIR if tests are disabled. Allow > override of TESTDATADIR if tests are enabled since the > default will be wrong for target builds. > > Signed-off-by: Joe Slater <[email protected]> > --- > .../libdnf/libdnf/enable_test_data_dir_set.patch | 26 > ++++++++++++++++++++++ > meta/recipes-devtools/libdnf/libdnf_0.48.0.bb | 1 + > 2 files changed, 27 insertions(+) > create mode 100644 > meta/recipes-devtools/libdnf/libdnf/enable_test_data_dir_set.patch > > diff --git > a/meta/recipes-devtools/libdnf/libdnf/enable_test_data_dir_set.patch > b/meta/recipes-devtools/libdnf/libdnf/enable_test_data_dir_set.patch > new file mode 100644 > index 0000000..e3784cc > --- /dev/null > +++ b/meta/recipes-devtools/libdnf/libdnf/enable_test_data_dir_set.patch > @@ -0,0 +1,26 @@ > +libdnf: allow reproducible binary builds > + > +Use a dummy directory for test data if not built WITH_TESTS. Allow for > overriding > +TESTDATADIR, since the default is guaranteed to be wrong for target builds. > + > +Upstream-Status: Pending > + > +Signed-off-by: Joe Slater <[email protected]> > + > + > +--- a/CMakeLists.txt > ++++ b/CMakeLists.txt > +@@ -133,7 +133,12 @@ add_definitions(-DG_LOG_DOMAIN=\\"libdnf > + add_definitions(-D_FILE_OFFSET_BITS=64) > + > + # tests > +-add_definitions(-DTESTDATADIR=\\"${CMAKE_SOURCE_DIR}/data/tests\\") > ++if(NOT WITH_TESTS) > ++ set(TEST_DATA_DIR "/notests") > ++elseif(NOT DEFINED TEST_DATA_DIR) > ++ set(TEST_DATA_DIR "${CMAKE_SOURCE_DIR}/data/tests") > ++endif() > ++add_definitions(-DTESTDATADIR=\\"${TEST_DATA_DIR}\\")
Do we need to set a value in the build or do we never enable the tests? Cheers, Richard
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#140878): https://lists.openembedded.org/g/openembedded-core/message/140878 Mute This Topic: https://lists.openembedded.org/mt/75733268/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
