Initiating Hurricane Tests
This commit is contained in:
parent
78140e5feb
commit
42dfa164c7
|
@ -29,6 +29,10 @@ FIND_PACKAGE(Doxygen)
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(src)
|
ADD_SUBDIRECTORY(src)
|
||||||
ADD_SUBDIRECTORY(cmake_modules)
|
ADD_SUBDIRECTORY(cmake_modules)
|
||||||
|
ADD_SUBDIRECTORY(tests)
|
||||||
IF(DOXYGEN_FOUND)
|
IF(DOXYGEN_FOUND)
|
||||||
ADD_SUBDIRECTORY(doc)
|
ADD_SUBDIRECTORY(doc)
|
||||||
ENDIF(DOXYGEN_FOUND)
|
ENDIF(DOXYGEN_FOUND)
|
||||||
|
|
||||||
|
ENABLE_TESTING()
|
||||||
|
ADD_TEST(HurricaneTest ${PROJECT_BINARY_DIR}/tests/htest)
|
||||||
|
|
|
@ -162,3 +162,4 @@
|
||||||
|
|
||||||
install(FILES ${includes} DESTINATION /include/hurricane)
|
install(FILES ${includes} DESTINATION /include/hurricane)
|
||||||
|
|
||||||
|
add_subdirectory(tests)
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
INCLUDE_DIRECTORIES(${HURRICANE_SOURCE_DIR}/src/hurricane)
|
||||||
|
|
||||||
|
ADD_EXECUTABLE(htest HTest.cpp)
|
||||||
|
|
||||||
|
TARGET_LINK_LIBRARIES(htest hurricane)
|
|
@ -0,0 +1,40 @@
|
||||||
|
#include <iostream>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
#include "hurricane/DataBase.h"
|
||||||
|
#include "hurricane/Library.h"
|
||||||
|
using namespace Hurricane;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
DataBase* db = DataBase::create();
|
||||||
|
cout << "Testing DataBase creation" << endl;
|
||||||
|
if (!db) {
|
||||||
|
cout << "Error in DataBase creation" << endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
Library* rootLibrary = Library::create(db, Name("RootLibrary"));
|
||||||
|
if (!rootLibrary) {
|
||||||
|
cout << "Error in RootLibrary creation" << endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
Library* workLibrary = Library::create(rootLibrary, Name("WorkLibrary"));
|
||||||
|
if (!workLibrary) {
|
||||||
|
cout << "Error in WorkLibrary creation" << endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
workLibrary = rootLibrary->getLibrary(Name("WorkLibrary"));
|
||||||
|
if (!workLibrary) {
|
||||||
|
cout << "Error in Library->getLibrary(const Name& name)" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
workLibrary->destroy();
|
||||||
|
workLibrary = rootLibrary->getLibrary(Name("WorkLibrary"));
|
||||||
|
if (workLibrary) {
|
||||||
|
cout << "Error in Library destruction" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue