Fixed: Use CMake to identify directory containing test models

pull/594/head
Richard 2015-06-30 07:26:58 -06:00
parent 8b27163c20
commit 08169a6934
5 changed files with 13 additions and 11 deletions

View File

@ -54,6 +54,8 @@ add_executable( unit
${TEST_SRCS} ${TEST_SRCS}
) )
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 ) add_dependencies( unit gtest )

View File

@ -43,7 +43,7 @@ TEST_F(ColladaExportCamera, testExportCamera)
{ {
const char* file = "cameraExp.dae"; const char* file = "cameraExp.dae";
const aiScene* pTest = im->ReadFile("../test/models/Collada/cameras.dae",0); const aiScene* pTest = im->ReadFile(ASSIMP_TEST_MODELS_DIR "/Collada/cameras.dae",0);
ASSERT_TRUE(pTest!=NULL); ASSERT_TRUE(pTest!=NULL);
ASSERT_TRUE(pTest->HasCameras()); ASSERT_TRUE(pTest->HasCameras());

View File

@ -43,7 +43,7 @@ TEST_F(ColladaExportLight, testExportLight)
{ {
const char* file = "cameraExp.dae"; const char* file = "cameraExp.dae";
const aiScene* pTest = im->ReadFile("../test/models/Collada/lights.dae",0); const aiScene* pTest = im->ReadFile(ASSIMP_TEST_MODELS_DIR "/Collada/lights.dae",0);
ASSERT_TRUE(pTest!=NULL); ASSERT_TRUE(pTest!=NULL);
ASSERT_TRUE(pTest->HasLights()); ASSERT_TRUE(pTest->HasLights());

View File

@ -14,7 +14,7 @@ public:
ex = new Assimp::Exporter(); ex = new Assimp::Exporter();
im = new Assimp::Importer(); im = new Assimp::Importer();
pTest = im->ReadFile("../../test/models/X/test.x",0); pTest = im->ReadFile(ASSIMP_TEST_MODELS_DIR "/X/test.x",0);
} }
virtual void TearDown() virtual void TearDown()

View File

@ -219,13 +219,13 @@ TEST_F(ImporterTest, testMultipleReads)
aiProcess_OptimizeMeshes | aiProcess_OptimizeMeshes |
aiProcess_OptimizeGraph; aiProcess_OptimizeGraph;
EXPECT_TRUE(pImp->ReadFile("../test/models/X/test.x",flags)); EXPECT_TRUE(pImp->ReadFile(ASSIMP_TEST_MODELS_DIR "/X/test.x",flags));
//EXPECT_TRUE(pImp->ReadFile("../../test/models/X/dwarf.x",flags)); # is in nonbsd //EXPECT_TRUE(pImp->ReadFile(ASSIMP_TEST_MODELS_DIR "/X/dwarf.x",flags)); # is in nonbsd
EXPECT_TRUE(pImp->ReadFile("../test/models/X/Testwuson.X",flags)); EXPECT_TRUE(pImp->ReadFile(ASSIMP_TEST_MODELS_DIR "/X/Testwuson.X",flags));
EXPECT_TRUE(pImp->ReadFile("../test/models/X/anim_test.x",flags)); EXPECT_TRUE(pImp->ReadFile(ASSIMP_TEST_MODELS_DIR "/X/anim_test.x",flags));
//EXPECT_TRUE(pImp->ReadFile("../../test/models/X/dwarf.x",flags)); # is in nonbsd //EXPECT_TRUE(pImp->ReadFile(ASSIMP_TEST_MODELS_DIR "/X/dwarf.x",flags)); # is in nonbsd
EXPECT_TRUE(pImp->ReadFile("../test/models/X/anim_test.x",flags)); EXPECT_TRUE(pImp->ReadFile(ASSIMP_TEST_MODELS_DIR "/X/anim_test.x",flags));
EXPECT_TRUE(pImp->ReadFile("../test/models/X/BCN_Epileptic.X",flags)); EXPECT_TRUE(pImp->ReadFile(ASSIMP_TEST_MODELS_DIR "/X/BCN_Epileptic.X",flags));
//EXPECT_TRUE(pImp->ReadFile("../../test/models/X/dwarf.x",flags)); # is in nonbsd //EXPECT_TRUE(pImp->ReadFile(ASSIMP_TEST_MODELS_DIR "/X/dwarf.x",flags)); # is in nonbsd
} }