From 0f6c7a4bebacb12b51f5b33b3d122a97c5881a05 Mon Sep 17 00:00:00 2001 From: Fernando Cacciola Date: Tue, 7 Oct 2008 18:41:01 +0000 Subject: [PATCH] Added user-side tests for components existence and behaviour --- .gitattributes | 7 ++ Installation/test/Installation/CMakeLists.txt | 66 +++++++++++++++++++ .../test/Installation/link_to_CGAL.cpp | 10 +++ .../test/Installation/link_to_CGAL_Core.cpp | 12 ++++ .../Installation/link_to_CGAL_ImageIO.cpp | 11 ++++ .../test/Installation/link_to_CGAL_PDB.cpp | 12 ++++ .../test/Installation/link_to_CGAL_Qt3.cpp | 10 +++ .../test/Installation/link_to_CGAL_Qt4.cpp | 12 ++++ 8 files changed, 140 insertions(+) create mode 100644 Installation/test/Installation/CMakeLists.txt create mode 100644 Installation/test/Installation/link_to_CGAL.cpp create mode 100644 Installation/test/Installation/link_to_CGAL_Core.cpp create mode 100644 Installation/test/Installation/link_to_CGAL_ImageIO.cpp create mode 100644 Installation/test/Installation/link_to_CGAL_PDB.cpp create mode 100644 Installation/test/Installation/link_to_CGAL_Qt3.cpp create mode 100644 Installation/test/Installation/link_to_CGAL_Qt4.cpp diff --git a/.gitattributes b/.gitattributes index 8ad922f5d5a..331b1694992 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1767,6 +1767,13 @@ Installation/config/support/test_BOOST_THREAD.cpp -text Installation/config/testfiles/CGAL_CFG_NO_CPP0X_ISFINITE.cpp -text Installation/src/CGAL/all_files.cpp -text Installation/src/CMakeLists.txt -text +Installation/test/Installation/CMakeLists.txt -text +Installation/test/Installation/link_to_CGAL.cpp -text +Installation/test/Installation/link_to_CGAL_Core.cpp -text +Installation/test/Installation/link_to_CGAL_ImageIO.cpp -text +Installation/test/Installation/link_to_CGAL_PDB.cpp -text +Installation/test/Installation/link_to_CGAL_Qt3.cpp -text +Installation/test/Installation/link_to_CGAL_Qt4.cpp -text Interpolation/doc_tex/Interpolation/nn_coords.eps -text svneol=unset#application/postscript Interpolation/doc_tex/Interpolation/nn_coords.gif -text svneol=unset#image/gif Interpolation/doc_tex/Interpolation/nn_coords.ipe -text svneol=unset#application/postscript diff --git a/Installation/test/Installation/CMakeLists.txt b/Installation/test/Installation/CMakeLists.txt new file mode 100644 index 00000000000..064b0ea9ed2 --- /dev/null +++ b/Installation/test/Installation/CMakeLists.txt @@ -0,0 +1,66 @@ +# Created by the script cgal_create_cmake_script +# This is the CMake script for compiling a CGAL application. + + +project( Installation_test ) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5) + +set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true) + +macro(create_link_to_program COMPONENT ) + + add_executable(link_to_${COMPONENT} link_to_${COMPONENT}.cpp ) + + include_directories ( ${${COMPONENT}_3RD_PARTY_INCLUDE_DIRS} ) + + add_definitions( ${${COMPONENT}_3RD_PARTY_DEFINITIONS} ) + + link_directories( ${${COMPONENT}_3RD_PARTY_LIBRARIES_DIRS}) + + # Link the executable to CGAL and third-party libraries + if ( AUTO_LINK_ENABLED ) + target_link_libraries(link_to_${COMPONENT} ${CGAL_3RD_PARTY_LIBRARIES} ${${COMPONENT}_3RD_PARTY_LIBRARIES} ) + else() + target_link_libraries(link_to_${COMPONENT} ${${COMPONENT}_LIBRARY} ${CGAL_3RD_PARTY_LIBRARIES} ${${COMPONENT}_3RD_PARTY_LIBRARIES} ) + endif() + +endmacro() + +find_package(CGAL QUIET) + +if ( CGAL_FOUND ) + + include( ${CGAL_USE_FILE} ) + + include( CreateSingleSourceCGALProgram ) + + create_single_source_cgal_program( "endian.cpp" ) + + create_link_to_program(CGAL) + + if ( WITH_CGAL_Core ) + create_link_to_program(CGAL_Core) + endif() + + if ( WITH_CGAL_ImageIO ) + create_link_to_program(CGAL_ImageIO) + endif() + + if ( WITH_CGAL_PDB ) + create_link_to_program(CGAL_PDB) + endif() + + if ( WITH_CGAL_Qt3 ) + create_link_to_program(CGAL_Qt3) + endif() + + if ( WITH_CGAL_Qt4 ) + create_link_to_program(CGAL_Qt4) + endif() + +else() + + message(STATUS "This program requires the CGAL library, and will not be compiled.") + +endif() diff --git a/Installation/test/Installation/link_to_CGAL.cpp b/Installation/test/Installation/link_to_CGAL.cpp new file mode 100644 index 00000000000..2ff3d11309a --- /dev/null +++ b/Installation/test/Installation/link_to_CGAL.cpp @@ -0,0 +1,10 @@ +// Use something defined not in headers but in the CGAL library to test that is was indeed properly built and linked to, + +#include + +int main() +{ + volatile const CGAL::Color* c = &CGAL::BLACK; + + return 0; +} diff --git a/Installation/test/Installation/link_to_CGAL_Core.cpp b/Installation/test/Installation/link_to_CGAL_Core.cpp new file mode 100644 index 00000000000..b1ba25df6e3 --- /dev/null +++ b/Installation/test/Installation/link_to_CGAL_Core.cpp @@ -0,0 +1,12 @@ +// Use something defined not in headers but in the CGAL library to test that is was indeed properly built and linked to, + +#include + +int main() +{ + CORE::BigFloat n(1.2); + + volatile double d = n.doubleValue(); + + return 0; +} diff --git a/Installation/test/Installation/link_to_CGAL_ImageIO.cpp b/Installation/test/Installation/link_to_CGAL_ImageIO.cpp new file mode 100644 index 00000000000..45845620c75 --- /dev/null +++ b/Installation/test/Installation/link_to_CGAL_ImageIO.cpp @@ -0,0 +1,11 @@ +// Use something defined not in headers but in the CGAL library to test that is was indeed properly built and linked to, + +#include + +int main() +{ + + volatile _image* i = _initImage(); + + return 0; +} diff --git a/Installation/test/Installation/link_to_CGAL_PDB.cpp b/Installation/test/Installation/link_to_CGAL_PDB.cpp new file mode 100644 index 00000000000..5abba41f1bf --- /dev/null +++ b/Installation/test/Installation/link_to_CGAL_PDB.cpp @@ -0,0 +1,12 @@ +// Use something defined not in headers but in the CGAL library to test that is was indeed properly built and linked to, + +#include + +int main() +{ + std::ifstream in(""); + + volatile CGAL::PDB::PDB pdb(in,false); + + return 0; +} diff --git a/Installation/test/Installation/link_to_CGAL_Qt3.cpp b/Installation/test/Installation/link_to_CGAL_Qt3.cpp new file mode 100644 index 00000000000..b9301da05e4 --- /dev/null +++ b/Installation/test/Installation/link_to_CGAL_Qt3.cpp @@ -0,0 +1,10 @@ +// Use something defined not in headers but in the CGAL library to test that is was indeed properly built and linked to, + +#include + +int main() +{ + volatile const char * xpm = alpha_shape_xpm[0] ; + + return 0; +} diff --git a/Installation/test/Installation/link_to_CGAL_Qt4.cpp b/Installation/test/Installation/link_to_CGAL_Qt4.cpp new file mode 100644 index 00000000000..0367e241d83 --- /dev/null +++ b/Installation/test/Installation/link_to_CGAL_Qt4.cpp @@ -0,0 +1,12 @@ +// Use something defined not in headers but in the CGAL library to test that is was indeed properly built and linked to, + +#include + +typedef QRectF (*mapToSceneFunction)(const QGraphicsView* , const QRect); + +int main() +{ + volatile mapToSceneFunction f = CGAL::Qt::mapToScene; + + return 0; +}