Commit 063f53f8 authored by Praetorius, Simon's avatar Praetorius, Simon

test CMakeLists.txt adopted to current AMDiSConfig.cmake and cmake 2.8.10

parent 09a8e7a8
project("AMDiS test suite") project("AMDiS test suite")
cmake_minimum_required(VERSION 3.0) cmake_minimum_required(VERSION 2.8.10)
find_package(AMDIS REQUIRED) find_package(AMDIS REQUIRED ${COMPONENT})
add_library(amdis INTERFACE) include_directories(${AMDIS_INCLUDE_DIRS})
if (AMDIS_INCLUDE_DIRS) add_definitions(${AMDIS_COMPILEFLAGS})
target_include_directories(amdis INTERFACE ${AMDIS_INCLUDE_DIRS})
endif (AMDIS_INCLUDE_DIRS)
if (AMDIS_COMPILEFLAGS)
target_compile_options(amdis INTERFACE ${AMDIS_COMPILEFLAGS})
endif (AMDIS_COMPILEFLAGS)
target_link_libraries(amdis INTERFACE ${AMDIS_LIBRARIES})
enable_testing() enable_testing()
......
...@@ -5,7 +5,7 @@ foreach(s ${sources}) ...@@ -5,7 +5,7 @@ foreach(s ${sources})
get_filename_component(swe ${s} NAME_WE) get_filename_component(swe ${s} NAME_WE)
add_executable(${swe} ${s}) add_executable(${swe} ${s})
target_link_libraries(${swe} amdis ${Boost_LIBRARIES}) target_link_libraries(${swe} ${AMDIS_LIBRARIES} ${Boost_LIBRARIES})
list(APPEND TEST_DEPENDENCIES ${swe}) list(APPEND TEST_DEPENDENCIES ${swe})
endforeach(s) endforeach(s)
......
...@@ -8,7 +8,7 @@ endif () ...@@ -8,7 +8,7 @@ endif ()
add_executable(test_expr src/Test_Expressions.cc) add_executable(test_expr src/Test_Expressions.cc)
target_link_libraries(test_expr amdis) target_link_libraries(test_expr ${AMDIS_LIBRARIES})
if (NOT AMDIS_HAS_PARALLEL_DOMAIN) if (NOT AMDIS_HAS_PARALLEL_DOMAIN)
add_test(NAME RunTestExpr_1d WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND test_expr init/test_expr.dat.1d) add_test(NAME RunTestExpr_1d WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND test_expr init/test_expr.dat.1d)
endif () endif ()
...@@ -18,7 +18,7 @@ list(APPEND TEST_DEPENDENCIES test_expr) ...@@ -18,7 +18,7 @@ list(APPEND TEST_DEPENDENCIES test_expr)
add_executable(test_basis src/Test_BasisFunction.cc) add_executable(test_basis src/Test_BasisFunction.cc)
target_link_libraries(test_basis amdis) target_link_libraries(test_basis ${AMDIS_LIBRARIES})
if (NOT AMDIS_HAS_PARALLEL_DOMAIN) if (NOT AMDIS_HAS_PARALLEL_DOMAIN)
add_test(NAME RunTestBasis_1d WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND test_basis init/test_basisFct.dat.1d) add_test(NAME RunTestBasis_1d WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND test_basis init/test_basisFct.dat.1d)
endif () endif ()
...@@ -28,20 +28,20 @@ list(APPEND TEST_DEPENDENCIES test_basis) ...@@ -28,20 +28,20 @@ list(APPEND TEST_DEPENDENCIES test_basis)
add_executable(test_writer src/Test_Writer.cc) add_executable(test_writer src/Test_Writer.cc)
target_link_libraries(test_writer amdis) target_link_libraries(test_writer ${AMDIS_LIBRARIES})
list(APPEND TEST_DEPENDENCIES test_writer) list(APPEND TEST_DEPENDENCIES test_writer)
add_executable(test_arh3 src/Test_Arh3.cc) add_executable(test_arh3 src/Test_Arh3.cc)
target_link_libraries(test_arh3 amdis) target_link_libraries(test_arh3 ${AMDIS_LIBRARIES})
list(APPEND TEST_DEPENDENCIES test_arh3) list(APPEND TEST_DEPENDENCIES test_arh3)
add_executable(test_mat_vec src/Test_MatrixVectorOperations.cc) add_executable(test_mat_vec src/Test_MatrixVectorOperations.cc)
target_link_libraries(test_mat_vec amdis) target_link_libraries(test_mat_vec ${AMDIS_LIBRARIES})
list(APPEND TEST_DEPENDENCIES test_mat_vec) list(APPEND TEST_DEPENDENCIES test_mat_vec)
add_executable(test_problemStat src/Test_ProblemStat.cc) add_executable(test_problemStat src/Test_ProblemStat.cc)
target_link_libraries(test_problemStat amdis) target_link_libraries(test_problemStat ${AMDIS_LIBRARIES})
if (NOT AMDIS_HAS_PARALLEL_DOMAIN) if (NOT AMDIS_HAS_PARALLEL_DOMAIN)
add_test(NAME RunTestProblemStat_1d WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND test_problemStat init/test_problemStat.dat.1d) add_test(NAME RunTestProblemStat_1d WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND test_problemStat init/test_problemStat.dat.1d)
add_test(NAME RunTestProblemStat_2d WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND test_problemStat init/test_problemStat.dat.2d) add_test(NAME RunTestProblemStat_2d WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND test_problemStat init/test_problemStat.dat.2d)
...@@ -53,7 +53,7 @@ list(APPEND TEST_DEPENDENCIES test_problemStat) ...@@ -53,7 +53,7 @@ list(APPEND TEST_DEPENDENCIES test_problemStat)
# parallel tests # parallel tests
if (AMDIS_HAS_PARALLEL_DOMAIN) if (AMDIS_HAS_PARALLEL_DOMAIN)
add_executable(test_synch src/Test_Synch.cc) add_executable(test_synch src/Test_Synch.cc)
target_link_libraries(test_synch amdis) target_link_libraries(test_synch ${AMDIS_LIBRARIES})
add_test(NAME RunTestSynch_2d WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND test_synch init/test_synch.dat.2d) add_test(NAME RunTestSynch_2d WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND test_synch init/test_synch.dat.2d)
add_test(NAME RunTestSynch_3d WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND test_synch init/test_synch.dat.3d) add_test(NAME RunTestSynch_3d WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND test_synch init/test_synch.dat.3d)
list(APPEND TEST_DEPENDENCIES test_synch) list(APPEND TEST_DEPENDENCIES test_synch)
...@@ -63,17 +63,17 @@ endif (AMDIS_HAS_PARALLEL_DOMAIN) ...@@ -63,17 +63,17 @@ endif (AMDIS_HAS_PARALLEL_DOMAIN)
# tests if AMDiS-Extensions # tests if AMDiS-Extensions
if (AMDIS_NEED_EXTENSIONS) if (AMDIS_NEED_EXTENSIONS)
add_executable(test_bg_mesh src/Test_BackgroundMesh2.cc) add_executable(test_bg_mesh src/Test_BackgroundMesh2.cc)
target_link_libraries(test_bg_mesh amdis) target_link_libraries(test_bg_mesh ${AMDIS_LIBRARIES})
add_test(NAME RunTestBgMesh WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND test_bg_mesh init/test_bg_mesh.dat) add_test(NAME RunTestBgMesh WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND test_bg_mesh init/test_bg_mesh.dat)
list(APPEND TEST_DEPENDENCIES test_bg_mesh) list(APPEND TEST_DEPENDENCIES test_bg_mesh)
add_executable(test_views src/Test_Views.cc) add_executable(test_views src/Test_Views.cc)
target_link_libraries(test_views amdis) target_link_libraries(test_views ${AMDIS_LIBRARIES})
add_test(NAME RunTestViews_2d WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND test_views init/test_views.dat.2d) add_test(NAME RunTestViews_2d WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND test_views init/test_views.dat.2d)
list(APPEND TEST_DEPENDENCIES test_views) list(APPEND TEST_DEPENDENCIES test_views)
add_executable(test_vtk src/Test_Vtk.cc) add_executable(test_vtk src/Test_Vtk.cc)
target_link_libraries(test_vtk amdis) target_link_libraries(test_vtk ${AMDIS_LIBRARIES})
list(APPEND TEST_DEPENDENCIES test_vtk) list(APPEND TEST_DEPENDENCIES test_vtk)
endif (AMDIS_NEED_EXTENSIONS) endif (AMDIS_NEED_EXTENSIONS)
......
add_executable(test0001 src/test0001.cc) add_executable(test0001 src/test0001.cc)
target_link_libraries(test0001 amdis ${Boost_LIBRARIES}) target_link_libraries(test0001 ${AMDIS_LIBRARIES} ${Boost_LIBRARIES})
add_test(NAME RunTest0001 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND test0001 test0001.dat.2d) add_test(NAME RunTest0001 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND test0001 ./init/test0001.dat.2d)
add_dependencies(check test0001) add_dependencies(check test0001)
......
...@@ -9,7 +9,7 @@ ellipt->components: 1 ...@@ -9,7 +9,7 @@ ellipt->components: 1
ellipt->polynomial degree[0]: 1 ellipt->polynomial degree[0]: 1
ellipt->solver: cg ellipt->solver: cg
ellipt->solver->max iteration: 10 ellipt->solver->max iteration: 100
ellipt->solver->tolerance: 1.e-8 ellipt->solver->tolerance: 1.e-8
ellipt->solver->info: 10 ellipt->solver->info: 10
ellipt->solver->left precon: diag ellipt->solver->left precon: diag
......
#define BOOST_TEST_DYN_LINK #include <cassert>
#define BOOST_TEST_MODULE 0001
#include <boost/test/unit_test.hpp>
#include <AMDiS.h> #include <AMDiS.h>
using namespace AMDiS; using namespace AMDiS;
BOOST_AUTO_TEST_CASE(blub) int main(int argc, char** argv)
{ {
FUNCNAME("main"); AMDiS::init(argc, argv);
AMDiS::init("./init/test0001.dat.2d");
// ===== create and init the scalar problem ===== // ===== create and init the scalar problem =====
ProblemStat ellipt("ellipt"); ProblemStat ellipt("ellipt");
...@@ -19,7 +14,7 @@ BOOST_AUTO_TEST_CASE(blub) ...@@ -19,7 +14,7 @@ BOOST_AUTO_TEST_CASE(blub)
// === create adapt info === // === create adapt info ===
AdaptInfo adaptInfo("ellipt->adapt", ellipt.getNumComponents()); AdaptInfo adaptInfo("ellipt->adapt", ellipt.getNumComponents());
BOOST_REQUIRE(ellipt.getNumComponents() == 1); assert(ellipt.getNumComponents() == 1);
// === create adapt === // === create adapt ===
AdaptStationary adapt("ellipt->adapt", ellipt, adaptInfo); AdaptStationary adapt("ellipt->adapt", ellipt, adaptInfo);
...@@ -37,9 +32,7 @@ BOOST_AUTO_TEST_CASE(blub) ...@@ -37,9 +32,7 @@ BOOST_AUTO_TEST_CASE(blub)
// ===== start adaption loop ===== // ===== start adaption loop =====
adapt.adapt(); adapt.adapt();
BOOST_REQUIRE(ellipt.getFeSpace()->getAdmin()->getUsedSize() == 81); assert(ellipt.getFeSpace()->getAdmin()->getUsedSize() == 81);
AMDiS::finalize(); AMDiS::finalize();
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment