Browse Source

Unittests: add test if export is disabled.

Kim Kulling 9 years ago
parent
commit
51c9a9f80c
2 changed files with 18 additions and 14 deletions
  1. 13 13
      test/CMakeLists.txt
  2. 5 1
      test/unit/utIssues.cpp

+ 13 - 13
test/CMakeLists.txt

@@ -50,21 +50,21 @@ SET( TEST_SRCS
 SOURCE_GROUP( tests FILES  ${TEST_SRCS} )
 
 if(AddGTest_FOUND)
-add_executable( unit
-  unit/CCompilerTest.c
-  unit/Main.cpp
-  ../code/Version.cpp
-  ${TEST_SRCS}
-)
+    add_executable( unit
+      unit/CCompilerTest.c
+      unit/Main.cpp
+      ../code/Version.cpp
+      ${TEST_SRCS}
+    )
 
-add_definitions(-DASSIMP_TEST_MODELS_DIR="${CMAKE_CURRENT_LIST_DIR}/models")
+    add_definitions(-DASSIMP_TEST_MODELS_DIR="${CMAKE_CURRENT_LIST_DIR}/models")
 
-SET_PROPERTY( TARGET assimp PROPERTY DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX} )
+    SET_PROPERTY( TARGET assimp PROPERTY DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX} )
 
-add_dependencies( unit gtest )
-target_link_libraries( unit assimp
-  debug ${GTEST_DEBUG_LIBRARIES}
-  optimized ${GTEST_RELEASE_LIBRARIES}
-)
+    add_dependencies( unit gtest )
+    target_link_libraries( unit assimp
+      debug ${GTEST_DEBUG_LIBRARIES}
+      optimized ${GTEST_RELEASE_LIBRARIES}
+    )
 endif(AddGTest_FOUND)
 add_subdirectory(headercheck)

+ 5 - 1
test/unit/utIssues.cpp

@@ -3,7 +3,7 @@
 Open Asset Import Library (assimp)
 ---------------------------------------------------------------------------
 
-Copyright (c) 2006-2014, assimp team
+Copyright (c) 2006-2016, assimp team
 
 All rights reserved.
 
@@ -50,6 +50,8 @@ class utIssues : public ::testing::Test {
 
 };
 
+#ifndef ASSIMP_BUILD_NO_EXPORT
+
 TEST_F( utIssues, OpacityBugWhenExporting_727 ) {
     aiScene *scene( new aiScene );
 
@@ -103,3 +105,5 @@ TEST_F( utIssues, OpacityBugWhenExporting_727 ) {
         }*/
     }
 }
+
+#endif // ASSIMP_BUILD_NO_EXPORT