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:
- sudo apt-get install cmake
- sudo apt-get install cmake libcppunit-dev
env:
- TRAVIS_NO_EXPORT=YES
@ -13,7 +13,9 @@ compiler:
- gcc
- 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/ )
ENDIF ( ASSIMP_BUILD_SAMPLES )
IF ( WIN32 )
option ( ASSIMP_BUILD_TESTS
"If the test suite for Assimp is built in addition to the library."
ON
)
option ( ASSIMP_BUILD_TESTS
"If the test suite for Assimp is built in addition to the library."
ON
)
IF ( ASSIMP_BUILD_TESTS )
ADD_SUBDIRECTORY( test/ )
ENDIF ( ASSIMP_BUILD_TESTS )
ENDIF ( WIN32 )
IF ( ASSIMP_BUILD_TESTS )
ADD_SUBDIRECTORY( test/ )
ENDIF ( ASSIMP_BUILD_TESTS )
IF(MSVC)
option ( ASSIMP_INSTALL_PDB

View File

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

View File

@ -59,7 +59,7 @@ class JoinVerticesTest;
* 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.
*/
class ASSIMP_API_WINONLY JoinVerticesProcess : public BaseProcess
class ASSIMP_API JoinVerticesProcess : public BaseProcess
{
public:

View File

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

View File

@ -15,7 +15,7 @@ SOURCE_GROUP( unit FILES
unit/BoostWorkaround/tupletest.cpp
)
if(WIN32)
SET( CPPUNIT_SRCS
../contrib/cppunit-1.12.1/src/cppunit/AdditionalMessage.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
)
SOURCE_GROUP(cppunit FILES ${CPPUNIT_SRCS})
else()
find_library(CPPUNIT_LIBRARY cppunit)
endif()
SET( TEST_SRCS
unit/utFindDegenerates.cpp
@ -133,4 +135,4 @@ add_executable( unit
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
aiEnableVerboseLogging(AI_TRUE);
aiAttachLogStream(&aiGetPredefinedLogStream(
aiDefaultLogStream_FILE,
"AssimpLog_C.txt"));
aiLogStream logstream= aiGetPredefinedLogStream(aiDefaultLogStream_FILE, "AssimpLog_C.txt");
aiAttachLogStream(&logstream);
// ............................................................................

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/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/dwarf.x",flags)); # is in nonbsd
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
}

View File

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

View File

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