From ee94ded5e1f6585451d7376f711dc12cb3d92a01 Mon Sep 17 00:00:00 2001 From: JinWang An Date: Tue, 27 Dec 2022 17:20:04 +0900 Subject: Imported Upstream version 3.22.0 --- Tests/FindGLUT/CMakeLists.txt | 9 +++++++++ Tests/FindGLUT/Test/CMakeLists.txt | 17 +++++++++++++++++ Tests/FindGLUT/Test/main.c | 11 +++++++++++ 3 files changed, 37 insertions(+) create mode 100644 Tests/FindGLUT/CMakeLists.txt create mode 100644 Tests/FindGLUT/Test/CMakeLists.txt create mode 100644 Tests/FindGLUT/Test/main.c (limited to 'Tests/FindGLUT') diff --git a/Tests/FindGLUT/CMakeLists.txt b/Tests/FindGLUT/CMakeLists.txt new file mode 100644 index 000000000..e75ec408b --- /dev/null +++ b/Tests/FindGLUT/CMakeLists.txt @@ -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 + ) diff --git a/Tests/FindGLUT/Test/CMakeLists.txt b/Tests/FindGLUT/Test/CMakeLists.txt new file mode 100644 index 000000000..0f4e53673 --- /dev/null +++ b/Tests/FindGLUT/Test/CMakeLists.txt @@ -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) diff --git a/Tests/FindGLUT/Test/main.c b/Tests/FindGLUT/Test/main.c new file mode 100644 index 000000000..1c8569c12 --- /dev/null +++ b/Tests/FindGLUT/Test/main.c @@ -0,0 +1,11 @@ +#include +#include + +int main() +{ + /* The following should call exit(1) and print + freeglut ERROR: Function called + without first calling 'glutInit'. + to stderr */ + glutCreateWindow("gluttest"); +} -- cgit v1.2.3