Commit f6af86e2 authored by jannick.wolters's avatar jannick.wolters
Browse files

removed some cout's; added better CTest integration

parent e86cb64b
......@@ -12,7 +12,7 @@ set( KITRT_DEBUG_OPTIONS -Wall -Wextra -Wpedantic )
### LIBRARIES ###################################
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
find_package( OpenMP REQUIRED )
......@@ -82,6 +82,8 @@ target_compile_options( ${CMAKE_PROJECT_NAME} PUBLIC "$<$<CONFIG:RELEASE>:${KITR
### BUILD UNIT TESTS ############################
include( CTest )
set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/ext/Catch2/contrib ${CMAKE_MODULE_PATH} )
include( Catch )
set( CATCH_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/ext/Catch2/single_include/catch2 )
add_compile_definitions( BUILD_TESTING )
add_compile_definitions( TESTS_PATH="${CMAKE_SOURCE_DIR}/tests/" )
......@@ -99,6 +101,6 @@ if( CMAKE_COMPILER_IS_GNUCXX )
endif()
target_compile_options( unit_tests PUBLIC "$<$<CONFIG:RELWITHDEBINFO>:${KITRT_RELWITHDEBINFO_OPTIONS}>" )
target_compile_options( unit_tests PUBLIC "$<$<CONFIG:RELEASE>:${KITRT_RELEASE_OPTIONS}>" )
add_test( NAME unit_tests COMMAND unit_tests )
catch_discover_tests( unit_tests )
enable_testing()
#################################################
......@@ -257,7 +257,6 @@ void ICRU::ELINIT( std::vector<double> IZ, std::vector<double> STF ) {
void ICRU::DCSEL0( double E ) {
if( E < 49.9999e0 || E > 1.0001e8 ) {
std::cout << "Energy " << E << std::endl;
ErrorMessages::Error( "Outside of supported energy range", CURRENT_FUNCTION );
}
double EL = std::log( E );
......
......@@ -97,7 +97,7 @@ void MLOptimizer::initialize_python() {
PyRun_SimpleString( ( "import sys\nsys.path.append('" + pyPath + "')" ).c_str() );
}
std::cout << "Python working directory is: " << pyPath << " \n";
// std::cout << "Python working directory is: " << pyPath << " \n";
init_numpy();
}
......
......@@ -21,12 +21,11 @@ VectorVector MuscleBoneLung::SetupIC() {
return psi;
}
std::vector<double> MuscleBoneLung::GetDensity( const VectorVector& cellMidPoints ) {
std::cout<<"Length of mesh "<< cellMidPoints.size() << std::endl;
std::vector<double> densities ( 167, 1.04 ); //muscle layer
std::vector<double> bone( 167, 1.85 );
std::vector<double> lung ( 665, 0.3 ); //maybe this is just the lung tissue and after that there should be air?
densities.insert(densities.end(),bone.begin(),bone.end());
densities.insert(densities.end(),lung.begin(),lung.end());
std::cout<<"Length of densities "<< densities.size() << std::endl;
return densities; }
std::vector<double> MuscleBoneLung::GetDensity( const VectorVector& cellMidPoints ) {
std::vector<double> densities( 167, 1.04 ); // muscle layer
std::vector<double> bone( 167, 1.85 );
std::vector<double> lung( 665, 0.3 ); // maybe this is just the lung tissue and after that there should be air?
densities.insert( densities.end(), bone.begin(), bone.end() );
densities.insert( densities.end(), lung.begin(), lung.end() );
return densities;
}
......@@ -13,7 +13,6 @@ int main( int argc, char** argv ) {
const int result = Catch::Session().run( argc, argv );
if( Py_IsInitialized() ) Py_Finalize();
std::cout << std::string( TESTS_PATH ) + "result" << std::endl;
std::filesystem::remove_all( std::string( TESTS_PATH ) + "result" );
MPI_Finalize();
......
......@@ -50,7 +50,6 @@ TEST_CASE( "checking angular integral of scattering cross sections to be unity",
for( unsigned a = 1; a < angles.size(); ++a ) {
integral_sXS[e] += 0.5 * ( angles[a] - angles[a - 1] ) * ( sXS[e][a] + sXS[e][a - 1] );
}
std::cout << integral_sXS[e] << " " << tXS[e] << std::endl;
REQUIRE( std::fabs( integral_sXS[e] - tXS[e] ) / std::fabs( tXS[e] ) < 0.05 );
}
*/
......
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