fix unittests on linux / enable on travis-ci

pull/333/head
abma 2014-08-18 00:34:45 +02:00
parent b2643a3835
commit d795491c48
8 changed files with 27 additions and 26 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

@ -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"));
// ............................................................................ // ............................................................................
@ -66,4 +65,4 @@ int main (int argc, char* argv[])
// Rueckmeldung, ob Tests erfolgreich waren // Rueckmeldung, ob Tests erfolgreich waren
return collectedresults.wasSuccessful () ? 0 : 1; return collectedresults.wasSuccessful () ? 0 : 1;
} }

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;
@ -34,4 +34,4 @@ class NoBoostTest : public CPPUNIT_NS :: TestFixture
}; };
#endif #endif