Skip to content

Commit 7b518c3

Browse files
leoluan2009facebook-github-bot
authored andcommitted
Decouple the building of benchmarks and tests (#491)
Summary: X-link: pytorch/torcharrow#491 Tests and benchmarks targets are now de-coupled. That means they can be built independently. Shared functionality is moved to a common utility library. Resolves #1704 Pull Request resolved: #2439 Reviewed By: Yuhta Differential Revision: D39484543 Pulled By: kgpai fbshipit-source-id: 5ac888c81a6bbfbc5a1a1c4cfd41fa2c86199bc4
1 parent 3dd1f01 commit 7b518c3

File tree

192 files changed

+272
-221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

192 files changed

+272
-221
lines changed

CMakeLists.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ endif()
9191
if(${VELOX_ENABLE_BENCHMARKS} OR ${VELOX_ENABLE_BENCHMARKS_BASIC})
9292
set(VELOX_ENABLE_DUCKDB ON)
9393
set(VELOX_ENABLE_PARSE ON)
94+
set(VELOX_BUILD_TEST_UTILS ON)
9495
endif()
9596

9697
if(VELOX_ENABLE_S3)
@@ -313,12 +314,8 @@ if(VELOX_BUILD_TESTING AND NOT VELOX_ENABLE_DUCKDB)
313314
)
314315
endif()
315316

316-
# Benchmarks and tests at some places are coupled which is not great. See
317-
# velox/vector/CMakeLists.txt. TODO: Decouple.
318317
set(VELOX_DISABLE_GOOGLETEST OFF)
319-
if(NOT VELOX_BUILD_TEST_UTILS
320-
AND NOT VELOX_BUILD_TESTING
321-
AND NOT VELOX_ENABLE_BENCHMARKS_BASIC)
318+
if(NOT VELOX_BUILD_TEST_UTILS AND NOT VELOX_BUILD_TESTING)
322319
set(VELOX_DISABLE_GOOGLETEST ON)
323320
add_definitions(-DVELOX_DISABLE_GOOGLETEST)
324321
endif()

velox/benchmarks/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
1514
add_subdirectory(basic)
15+
1616
if(${VELOX_ENABLE_BENCHMARKS})
1717
add_subdirectory(tpch)
1818
endif()

velox/benchmarks/basic/Preproc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "velox/functions/lib/benchmarks/FunctionBenchmarkBase.h"
2323
#include "velox/functions/prestosql/Comparisons.h"
2424
#include "velox/functions/prestosql/registration/RegistrationFunctions.h"
25-
#include "velox/vector/tests/VectorTestBase.h"
25+
#include "velox/vector/tests/utils/VectorTestBase.h"
2626

2727
using namespace facebook::velox;
2828
using namespace facebook::velox::exec;

velox/benchmarks/tpch/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ target_link_libraries(
1818
velox_tpch_benchmark
1919
velox_aggregates
2020
velox_exec
21-
velox_exec_test_util
21+
velox_exec_test_lib
2222
velox_dwio_common
2323
velox_dwio_common_exception
2424
velox_dwio_parquet_reader

velox/common/file/benchmark/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
add_library(velox_read_benchmark_lib ReadBenchmark.cpp)
1616

1717
target_link_libraries(velox_read_benchmark_lib velox_file velox_exception
18-
velox_exec_test_util ${FMT} ${FOLLY_WITH_DEPENDENCIES})
18+
velox_exec_test_lib ${FMT} ${FOLLY_WITH_DEPENDENCIES})
1919

2020
add_executable(velox_read_benchmark ReadBenchmarkMain.cpp)
2121

velox/common/file/tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ target_link_libraries(
1818
velox_file_test
1919
velox_file
2020
velox_exception
21-
velox_exec_test_util
21+
velox_exec_test_lib
2222
${FMT}
2323
${FOLLY_WITH_DEPENDENCIES}
2424
gtest

velox/connectors/hive/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@ add_subdirectory(storage_adapters)
2525

2626
if(${VELOX_BUILD_TESTING})
2727
add_subdirectory(tests)
28+
endif()
29+
30+
if(${VELOX_ENABLE_BENCHMARKS})
2831
add_subdirectory(benchmarks)
2932
endif()

velox/connectors/hive/benchmarks/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ target_link_libraries(
2525
velox_parse_utils
2626
velox_parse_expression
2727
velox_exec
28-
velox_exec_test_util
28+
velox_exec_test_lib
2929
velox_hive_connector
3030
velox_hive_partition_function
3131
velox_memory

velox/connectors/hive/benchmarks/HivePartitionFunctionBenchmark.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "velox/type/Type.h"
2121
#include "velox/vector/ComplexVector.h"
2222
#include "velox/vector/fuzzer/VectorFuzzer.h"
23-
#include "velox/vector/tests/VectorMaker.h"
23+
#include "velox/vector/tests/utils/VectorMaker.h"
2424

2525
DEFINE_int64(fuzzer_seed, 99887766, "Seed for random input dataset generator");
2626

velox/connectors/hive/storage_adapters/hdfs/tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ target_link_libraries(
1919
velox_file
2020
velox_hdfs
2121
velox_core
22-
velox_exec_test_util
22+
velox_exec_test_lib
2323
velox_hive_connector
2424
velox_dwio_common_exception
2525
velox_exec

0 commit comments

Comments
 (0)