Merge pull request #333 from abma/master

fix unittests on linux / enable on travis-ci
pull/344/head
Alexander Gessler 2014-08-17 16:01:55 -07:00
commit 81cfaccedb
10 changed files with 33 additions and 28 deletions

View File

@ -1,5 +1,5 @@
before_install: before_install:
- sudo apt-get install cmake - sudo apt-get install cmake libcppunit-dev
env: env:
- TRAVIS_NO_EXPORT=YES - TRAVIS_NO_EXPORT=YES
@ -13,7 +13,9 @@ compiler:
- gcc - gcc
- clang - clang
script: cmake -G "Unix Makefiles" -DASSIMP_ENABLE_BOOST_WORKAROUND=YES -DASSIMP_NO_EXPORT=$TRAVIS_NO_EXPORT -STATIC_BUILD=$TRAVIS_STATIC_BUILD && make script:
- cmake -G "Unix Makefiles" -DASSIMP_ENABLE_BOOST_WORKAROUND=YES -DASSIMP_NO_EXPORT=$TRAVIS_NO_EXPORT -STATIC_BUILD=$TRAVIS_STATIC_BUILD
- make
- cd test/unit
- ../../bin/unit

View File

@ -210,16 +210,14 @@ IF ( ASSIMP_BUILD_SAMPLES)
ADD_SUBDIRECTORY( samples/SimpleOpenGL/ ) ADD_SUBDIRECTORY( samples/SimpleOpenGL/ )
ENDIF ( ASSIMP_BUILD_SAMPLES ) ENDIF ( ASSIMP_BUILD_SAMPLES )
IF ( WIN32 ) option ( ASSIMP_BUILD_TESTS
option ( ASSIMP_BUILD_TESTS "If the test suite for Assimp is built in addition to the library."
"If the test suite for Assimp is built in addition to the library." ON
ON )
)
IF ( ASSIMP_BUILD_TESTS ) IF ( ASSIMP_BUILD_TESTS )
ADD_SUBDIRECTORY( test/ ) ADD_SUBDIRECTORY( test/ )
ENDIF ( ASSIMP_BUILD_TESTS ) ENDIF ( ASSIMP_BUILD_TESTS )
ENDIF ( WIN32 )
IF(MSVC) IF(MSVC)
option ( ASSIMP_INSTALL_PDB option ( ASSIMP_INSTALL_PDB

View File

@ -53,7 +53,7 @@ namespace Assimp {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
/** The GenFaceNormalsProcess computes vertex normals for all vertizes /** The GenFaceNormalsProcess computes vertex normals for all vertizes
*/ */
class ASSIMP_API_WINONLY GenVertexNormalsProcess : public BaseProcess class ASSIMP_API GenVertexNormalsProcess : public BaseProcess
{ {
public: public:

View File

@ -59,7 +59,7 @@ class JoinVerticesTest;
* erases all but one of the copies. This usually reduces the number of vertices * erases all but one of the copies. This usually reduces the number of vertices
* in a mesh by a serious amount and is the standard form to render a mesh. * in a mesh by a serious amount and is the standard form to render a mesh.
*/ */
class ASSIMP_API_WINONLY JoinVerticesProcess : public BaseProcess class ASSIMP_API JoinVerticesProcess : public BaseProcess
{ {
public: public:

View File

@ -306,6 +306,7 @@ enum MeshChunkId
// float extremes [n_extremes][3]; // float extremes [n_extremes][3];
}; };
/*
static std::string MeshHeaderToString(MeshChunkId id) static std::string MeshHeaderToString(MeshChunkId id)
{ {
switch(id) switch(id)
@ -347,6 +348,7 @@ static std::string MeshHeaderToString(MeshChunkId id)
} }
return "Unknown_MeshChunkId"; return "Unknown_MeshChunkId";
} }
*/
enum SkeletonChunkId enum SkeletonChunkId
{ {
@ -393,6 +395,7 @@ enum SkeletonChunkId
// float scale : scale to apply to trans/scale keys // float scale : scale to apply to trans/scale keys
}; };
/*
static std::string SkeletonHeaderToString(SkeletonChunkId id) static std::string SkeletonHeaderToString(SkeletonChunkId id)
{ {
switch(id) switch(id)
@ -409,6 +412,7 @@ static std::string SkeletonHeaderToString(SkeletonChunkId id)
} }
return "Unknown_SkeletonChunkId"; return "Unknown_SkeletonChunkId";
} }
*/
} // Ogre } // Ogre
} // Assimp } // Assimp

View File

@ -15,7 +15,7 @@ SOURCE_GROUP( unit FILES
unit/BoostWorkaround/tupletest.cpp unit/BoostWorkaround/tupletest.cpp
) )
if(WIN32)
SET( CPPUNIT_SRCS SET( CPPUNIT_SRCS
../contrib/cppunit-1.12.1/src/cppunit/AdditionalMessage.cpp ../contrib/cppunit-1.12.1/src/cppunit/AdditionalMessage.cpp
../contrib/cppunit-1.12.1/src/cppunit/Asserter.cpp ../contrib/cppunit-1.12.1/src/cppunit/Asserter.cpp
@ -72,7 +72,9 @@ SET( CPPUNIT_SRCS
../contrib/cppunit-1.12.1/src/cppunit/XmlOutputterHook.cpp ../contrib/cppunit-1.12.1/src/cppunit/XmlOutputterHook.cpp
) )
SOURCE_GROUP(cppunit FILES ${CPPUNIT_SRCS}) SOURCE_GROUP(cppunit FILES ${CPPUNIT_SRCS})
else()
find_library(CPPUNIT_LIBRARY cppunit)
endif()
SET( TEST_SRCS SET( TEST_SRCS
unit/utFindDegenerates.cpp unit/utFindDegenerates.cpp
@ -133,4 +135,4 @@ add_executable( unit
SET_PROPERTY(TARGET assimp PROPERTY DEBUG_POSTFIX ${ASSIMP_DEBUG_POSTFIX}) SET_PROPERTY(TARGET assimp PROPERTY DEBUG_POSTFIX ${ASSIMP_DEBUG_POSTFIX})
target_link_libraries ( unit assimp ) target_link_libraries ( unit assimp ${CPPUNIT_LIBRARY} )

View File

@ -26,9 +26,8 @@ int main (int argc, char* argv[])
// .. and C. They should smoothly work together // .. and C. They should smoothly work together
aiEnableVerboseLogging(AI_TRUE); aiEnableVerboseLogging(AI_TRUE);
aiAttachLogStream(&aiGetPredefinedLogStream( aiLogStream logstream= aiGetPredefinedLogStream(aiDefaultLogStream_FILE, "AssimpLog_C.txt");
aiDefaultLogStream_FILE, aiAttachLogStream(&logstream);
"AssimpLog_C.txt"));
// ............................................................................ // ............................................................................

View File

@ -208,11 +208,11 @@ void ImporterTest :: testMultipleReads (void)
CPPUNIT_ASSERT(pImp->ReadFile("../../test/models/X/test.x",flags)); CPPUNIT_ASSERT(pImp->ReadFile("../../test/models/X/test.x",flags));
//CPPUNIT_ASSERT(pImp->ReadFile("../../test/models/X/dwarf.x",flags)); # is in nonbsd //CPPUNIT_ASSERT(pImp->ReadFile("../../test/models/X/dwarf.x",flags)); # is in nonbsd
CPPUNIT_ASSERT(pImp->ReadFile("../../test/models/X/Testwuson.x",flags)); CPPUNIT_ASSERT(pImp->ReadFile("../../test/models/X/Testwuson.X",flags));
CPPUNIT_ASSERT(pImp->ReadFile("../../test/models/X/anim_test.x",flags)); CPPUNIT_ASSERT(pImp->ReadFile("../../test/models/X/anim_test.x",flags));
//CPPUNIT_ASSERT(pImp->ReadFile("../../test/models/X/dwarf.x",flags)); # is in nonbsd //CPPUNIT_ASSERT(pImp->ReadFile("../../test/models/X/dwarf.x",flags)); # is in nonbsd
CPPUNIT_ASSERT(pImp->ReadFile("../../test/models/X/anim_test.x",flags)); CPPUNIT_ASSERT(pImp->ReadFile("../../test/models/X/anim_test.x",flags));
CPPUNIT_ASSERT(pImp->ReadFile("../../test/models/X/bcn_epileptic.x",flags)); CPPUNIT_ASSERT(pImp->ReadFile("../../test/models/X/BCN_Epileptic.X",flags));
//CPPUNIT_ASSERT(pImp->ReadFile("../../test/models/X/dwarf.x",flags)); # is in nonbsd //CPPUNIT_ASSERT(pImp->ReadFile("../../test/models/X/dwarf.x",flags)); # is in nonbsd
} }

View File

@ -4,7 +4,7 @@
namespace noboost { namespace noboost {
#define ASSIMP_FORCE_NOBOOST #define ASSIMP_FORCE_NOBOOST
#include "..\..\code\BoostWorkaround\boost\format.hpp" #include "../../code/BoostWorkaround/boost/format.hpp"
using boost::format; using boost::format;
using boost::str; using boost::str;

View File

@ -43,7 +43,7 @@ void RemoveCommentsTest :: testSingleLineComments (void)
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
void RemoveCommentsTest :: testMultiLineComments (void) void RemoveCommentsTest :: testMultiLineComments (void)
{ {
char* szTest = const char* szTest =
"/* comment to be removed */\n" "/* comment to be removed */\n"
"valid text /* \n " "valid text /* \n "
" comment across multiple lines */" " comment across multiple lines */"