-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
6,686 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# | ||
# enables testing with google test | ||
# provides add_gtest(test) and add_gtest_release(test) commands | ||
# | ||
|
||
# check xml output | ||
option(TestXMLOutput "Output tests to xml" OFF) | ||
|
||
# custom function to add gtest with xml output | ||
# arg0 - test (assume the source is ${test}.cpp | ||
function(add_gtest test) | ||
if (TestXMLOutput) | ||
set (test_xml_output --gtest_output=xml:${test}.xml) | ||
endif(TestXMLOutput) | ||
|
||
if(${ARGC} EQUAL 2) | ||
set(source "${ARGV1}/${test}") | ||
set(gtest_src "${ARGV1}/gtest_main.cc;${ARGV1}/gtest-all.cc") | ||
else(${ARGC} EQUAL 2) | ||
set(source "${test}") | ||
set(gtest_src "gtest_main.cc;gtest-all.cc") | ||
endif(${ARGC} EQUAL 2) | ||
|
||
add_executable(${test} ${source} ${gtest_src}) | ||
target_link_libraries(${test} ${LINK_ALL}) | ||
add_test(NAME ${test} COMMAND ${test} ${test_xml_output}) | ||
endfunction(add_gtest) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,21 @@ | ||
cmake_minimum_required(VERSION 2.8.12) | ||
|
||
function(add_gtest test) | ||
set(source "${ARGV1}/${test}.cpp") | ||
set(gtest_src "${ARGV1}/gtest_main.cc;${ARGV1}/gtest-all.cc") | ||
|
||
add_executable(${test} ${source} ${gtest_src} ${header_files}) | ||
target_link_libraries(${test} pthread gf) | ||
target_include_directories(${test} PRIVATE ${HDF5_INCLUDE_DIR}) | ||
add_test(NAME ${test} COMMAND ${test} ${test_xml_output}) | ||
endfunction(add_gtest) | ||
|
||
#find_package(GTest REQUIRED) | ||
#include_directories(BEFORE ${GTEST_INCLUDE_DIRS}) | ||
include(EnableGtests) #defined in ./cmake | ||
include_directories(../../c++/include) | ||
|
||
# test for SPM library | ||
|
||
|
||
# test for GF library | ||
set(unittest_src_gf | ||
test_fft | ||
test_pade | ||
test_fft_fermion | ||
test_fft_boson | ||
test_pade_fermion | ||
test_pade_boson | ||
) | ||
|
||
foreach(test_c++ ${unittest_src_gf}) | ||
add_gtest(${test_c++} ".") | ||
#target_link_libraries(${test_c++} gf) | ||
add_gtest(${test_c++}) | ||
target_link_libraries(${test_c++} gf) | ||
endforeach(test_c++) | ||
|
||
add_subdirectory(data) |
Oops, something went wrong.