Commit 0c129aa2 authored by shadow_walker's avatar shadow_walker
Browse files

Merge branch 'cmake-catch2'

parents 5c0ddd3f 09bd19d2
...@@ -86,6 +86,8 @@ else() ...@@ -86,6 +86,8 @@ else()
set(CMAKE_INSTALL_RPATH "${SP_DIR};${EMAN_PREFIX_LIB}") set(CMAKE_INSTALL_RPATH "${SP_DIR};${EMAN_PREFIX_LIB}")
endif() endif()
option(ENABLE_CATCH2 "Enable Catch 2 framework for unit testing (internal development only)" OFF)
OPTION(ENABLE_AUTODOC "enable latex/doxygen document generation and etc. " OFF) OPTION(ENABLE_AUTODOC "enable latex/doxygen document generation and etc. " OFF)
OPTION(ENABLE_FFTW3 "enable fftw 3 support (USE THIS)" ON) OPTION(ENABLE_FFTW3 "enable fftw 3 support (USE THIS)" ON)
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
#define EMAN_RENDERER_H #define EMAN_RENDERER_H
#include <cmath> #include <cmath>
#include <vector>
#include "emutil.h"
namespace EMAN { namespace EMAN {
......
...@@ -6,3 +6,25 @@ add_custom_target(test-eer ...@@ -6,3 +6,25 @@ add_custom_target(test-eer
COMMAND ${CMAKE_CTEST_COMMAND} -V -C Release -R test-eer COMMAND ${CMAKE_CTEST_COMMAND} -V -C Release -R test-eer
DEPENDS test_eer DEPENDS test_eer
) )
if (ENABLE_CATCH2)
Include(FetchContent)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.0.1 # or a later release
)
FetchContent_MakeAvailable(Catch2)
add_executable(test_renderer test_renderer.cpp)
target_link_libraries(test_renderer PRIVATE EM2 Catch2::Catch2WithMain)
add_test(test-renderer test_renderer)
add_custom_target(test-renderer
COMMAND ${CMAKE_CTEST_COMMAND} -V --output-on-failure -C Release -R test-renderer
DEPENDS test_renderer
)
endif ()
#include "io/renderer.h"
using namespace EMAN;
#include <catch2/catch_test_macros.hpp>
TEST_CASE("test class Renderer") {
}
Supports Markdown
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