init — unit tests
This commit is contained in:
		
					parent
					
						
							
								87f1181a1a
							
						
					
				
			
			
				commit
				
					
						22ebb857eb
					
				
			
		
					 3 changed files with 43 additions and 2 deletions
				
			
		
							
								
								
									
										26
									
								
								tests/CMakeLists.txt
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								tests/CMakeLists.txt
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,26 @@
 | 
			
		|||
project(testsRaiiSafeCuda CXX)
 | 
			
		||||
 | 
			
		||||
find_package(Catch2)
 | 
			
		||||
if (NOT Catch2_FOUND)
 | 
			
		||||
    message(STATUS "Using FetchContent to download and use Catch2")
 | 
			
		||||
    include(FetchContent)
 | 
			
		||||
    fetchcontent_declare(
 | 
			
		||||
            Catch2
 | 
			
		||||
            GIT_REPOSITORY https://github.com/catchorg/Catch2
 | 
			
		||||
            GIT_TAG v3.5.3
 | 
			
		||||
            EXCLUDE_FROM_ALL
 | 
			
		||||
            OVERRIDE_FIND_PACKAGE
 | 
			
		||||
    )
 | 
			
		||||
    fetchcontent_makeavailable(Catch2)
 | 
			
		||||
    find_package(Catch2 3 REQUIRED)
 | 
			
		||||
endif ()
 | 
			
		||||
 | 
			
		||||
include(CTest)
 | 
			
		||||
enable_testing()
 | 
			
		||||
include(Catch)
 | 
			
		||||
include(CatchAddTests)
 | 
			
		||||
 | 
			
		||||
add_executable(tests tests_stream.cpp)
 | 
			
		||||
target_link_libraries(tests Catch2::Catch2WithMain)
 | 
			
		||||
 | 
			
		||||
catch_discover_tests(tests WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
 | 
			
		||||
							
								
								
									
										9
									
								
								tests/tests_stream.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								tests/tests_stream.cpp
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,9 @@
 | 
			
		|||
//
 | 
			
		||||
// Created by postaron on 21/03/24.
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
#include <catch2/catch_all.hpp>
 | 
			
		||||
 | 
			
		||||
TEST_CASE("hello", "world") {
 | 
			
		||||
    
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue