package/gli: disable tests
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Sat, 31 Jul 2021 21:39:54 +0000 (23:39 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sat, 31 Jul 2021 22:02:51 +0000 (00:02 +0200)
Disable tests to avoid the following build failure with gcc 11:

/srv/storage/autobuild/run/instance-2/output-1/build/gli-559cbe1ec38878e182507d331e0780fbae5baf15/test/core/core_convert.cpp: In function 'bool convert_rgb32f_rgb9e5(const char*, const char*)':
/srv/storage/autobuild/run/instance-2/output-1/build/gli-559cbe1ec38878e182507d331e0780fbae5baf15/test/core/core_convert.cpp:36:45: error: ordered comparison of pointer with integer zero ('const char*' and 'int')
   36 |         if(std::strstr(FilenameDst, ".dds") > 0 || std::strstr(FilenameDst, ".ktx") > 0)
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~

Fixes:
 - http://autobuild.buildroot.org/results/4f1dbb7cf2b071f3b92d00d13984068ef5f5b329

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/gli/0001-Optional-building-tests.patch [new file with mode: 0644]
package/gli/gli.mk

diff --git a/package/gli/0001-Optional-building-tests.patch b/package/gli/0001-Optional-building-tests.patch
new file mode 100644 (file)
index 0000000..c085e50
--- /dev/null
@@ -0,0 +1,45 @@
+From 629fc81ce73114a5925484937df796467adbe8c7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jo=C3=A3o=20Pereira?= <pereira.john94@gmail.com>
+Date: Fri, 22 Mar 2019 22:58:17 +0000
+Subject: [PATCH] Optional building tests
+
+[Retrieved from:
+https://github.com/g-truc/gli/commit/629fc81ce73114a5925484937df796467adbe8c7]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ CMakeLists.txt      | 1 +
+ test/CMakeLists.txt | 8 +++++---
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 6eb1a68b..bcff7ef0 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -13,6 +13,7 @@ include(GNUInstallDirs)
+ include(CMakePackageConfigHelpers)
+ enable_testing()
++option(GLI_TEST_ENABLE "Build unit tests" ON)
+ add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+ add_definitions(-DSOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
+diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
+index 6b1d4826..e51a3181 100644
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -19,10 +19,12 @@ function(glmCreateTestGTC NAME)
+       set(SAMPLE_NAME test-${NAME})
+       add_executable(${SAMPLE_NAME} ${NAME}.cpp)
+       target_link_libraries(${SAMPLE_NAME} gli)
+-      add_test( 
++      add_test(
+               NAME ${SAMPLE_NAME}
+               COMMAND $<TARGET_FILE:${SAMPLE_NAME}> )
+ endfunction()
+-add_subdirectory(bug)
+-add_subdirectory(core)
++if(GLI_TEST_ENABLE)
++      add_subdirectory(bug)
++      add_subdirectory(core)
++endif()
index 6a332d0e08e8ea21bc5c7635bb3fd4c4f22cb5c2..9b9990910aa3df202d9c9da93b795fb4163dd91a 100644 (file)
@@ -14,4 +14,6 @@ GLI_LICENSE_FILES = manual.md
 GLI_INSTALL_STAGING = YES
 GLI_INSTALL_TARGET = NO
 
+GLI_CONF_OPTS = -DGLI_TEST_ENABLE=OFF
+
 $(eval $(cmake-package))