Skip to content

Commit

Permalink
tests: include gtest
Browse files Browse the repository at this point in the history
This is mostly needed for install scripts like homebrew, so the install won't error out on accepting the ssl cert
  • Loading branch information
ryanlevy committed May 9, 2016
1 parent 306b54d commit d726426
Show file tree
Hide file tree
Showing 14 changed files with 29,659 additions and 45 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
!src/maxent_kernel.cpp
!src/maxent_grid.hpp
!test/gridTest.cpp
src/!maxent_kernel.hpp
!src/maxent_kernel.hpp
!src/maxent_parms.h
!src/maxent_simulation.cpp
!test/simulationTest.cpp
Expand Down Expand Up @@ -40,6 +40,7 @@ src/!maxent_kernel.hpp
!COPYRIGHT.TXT
!HEADER.TXT
!scripts/
!test/gtest*

.DS_Store
*.pyc
Expand Down
7 changes: 0 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,16 @@ configure_file(
include_directories("${PROJECT_BINARY_DIR}/config")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
message(STATUS "Finding packages, please stand by...")
include(UseGtest)
find_package(GSL REQUIRED)
find_package (Eigen3 3.1 REQUIRED)

set (GTEST_INCLUDE_DIR ${GTEST_ROOT}/include )
set (GTEST_SRC_DIR ${GTEST_ROOT}/src)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -DNDEBUG -Wno-return-type-c-linkage")

#let gcc take advantage of Eigen3 vectorization
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
endif()

include_directories(${CMAKE_SOURCE_DIR}/gtest/include)
include_directories(${GTEST_INCLUDE_DIR})
include_directories(${GTEST_ROOT})
include_directories(${GSL_INCLUDE_DIR})
include_directories(${EIGEN3_INCLUDE_DIR})

Expand Down
4 changes: 2 additions & 2 deletions cmake/EnableGtests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ function(add_gtest test)

if(${ARGC} EQUAL 2)
set(source "${ARGV1}/${test}")
set(gtest_src "${GTEST_SRC_DIR}/gtest_main.cc;${GTEST_SRC_DIR}/gtest-all.cc")
set(gtest_src "${ARGV1}/gtest_main.cc;${ARGV1}/gtest-all.cc")
else(${ARGC} EQUAL 2)
set(source "${test}")
set(gtest_src "${GTEST_SRC_DIR}/gtest_main.cc;${GTEST_SRC_DIR}/gtest-all.cc")
set(gtest_src "gtest/gtest_main.cc;gtest/gtest-all.cc")
endif(${ARGC} EQUAL 2)

add_executable(${test} ${source} ${gtest_src})
Expand Down
28 changes: 0 additions & 28 deletions cmake/UseGtest.cmake

This file was deleted.

1 change: 0 additions & 1 deletion src/maxent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "maxent_matrix_def.hpp"
#include "maxent_parms.hpp"
#include <boost/random/mersenne_twister.hpp>
#include"gtest/gtest.h"

struct ofstream_ : std::ofstream{
explicit ofstream_(std::streamsize precision=10){
Expand Down
2 changes: 1 addition & 1 deletion test/backcontTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* For use in publications, see ACKNOWLEDGE.TXT
*/
#include "../src/maxent.hpp"
#include "gtest/gtest.h"
#include "gtest.h"
#include "../src/maxent_backcont.hpp"

inline vector_type getA(){
Expand Down
2 changes: 1 addition & 1 deletion test/default_modelTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "../src/default_model.hpp"
#include <alps/utilities/temporary_filename.hpp>
#include"gtest/gtest.h"
#include"gtest.h"
#include <fstream>
#include "write_test_files.hpp"

Expand Down
2 changes: 1 addition & 1 deletion test/gridTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "../src/maxent.hpp"
#include "../src/maxent_grid.hpp"
#include "gtest/gtest.h"
#include "gtest.h"
#include <fstream>

//these tests only make sure the grids are initiallized
Expand Down
Loading

0 comments on commit d726426

Please sign in to comment.