Skip to content
Snippets Groups Projects
Commit 2305e9aa authored by Riccardo Maria Bianchi's avatar Riccardo Maria Bianchi :sunny:
Browse files

enable test target in CMake and start adding tests

parent 45e80d7d
No related branches found
No related tags found
No related merge requests found
Pipeline #1229134 failed
......@@ -15,7 +15,7 @@ set( CMAKE_CXX_STANDARD_REQUIRED TRUE CACHE BOOL
list( APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake )
# Project's dependencies.
find_package( GeoModelCore REQUIRED )
find_package( GeoModelCore 2.0.0 REQUIRED )
find_package( Qt5 COMPONENTS Core Sql REQUIRED )
# Use the GNU install directory names.
......
......@@ -39,3 +39,7 @@ install( TARGETS GeoModelDBManager
install( FILES ${HEADERS}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/GeoModelDBManager
COMPONENT Development )
# Set up tests using CTest.
enable_testing()
add_subdirectory( tests )
ADD_EXECUTABLE( test_io_geomaterial test_io_geomaterial.cxx )
ADD_TEST( io_geomaterial test_io_geomaterial )
// #include <tests/Base.hh>
void testBasic()
{
// do some nice calculation; store the results in `foo` and `bar`,
// respectively
ALEPH_ASSERT_THROW( foo != bar );
ALEPH_ASSERT_EQUAL( foo, 2.0 );
ALEPH_ASSERT_EQUAL( bar, 1.0 );
}
void testAdvanced()
{
// a more advanced test
}
int main(int, char**)
{
testBasic();
testAdvanced();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment