mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 13:20:47 -06:00
Tests: Add case covering FindGLUT variables and imported targets
Signed-off-by: Christopher Degawa <ccom@randomderp.com>
This commit is contained in:
@@ -16,6 +16,7 @@ set(CMake_TEST_FindGDAL "ON" CACHE BOOL "")
|
||||
set(CMake_TEST_FindGIF "ON" CACHE BOOL "")
|
||||
set(CMake_TEST_FindGit "ON" CACHE BOOL "")
|
||||
set(CMake_TEST_FindGLEW "ON" CACHE BOOL "")
|
||||
set(CMake_TEST_FindGLUT "ON" CACHE BOOL "")
|
||||
set(CMake_TEST_FindGnuTLS "ON" CACHE BOOL "")
|
||||
set(CMake_TEST_FindGSL "ON" CACHE BOOL "")
|
||||
set(CMake_TEST_FindGTest "ON" CACHE BOOL "")
|
||||
|
||||
@@ -16,6 +16,7 @@ set(CMake_TEST_FindGDAL "ON" CACHE BOOL "")
|
||||
set(CMake_TEST_FindGIF "ON" CACHE BOOL "")
|
||||
set(CMake_TEST_FindGit "ON" CACHE BOOL "")
|
||||
set(CMake_TEST_FindGLEW "ON" CACHE BOOL "")
|
||||
set(CMake_TEST_FindGLUT "ON" CACHE BOOL "")
|
||||
set(CMake_TEST_FindGnuTLS "ON" CACHE BOOL "")
|
||||
set(CMake_TEST_FindGSL "ON" CACHE BOOL "")
|
||||
set(CMake_TEST_FindGTest "ON" CACHE BOOL "")
|
||||
|
||||
@@ -16,6 +16,7 @@ set(CMake_TEST_FindGDAL "ON" CACHE BOOL "")
|
||||
set(CMake_TEST_FindGIF "ON" CACHE BOOL "")
|
||||
set(CMake_TEST_FindGit "ON" CACHE BOOL "")
|
||||
set(CMake_TEST_FindGLEW "ON" CACHE BOOL "")
|
||||
set(CMake_TEST_FindGLUT "ON" CACHE BOOL "")
|
||||
set(CMake_TEST_FindGnuTLS "ON" CACHE BOOL "")
|
||||
set(CMake_TEST_FindGSL "ON" CACHE BOOL "")
|
||||
set(CMake_TEST_FindGTest "ON" CACHE BOOL "")
|
||||
|
||||
@@ -1442,6 +1442,7 @@ if(BUILD_TESTING)
|
||||
GIF
|
||||
Git
|
||||
GLEW
|
||||
GLUT
|
||||
GnuTLS
|
||||
GSL
|
||||
GTK2
|
||||
|
||||
9
Tests/FindGLUT/CMakeLists.txt
Normal file
9
Tests/FindGLUT/CMakeLists.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
add_test(NAME FindGLUT.Test COMMAND ${CMAKE_CTEST_COMMAND}
|
||||
--build-and-test
|
||||
"${CMake_SOURCE_DIR}/Tests/FindGLUT/Test"
|
||||
"${CMake_BINARY_DIR}/Tests/FindGLUT/Test"
|
||||
${build_generator_args}
|
||||
--build-project TestFindGLUT
|
||||
--build-options ${build_options}
|
||||
--test-command ${CMAKE_CTEST_COMMAND} -V
|
||||
)
|
||||
17
Tests/FindGLUT/Test/CMakeLists.txt
Normal file
17
Tests/FindGLUT/Test/CMakeLists.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
cmake_minimum_required(VERSION 3.21)
|
||||
project(TestFindGLUT C)
|
||||
include(CTest)
|
||||
|
||||
find_package(GLUT REQUIRED)
|
||||
|
||||
add_executable(testglut_tgt main.c)
|
||||
target_link_libraries(testglut_tgt GLUT::GLUT)
|
||||
add_test(NAME testglut_tgt COMMAND testglut_tgt)
|
||||
|
||||
add_executable(testglut_var main.c)
|
||||
target_include_directories(testglut_var PRIVATE ${GLUT_INCLUDE_DIRS})
|
||||
target_link_libraries(testglut_var PRIVATE ${GLUT_LIBRARIES})
|
||||
add_test(NAME testglut_var COMMAND testglut_var)
|
||||
|
||||
set_tests_properties(testglut_tgt testglut_var
|
||||
PROPERTIES WILL_FAIL true)
|
||||
11
Tests/FindGLUT/Test/main.c
Normal file
11
Tests/FindGLUT/Test/main.c
Normal file
@@ -0,0 +1,11 @@
|
||||
#include <GL/glut.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
/* The following should call exit(1) and print
|
||||
freeglut ERROR: Function <glutCreateWindow> called
|
||||
without first calling 'glutInit'.
|
||||
to stderr */
|
||||
glutCreateWindow("gluttest");
|
||||
}
|
||||
Reference in New Issue
Block a user