Do not build unit tests by default, fix building Gandiva unit tests when ARROW_BUILD_TESTS=OFF

Change-Id: I223614691706105f81c0d6f476ec24517399f6ad
This commit is contained in:
Wes McKinney committed 2018-12-11 21:02:55 -06:00
1 parent c7e986047a
commit 5c6a332714
7 files changed
+36 -18

No files matched your search

+3
View File
@@ -34,6 +34,7 @@ if "%JOB%" == "Static_Crt_Build" (
-DARROW_USE_STATIC_CRT=ON ^
-DARROW_BOOST_USE_SHARED=OFF ^
-DARROW_BUILD_SHARED=OFF ^
-DARROW_BUILD_TESTS=ON ^
-DCMAKE_BUILD_TYPE=Debug ^
-DARROW_TEST_LINKAGE=static ^
-DARROW_CXXFLAGS="/MP" ^
@@ -51,6 +52,7 @@ if "%JOB%" == "Static_Crt_Build" (
-DARROW_USE_STATIC_CRT=ON ^
-DARROW_BOOST_USE_SHARED=OFF ^
-DARROW_BUILD_SHARED=OFF ^
-DARROW_BUILD_TESTS=ON ^
-DCMAKE_BUILD_TYPE=Release ^
-DARROW_TEST_LINKAGE=static ^
-DCMAKE_CXX_FLAGS_RELEASE="/MT %CMAKE_CXX_FLAGS_RELEASE%" ^
@@ -76,6 +78,7 @@ if "%JOB%" == "Build_Debug" (
cmake -G "%GENERATOR%" ^
-DARROW_VERBOSE_THIRDPARTY_BUILD=OFF ^
-DARROW_BOOST_USE_SHARED=OFF ^
-DARROW_BUILD_TESTS=ON ^
-DCMAKE_BUILD_TYPE=%CONFIGURATION% ^
-DARROW_BUILD_STATIC=OFF ^
-DARROW_CXXFLAGS="/MP" ^
+1
View File
@@ -48,6 +48,7 @@ cmake -G "%GENERATOR%" %CMAKE_ARGS% ^
-DARROW_BOOST_USE_SHARED=OFF ^
-DCMAKE_BUILD_TYPE=%CONFIGURATION% ^
-DARROW_BUILD_STATIC=OFF ^
-DARROW_BUILD_TESTS=ON ^
-DARROW_CXXFLAGS="%ARROW_CXXFLAGS%" ^
-DCMAKE_CXX_FLAGS_RELEASE="/MD %CMAKE_CXX_FLAGS_RELEASE%" ^
-DARROW_PARQUET=ON ^
+10 -2
View File
@@ -41,7 +41,6 @@ if [ "$only_library_mode" == "no" ]; then
fi
CMAKE_COMMON_FLAGS="\
-DARROW_BUILD_BENCHMARKS=ON \
-DCMAKE_INSTALL_PREFIX=$ARROW_CPP_INSTALL \
-DARROW_NO_DEPRECATED_API=ON \
-DARROW_EXTRA_ERROR_CONTEXT=ON"
@@ -61,7 +60,13 @@ pushd $ARROW_CPP_BUILD_DIR
if [ $only_library_mode == "yes" ]; then
CMAKE_COMMON_FLAGS="\
$CMAKE_COMMON_FLAGS \
-DARROW_BUILD_TESTS=OFF \
-DARROW_BUILD_UTILITIES=OFF \
-DARROW_INSTALL_NAME_RPATH=OFF"
else
CMAKE_COMMON_FLAGS="\
$CMAKE_COMMON_FLAGS \
-DARROW_BUILD_BENCHMARKS=ON \
-DARROW_BUILD_TESTS=ON \
-DARROW_BUILD_UTILITIES=OFF \
-DARROW_INSTALL_NAME_RPATH=OFF"
fi
@@ -92,6 +97,9 @@ fi
if [ $ARROW_TRAVIS_GANDIVA == "1" ]; then
CMAKE_COMMON_FLAGS="$CMAKE_COMMON_FLAGS -DARROW_GANDIVA=ON"
if [ $only_library_mode == "no" ]; then
CMAKE_COMMON_FLAGS="$CMAKE_COMMON_FLAGS -DARROW_GANDIVA_BUILD_TESTS=ON"
fi
fi
if [ $ARROW_TRAVIS_VALGRIND == "1" ]; then
+7 -7
View File
@@ -115,8 +115,12 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
OFF)
option(ARROW_BUILD_TESTS
"Build the Arrow googletest unit tests"
ON)
"Build the Arrow googletest unit tests, default OFF"
OFF)
option(ARROW_BUILD_BENCHMARKS
"Build the Arrow micro benchmarks, default OFF"
OFF)
set(ARROW_TEST_LINKAGE "shared" CACHE STRING
"Linkage of Arrow libraries with unit tests executables. \
@@ -126,10 +130,6 @@ static|shared (default shared)")
"Only build unit tests having the indicated label or labels. \
Pass multiple labels by dividing with semicolons")
option(ARROW_BUILD_BENCHMARKS
"Build the Arrow micro benchmarks"
OFF)
option(ARROW_NO_DEPRECATED_API
"Exclude deprecated APIs from build"
OFF)
@@ -322,7 +322,7 @@ Always OFF if building binaries"
option(ARROW_GANDIVA_BUILD_TESTS
"Build the Gandiva googletest unit tests"
ON)
OFF)
endif()
+9 -5
View File
@@ -60,7 +60,7 @@ Simple debug build:
cd arrow/cpp
mkdir debug
cd debug
cmake ..
cmake -DARROW_BUILD_TESTS=ON ..
make unittest
Simple release build:
@@ -69,10 +69,14 @@ Simple release build:
cd arrow/cpp
mkdir release
cd release
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake -DARROW_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release ..
make unittest
Detailed unit test logs will be placed in the build directory under `build/test-logs`.
If you do not need to build the test suite, you can omit the
`ARROW_BUILD_TESTS` option (the default is not to build the unit tests).
Detailed unit test logs will be placed in the build directory under
`build/test-logs`.
On some Linux distributions, running the test suite might require setting an
explicit locale. If you see any locale-related errors, try setting the
@@ -128,7 +132,7 @@ not use the macro.
Follow the directions for simple build except run cmake
with the `--ARROW_BUILD_BENCHMARKS` parameter set correctly:
cmake -DARROW_BUILD_BENCHMARKS=ON ..
cmake -DARROW_BUILD_TESTS=ON -DARROW_BUILD_BENCHMARKS=ON ..
and instead of make unittest run either `make; ctest` to run both unit tests
and benchmarks or `make benchmark` to run only the benchmark tests.
@@ -261,7 +265,7 @@ The optional `gandiva` libraries and tests can be built by passing
`-DARROW_GANDIVA=on`.
```shell
cmake .. -DARROW_GANDIVA=on
cmake .. -DARROW_GANDIVA=ON -DARROW_BUILD_TESTS=ON
make
ctest -L gandiva
```
+4 -3
View File
@@ -525,9 +525,11 @@ message(STATUS "double-conversion static library: ${DOUBLE_CONVERSION_STATIC_LIB
# ----------------------------------------------------------------------
# Google gtest & gflags
if(ARROW_BUILD_TESTS OR ARROW_BUILD_BENCHMARKS)
add_custom_target(unittest ctest -L unittest)
add_custom_target(unittest ctest -L unittest)
add_custom_target(benchmark ctest -L benchmark)
if(ARROW_BUILD_TESTS OR ARROW_GANDIVA_BUILD_TESTS
OR ARROW_BUILD_BENCHMARKS)
if("${GTEST_HOME}" STREQUAL "")
if(APPLE)
set(GTEST_CMAKE_CXX_FLAGS "-fPIC -DGTEST_USE_OWN_TR1_TUPLE=1 -Wno-unused-value -Wno-ignored-attributes")
@@ -627,7 +629,6 @@ if(ARROW_BUILD_TESTS OR ARROW_BUILD_BENCHMARKS)
endif()
if(ARROW_BUILD_BENCHMARKS)
add_custom_target(benchmark ctest -L benchmark)
if("$ENV{GBENCHMARK_HOME}" STREQUAL "")
if(NOT MSVC)
+2 -1
View File
@@ -213,7 +213,8 @@ if (ARROW_BUILD_STATIC AND WIN32)
target_compile_definitions(arrow_static PUBLIC ARROW_STATIC)
endif()
if (ARROW_BUILD_TESTS OR ARROW_BUILD_BENCHMARKS)
if (ARROW_BUILD_TESTS OR ARROW_GANDIVA_BUILD_TESTS
OR ARROW_BUILD_BENCHMARKS)
# that depend on gtest
ADD_ARROW_LIB(arrow_testing
SOURCES test-util.cc