Skip to content

Commit c32382d

Browse files
authored
Merge branch 'master' into fix/complex_float_lstsq
2 parents 750a599 + 8570676 commit c32382d

21 files changed

+2491
-2494
lines changed

.github/workflows/linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
run: micromamba install 'openblas==0.3.29=pthreads*' blas-devel
7575

7676
- name: Configure using CMake
77-
run: cmake -Bbuild -DDOWNLOAD_GTEST=ON -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_SYSTEM_IGNORE_PATH=/usr/lib
77+
run: cmake -Bbuild -DBUILD_TESTS=ON -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_SYSTEM_IGNORE_PATH=/usr/lib
7878

7979
- name: Build
8080
working-directory: build

.github/workflows/osx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
run: micromamba install 'openblas==0.3.29=openmp*' blas-devel
4040

4141
- name: Configure using CMake
42-
run: cmake -Bbuild -DCMAKE_CXX_STANDARD=17 -DDOWNLOAD_GTEST=ON -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_SYSTEM_IGNORE_PATH=/usr/lib
42+
run: cmake -Bbuild -DCMAKE_CXX_STANDARD=17 -DBUILD_TESTS=ON -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DCMAKE_SYSTEM_IGNORE_PATH=/usr/lib
4343

4444
- name: Build
4545
working-directory: build

.github/workflows/windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
run: micromamba install mkl-devel
5252

5353
- name: Configure using CMake
54-
run: cmake -Bbuild -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DDOWNLOAD_GTEST=ON -G Ninja
54+
run: cmake -Bbuild -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DBUILD_TESTS=ON -G Ninja
5555

5656
- name: Build
5757
working-directory: build

CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,6 @@ endif()
101101
OPTION(BUILD_TESTS "xtensor-blas test suite" OFF)
102102
OPTION(BUILD_BENCHMARK "xtensor-blas test suite" OFF)
103103

104-
OPTION(DOWNLOAD_GTEST "download gtest and build from source" OFF)
105-
OPTION(DOWNLOAD_GBENCHMARK "download google benchmark and build from source" OFF)
106-
107-
if(DOWNLOAD_GTEST OR GTEST_SRC_DIR)
108-
set(BUILD_TESTS ON)
109-
endif()
110-
111104
if(BUILD_TESTS)
112105
enable_testing()
113106
include_directories(${XTENSOR_BLAS_INCLUDE_DIR})

environment-dev.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ channels:
44
dependencies:
55
- cmake
66
- xtensor>=0.26.0,<0.27
7+
- doctest

test/CMakeLists.txt

Lines changed: 4 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
2020
set(XTENSOR_BLAS_INCLUDE_DIR ${xblas_INCLUDE_DIRS})
2121
endif ()
2222

23+
find_package(doctest REQUIRED)
24+
find_package(Threads)
25+
2326
if(NOT CMAKE_BUILD_TYPE)
2427
message(STATUS "Setting tests build type to Release")
2528
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
@@ -86,43 +89,6 @@ else()
8689
message(FATAL_ERROR "Unsupported compiler: ${CMAKE_CXX_COMPILER_ID}")
8790
endif()
8891

89-
if(DOWNLOAD_GTEST OR GTEST_SRC_DIR)
90-
if(DOWNLOAD_GTEST)
91-
# Download and unpack googletest at configure time
92-
configure_file(downloadGTest.cmake.in googletest-download/CMakeLists.txt)
93-
else()
94-
# Copy local source of googletest at configure time
95-
configure_file(copyGTest.cmake.in googletest-download/CMakeLists.txt)
96-
endif()
97-
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
98-
RESULT_VARIABLE result
99-
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download )
100-
if(result)
101-
message(FATAL_ERROR "CMake step for googletest failed: ${result}")
102-
endif()
103-
execute_process(COMMAND ${CMAKE_COMMAND} --build .
104-
RESULT_VARIABLE result
105-
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download )
106-
if(result)
107-
message(FATAL_ERROR "Build step for googletest failed: ${result}")
108-
endif()
109-
110-
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
111-
112-
# Add googletest directly to our build. This defines
113-
# the gtest and gtest_main targets.
114-
add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/googletest-src
115-
${CMAKE_CURRENT_BINARY_DIR}/googletest-build EXCLUDE_FROM_ALL)
116-
117-
set(GTEST_INCLUDE_DIRS "${gtest_SOURCE_DIR}/include")
118-
set(GTEST_BOTH_LIBRARIES gtest_main gtest)
119-
else()
120-
find_package(GTest REQUIRED)
121-
endif()
122-
123-
find_package(Threads)
124-
125-
include_directories(${GTEST_INCLUDE_DIRS} SYSTEM)
12692
include_directories(${XTENSOR_INCLUDE_DIR})
12793
include_directories(${XBLAS_INCLUDE_DIR})
12894

@@ -154,11 +120,7 @@ set(XTENSOR_BLAS_TESTS
154120
)
155121

156122
add_executable(test_xtensor_blas ${XTENSOR_BLAS_TESTS} ${XTENSOR_BLAS_HEADERS} ${XTENSOR_HEADERS})
157-
if(DOWNLOAD_GTEST OR GTEST_SRC_DIR)
158-
add_dependencies(test_xtensor_blas gtest_main)
159-
endif()
160-
161-
target_link_libraries(test_xtensor_blas ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
123+
target_link_libraries(test_xtensor_blas ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} doctest::doctest ${CMAKE_THREAD_LIBS_INIT})
162124

163125
add_custom_target(xtest COMMAND test_xtensor_blas DEPENDS test_xtensor_blas)
164126
add_test(NAME xtest COMMAND test_xtensor_blas)

test/copyGTest.cmake.in

Lines changed: 0 additions & 23 deletions
This file was deleted.

test/downloadGTest.cmake.in

Lines changed: 0 additions & 24 deletions
This file was deleted.

test/main.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,5 @@
66
* The full license is in the file LICENSE, distributed with this software. *
77
****************************************************************************/
88

9-
#include "gtest/gtest.h"
10-
11-
int main(int argc, char* argv[])
12-
{
13-
::testing::InitGoogleTest(&argc, argv);
14-
return RUN_ALL_TESTS();
15-
}
9+
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
10+
#include "doctest/doctest.h"

0 commit comments

Comments
 (0)