Skip to content
Snippets Groups Projects
Verified Commit 340d4e27 authored by Lars Bilke's avatar Lars Bilke
Browse files

[CMake] Enabled Unity builds for the testrunner.

NumLib tests are still not unity build.
parent 135dd2d5
No related branches found
No related tags found
No related merge requests found
...@@ -69,7 +69,7 @@ double Invariants<KelvinVectorSize>::trace( ...@@ -69,7 +69,7 @@ double Invariants<KelvinVectorSize>::trace(
// Initialization of static Invariant variables. // Initialization of static Invariant variables.
// //
namespace detail namespace KelvinVector_detail
{ {
template <int KelvinVectorSize> template <int KelvinVectorSize>
Eigen::Matrix<double, KelvinVectorSize, KelvinVectorSize> Eigen::Matrix<double, KelvinVectorSize, KelvinVectorSize>
...@@ -108,17 +108,17 @@ Eigen::Matrix<double, KelvinVectorSize, 1> initIdentity2() ...@@ -108,17 +108,17 @@ Eigen::Matrix<double, KelvinVectorSize, 1> initIdentity2()
template <int KelvinVectorSize> template <int KelvinVectorSize>
const Eigen::Matrix<double, KelvinVectorSize, KelvinVectorSize> const Eigen::Matrix<double, KelvinVectorSize, KelvinVectorSize>
Invariants<KelvinVectorSize>::deviatoric_projection = Invariants<KelvinVectorSize>::deviatoric_projection =
detail::initDeviatoricProjection<KelvinVectorSize>(); KelvinVector_detail::initDeviatoricProjection<KelvinVectorSize>();
template <int KelvinVectorSize> template <int KelvinVectorSize>
Eigen::Matrix<double, KelvinVectorSize, KelvinVectorSize> const Eigen::Matrix<double, KelvinVectorSize, KelvinVectorSize> const
Invariants<KelvinVectorSize>::spherical_projection = Invariants<KelvinVectorSize>::spherical_projection =
detail::initSphericalProjection<KelvinVectorSize>(); KelvinVector_detail::initSphericalProjection<KelvinVectorSize>();
template <int KelvinVectorSize> template <int KelvinVectorSize>
const Eigen::Matrix<double, KelvinVectorSize, 1> const Eigen::Matrix<double, KelvinVectorSize, 1>
Invariants<KelvinVectorSize>::identity2 = Invariants<KelvinVectorSize>::identity2 =
detail::initIdentity2<KelvinVectorSize>(); KelvinVector_detail::initIdentity2<KelvinVectorSize>();
} // namespace KelvinVector } // namespace KelvinVector
} // namespace MathLib } // namespace MathLib
...@@ -15,7 +15,11 @@ append_source_files(TEST_SOURCES MaterialLib) ...@@ -15,7 +15,11 @@ append_source_files(TEST_SOURCES MaterialLib)
append_source_files(TEST_SOURCES MathLib) append_source_files(TEST_SOURCES MathLib)
append_source_files(TEST_SOURCES MeshLib) append_source_files(TEST_SOURCES MeshLib)
append_source_files(TEST_SOURCES MeshGeoToolsLib) append_source_files(TEST_SOURCES MeshGeoToolsLib)
append_source_files(TEST_SOURCES NumLib) append_source_files(TEST_SOURCES_NUMLIB NumLib)
# Disable Unity build for NumLib tests
set_source_files_properties(${TEST_SOURCES_NUMLIB} PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
# Keep order of source files, otherwise PETSc non-MPI tests fail
set(TEST_SOURCES ${TEST_SOURCES} ${TEST_SOURCES_NUMLIB})
append_source_files(TEST_SOURCES ParameterLib) append_source_files(TEST_SOURCES ParameterLib)
append_source_files(TEST_SOURCES ProcessLib) append_source_files(TEST_SOURCES ProcessLib)
......
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
#include "BaseLib/ConfigTree.h" #include "BaseLib/ConfigTree.h"
#include "MathLib/ODE/ODESolverBuilder.h" #include "MathLib/ODE/ODESolverBuilder.h"
namespace TestODESolver {
const double abs_tol = 1e-8; const double abs_tol = 1e-8;
const double rel_tol = 1e-8; const double rel_tol = 1e-8;
...@@ -315,3 +317,5 @@ TEST(MathLibCVodeTest, ExponentialWithJacobianNewton) ...@@ -315,3 +317,5 @@ TEST(MathLibCVodeTest, ExponentialWithJacobianNewton)
check(time_reached, y[0], y_dot[0], time, y_ana, y_dot_ana); check(time_reached, y[0], y_dot[0], time, y_ana, y_dot_ana);
} }
} }
} // end namespace
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#include "TimeLoopSingleODE.h" #include "TimeLoopSingleODE.h"
namespace TestODEInt {
#ifndef USE_PETSC #ifndef USE_PETSC
std::unique_ptr<GlobalLinearSolver> std::unique_ptr<GlobalLinearSolver>
createLinearSolver() createLinearSolver()
...@@ -298,3 +300,5 @@ TYPED_TEST(NumLibODEIntTyped, DISABLED_T1) ...@@ -298,3 +300,5 @@ TYPED_TEST(NumLibODEIntTyped, DISABLED_T1)
* * check that the order of time discretization scales correctly * * check that the order of time discretization scales correctly
* with the timestep size * with the timestep size
*/ */
} // end namespace
...@@ -10,7 +10,5 @@ set_target_properties(MeshLib PROPERTIES UNITY_BUILD_BATCH_SIZE 20) ...@@ -10,7 +10,5 @@ set_target_properties(MeshLib PROPERTIES UNITY_BUILD_BATCH_SIZE 20)
# set_target_properties(ProcessLib PROPERTIES UNITY_BUILD_BATCH_SIZE 80) # breaks! # set_target_properties(ProcessLib PROPERTIES UNITY_BUILD_BATCH_SIZE 80) # breaks!
if(TARGET testrunner) if(TARGET testrunner)
# breaks! set_target_properties(testrunner PROPERTIES UNITY_BUILD ON)
# set_target_properties(testrunner PROPERTIES UNITY_BUILD ON)
# set_target_properties(testrunner PROPERTIES UNITY_BUILD_BATCH_SIZE 2)
endif() endif()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment