Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Amazingkivas committed Oct 17, 2024
1 parent a5dc89e commit bdf91f2
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 29,687 deletions.
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 2.8)

project(FDTD)

find_package(OpenMP REQUIRED)

if(OPENMP_FOUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()

include_directories(3rdparty)

add_subdirectory(sln)
9,592 changes: 0 additions & 9,592 deletions gtest/gtest-all.cc

This file was deleted.

20,063 changes: 0 additions & 20,063 deletions gtest/gtest.h

This file was deleted.

15 changes: 1 addition & 14 deletions sln/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
cmake_minimum_required(VERSION 2.8)

project(FDTD)

include_directories(../include ../gtest ../test)

find_package(OpenMP REQUIRED)

if(OPENMP_FOUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
include_directories(../include ../test)

# BUILD
add_subdirectory(FDTD)
add_subdirectory(FDTD_test)
add_subdirectory(test_FDTD_method)
add_subdirectory(gtest)
add_subdirectory(sample)
1 change: 0 additions & 1 deletion sln/FDTD_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ file(GLOB hdrs "*.h*" "../../include/*.h")
file(GLOB srcs "*.cpp" "../../src/*.cpp")

add_library(${target} ${srcs} ${hdrs})
target_link_libraries(${target} gtest)

add_compile_options(/wd4996)
13 changes: 0 additions & 13 deletions sln/gtest/CMakeLists.txt

This file was deleted.

8 changes: 6 additions & 2 deletions sln/test_FDTD_method/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
set(target test_FDTD_method)

file(GLOB hdrs "*.h*" "../../include/*.h" "../../3rdparty/googletest/googletest/include/gtest/gtest.h")
file(GLOB hdrs "*.h*" "../../include/*.h")
#file(GLOB hdrs "*.h*")
file(GLOB srcs "*.cpp" "../../src/*.cpp" "../../test/*.cpp")

add_subdirectory(../../3rdparty/googletest ../../3rdparty/googletest/build EXCLUDE_FROM_ALL)

add_executable(${target} ${srcs} ${hdrs})
target_link_libraries(${target} gtest)
add_dependencies(${target} gtest)
target_link_directories(${target} PUBLIC ${CMAKE_BINARY_DIR}/googletest/lib)
target_link_libraries(${target} PUBLIC gtest gtest_main)

add_compile_options(/wd4996)
2 changes: 1 addition & 1 deletion test/test_FDTD_method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "test_FDTD.h"

#include <gtest.h>
#include <gtest/gtest.h>

const double default_time = 5e-13;

Expand Down
2 changes: 1 addition & 1 deletion test/test_main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <gtest.h>
#include <gtest/gtest.h>

int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
Expand Down

0 comments on commit bdf91f2

Please sign in to comment.