summaryrefslogtreecommitdiff
path: root/third_party/aom/test/test.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/aom/test/test.cmake')
-rw-r--r--third_party/aom/test/test.cmake396
1 files changed, 244 insertions, 152 deletions
diff --git a/third_party/aom/test/test.cmake b/third_party/aom/test/test.cmake
index d72a784ada..a02f9203f4 100644
--- a/third_party/aom/test/test.cmake
+++ b/third_party/aom/test/test.cmake
@@ -11,6 +11,7 @@
if (NOT AOM_TEST_TEST_CMAKE_)
set(AOM_TEST_TEST_CMAKE_ 1)
+include(FindPythonInterp)
include(ProcessorCount)
include("${AOM_ROOT}/test/test_data_util.cmake")
@@ -25,7 +26,6 @@ set(AOM_UNIT_TEST_COMMON_SOURCES
"${AOM_ROOT}/test/acm_random.h"
"${AOM_ROOT}/test/clear_system_state.h"
"${AOM_ROOT}/test/codec_factory.h"
- "${AOM_ROOT}/test/convolve_test.cc"
"${AOM_ROOT}/test/decode_test_driver.cc"
"${AOM_ROOT}/test/decode_test_driver.h"
"${AOM_ROOT}/test/function_equivalence_test.h"
@@ -35,25 +35,58 @@ set(AOM_UNIT_TEST_COMMON_SOURCES
"${AOM_ROOT}/test/util.h"
"${AOM_ROOT}/test/video_source.h")
-if (CONFIG_ACCOUNTING)
+if (NOT BUILD_SHARED_LIBS)
set(AOM_UNIT_TEST_COMMON_SOURCES
${AOM_UNIT_TEST_COMMON_SOURCES}
- "${AOM_ROOT}/test/accounting_test.cc")
-endif ()
+ "${AOM_ROOT}/test/convolve_test.cc"
+ "${AOM_ROOT}/test/simd_impl.h")
-if (CONFIG_ADAPT_SCAN)
- set(AOM_UNIT_TEST_COMMON_SOURCES
- ${AOM_UNIT_TEST_COMMON_SOURCES}
- "${AOM_ROOT}/test/scan_test.cc")
-endif ()
-
-if (CONFIG_GLOBAL_MOTION OR CONFIG_WARPED_MOTION)
+ if (HAVE_NEON)
+ set(AOM_UNIT_TEST_COMMON_SOURCES
+ ${AOM_UNIT_TEST_COMMON_SOURCES}
+ "${AOM_ROOT}/test/simd_neon_test.cc")
+ endif ()
if (HAVE_SSE2)
set(AOM_UNIT_TEST_COMMON_SOURCES
${AOM_UNIT_TEST_COMMON_SOURCES}
- "${AOM_ROOT}/test/warp_filter_test.cc"
- "${AOM_ROOT}/test/warp_filter_test_util.cc"
- "${AOM_ROOT}/test/warp_filter_test_util.h")
+ "${AOM_ROOT}/test/simd_sse2_test.cc")
+ endif ()
+ if (HAVE_SSSE3)
+ set(AOM_UNIT_TEST_COMMON_SOURCES
+ ${AOM_UNIT_TEST_COMMON_SOURCES}
+ "${AOM_ROOT}/test/simd_ssse3_test.cc")
+ endif ()
+ if (HAVE_SSE4)
+ set(AOM_UNIT_TEST_COMMON_SOURCES
+ ${AOM_UNIT_TEST_COMMON_SOURCES}
+ "${AOM_ROOT}/test/simd_sse4_test.cc")
+ endif ()
+ if (HAVE_AVX2)
+ set(AOM_UNIT_TEST_COMMON_SOURCES
+ ${AOM_UNIT_TEST_COMMON_SOURCES}
+ "${AOM_ROOT}/test/simd_avx2_test.cc")
+ endif ()
+
+ if (CONFIG_ACCOUNTING)
+ set(AOM_UNIT_TEST_COMMON_SOURCES
+ ${AOM_UNIT_TEST_COMMON_SOURCES}
+ "${AOM_ROOT}/test/accounting_test.cc")
+ endif ()
+
+ if (CONFIG_ADAPT_SCAN)
+ set(AOM_UNIT_TEST_COMMON_SOURCES
+ ${AOM_UNIT_TEST_COMMON_SOURCES}
+ "${AOM_ROOT}/test/scan_test.cc")
+ endif ()
+
+ if (CONFIG_GLOBAL_MOTION OR CONFIG_WARPED_MOTION)
+ if (HAVE_SSE2)
+ set(AOM_UNIT_TEST_COMMON_SOURCES
+ ${AOM_UNIT_TEST_COMMON_SOURCES}
+ "${AOM_ROOT}/test/warp_filter_test.cc"
+ "${AOM_ROOT}/test/warp_filter_test_util.cc"
+ "${AOM_ROOT}/test/warp_filter_test_util.h")
+ endif ()
endif ()
endif ()
@@ -65,18 +98,23 @@ set(AOM_UNIT_TEST_ENCODER_SOURCES
"${AOM_ROOT}/test/altref_test.cc"
"${AOM_ROOT}/test/aq_segment_test.cc"
"${AOM_ROOT}/test/datarate_test.cc"
- "${AOM_ROOT}/test/dct16x16_test.cc"
- "${AOM_ROOT}/test/dct32x32_test.cc"
"${AOM_ROOT}/test/encode_api_test.cc"
"${AOM_ROOT}/test/encode_test_driver.cc"
"${AOM_ROOT}/test/encode_test_driver.h"
"${AOM_ROOT}/test/error_resilience_test.cc"
"${AOM_ROOT}/test/i420_video_source.h"
- "${AOM_ROOT}/test/sad_test.cc"
"${AOM_ROOT}/test/y4m_test.cc"
"${AOM_ROOT}/test/y4m_video_source.h"
"${AOM_ROOT}/test/yuv_video_source.h")
+if (NOT BUILD_SHARED_LIBS)
+ set(AOM_UNIT_TEST_ENCODER_SOURCES
+ ${AOM_UNIT_TEST_ENCODER_SOURCES}
+ "${AOM_ROOT}/test/dct16x16_test.cc"
+ "${AOM_ROOT}/test/dct32x32_test.cc"
+ "${AOM_ROOT}/test/sad_test.cc")
+endif ()
+
set(AOM_DECODE_PERF_TEST_SOURCES "${AOM_ROOT}/test/decode_perf_test.cc")
set(AOM_ENCODE_PERF_TEST_SOURCES "${AOM_ROOT}/test/encode_perf_test.cc")
set(AOM_UNIT_TEST_WEBM_SOURCES "${AOM_ROOT}/test/webm_video_source.h")
@@ -85,149 +123,186 @@ set(AOM_TEST_INTRA_PRED_SPEED_SOURCES
"${AOM_CONFIG_DIR}/usage_exit.c"
"${AOM_ROOT}/test/test_intra_pred_speed.cc")
-if (CONFIG_AV1)
- set(AOM_UNIT_TEST_COMMON_SOURCES
- ${AOM_UNIT_TEST_COMMON_SOURCES}
- "${AOM_ROOT}/test/av1_convolve_optimz_test.cc"
- "${AOM_ROOT}/test/av1_convolve_test.cc"
- "${AOM_ROOT}/test/av1_txfm_test.cc"
- "${AOM_ROOT}/test/av1_txfm_test.h"
- "${AOM_ROOT}/test/intrapred_test.cc"
- "${AOM_ROOT}/test/lpf_8_test.cc"
- "${AOM_ROOT}/test/simd_cmp_impl.h")
-
- if (CONFIG_CDEF)
+if (NOT BUILD_SHARED_LIBS)
+ if (CONFIG_AV1_DECODER OR CONFIG_AV1_ENCODER)
set(AOM_UNIT_TEST_COMMON_SOURCES
${AOM_UNIT_TEST_COMMON_SOURCES}
- "${AOM_ROOT}/test/clpf_test.cc")
- endif ()
+ "${AOM_ROOT}/test/av1_convolve_optimz_test.cc"
+ "${AOM_ROOT}/test/av1_convolve_test.cc"
+ "${AOM_ROOT}/test/av1_txfm_test.cc"
+ "${AOM_ROOT}/test/av1_txfm_test.h"
+ "${AOM_ROOT}/test/intrapred_test.cc"
+ "${AOM_ROOT}/test/lpf_8_test.cc"
+ "${AOM_ROOT}/test/motion_vector_test.cc"
+ "${AOM_ROOT}/test/simd_cmp_impl.h")
+
+ if (CONFIG_CDEF)
+ set(AOM_UNIT_TEST_COMMON_SOURCES
+ ${AOM_UNIT_TEST_COMMON_SOURCES}
+ "${AOM_ROOT}/test/clpf_test.cc"
+ "${AOM_ROOT}/test/dering_test.cc")
+ endif ()
+
+ if (CONFIG_FILTER_INTRA)
+ if (HAVE_SSE4_1)
+ set(AOM_UNIT_TEST_COMMON_SOURCES
+ ${AOM_UNIT_TEST_COMMON_SOURCES}
+ "${AOM_ROOT}/test/filterintra_predictors_test.cc")
+ endif ()
+ endif ()
+
+ if (CONFIG_INTRABC)
+ set(AOM_UNIT_TEST_COMMON_SOURCES
+ ${AOM_UNIT_TEST_COMMON_SOURCES}
+ "${AOM_ROOT}/test/intrabc_test.cc")
+ endif ()
- if (CONFIG_FILTER_INTRA)
- if (HAVE_SSE4_1)
+ if (CONFIG_LOOP_RESTORATION)
set(AOM_UNIT_TEST_COMMON_SOURCES
${AOM_UNIT_TEST_COMMON_SOURCES}
- "${AOM_ROOT}/test/filterintra_predictors_test.cc")
+ "${AOM_ROOT}/test/hiprec_convolve_test.cc"
+ "${AOM_ROOT}/test/hiprec_convolve_test_util.cc"
+ "${AOM_ROOT}/test/hiprec_convolve_test_util.h"
+ "${AOM_ROOT}/test/selfguided_filter_test.cc")
endif ()
- endif ()
- set(AOM_UNIT_TEST_COMMON_INTRIN_NEON
- ${AOM_UNIT_TEST_COMMON_INTRIN_NEON}
- "${AOM_ROOT}/test/simd_cmp_neon.cc"
- "${AOM_ROOT}/test/simd_neon_test.cc")
- set(AOM_UNIT_TEST_COMMON_INTRIN_SSE2
- ${AOM_UNIT_TEST_COMMON_INTRIN_SSE2}
- "${AOM_ROOT}/test/simd_cmp_sse2.cc")
- set(AOM_UNIT_TEST_COMMON_INTRIN_SSSE3
- ${AOM_UNIT_TEST_COMMON_INTRIN_SSSE3}
- "${AOM_ROOT}/test/simd_cmp_ssse3.cc")
- set(AOM_UNIT_TEST_COMMON_INTRIN_SSE4_1
- ${AOM_UNIT_TEST_COMMON_INTRIN_SSE4_1}
- "${AOM_ROOT}/test/simd_cmp_sse4.cc")
+ set(AOM_UNIT_TEST_COMMON_INTRIN_NEON
+ ${AOM_UNIT_TEST_COMMON_INTRIN_NEON}
+ "${AOM_ROOT}/test/simd_cmp_neon.cc")
+ set(AOM_UNIT_TEST_COMMON_INTRIN_SSE2
+ ${AOM_UNIT_TEST_COMMON_INTRIN_SSE2}
+ "${AOM_ROOT}/test/simd_cmp_sse2.cc")
+ set(AOM_UNIT_TEST_COMMON_INTRIN_SSSE3
+ ${AOM_UNIT_TEST_COMMON_INTRIN_SSSE3}
+ "${AOM_ROOT}/test/simd_cmp_ssse3.cc")
+ set(AOM_UNIT_TEST_COMMON_INTRIN_SSE4_1
+ ${AOM_UNIT_TEST_COMMON_INTRIN_SSE4_1}
+ "${AOM_ROOT}/test/simd_cmp_sse4.cc")
+ set(AOM_UNIT_TEST_COMMON_INTRIN_AVX2
+ ${AOM_UNIT_TEST_COMMON_INTRIN_AVX2}
+ "${AOM_ROOT}/test/simd_cmp_avx2.cc")
+ endif ()
endif ()
if (CONFIG_AV1_ENCODER)
set(AOM_UNIT_TEST_ENCODER_SOURCES
${AOM_UNIT_TEST_ENCODER_SOURCES}
"${AOM_ROOT}/test/active_map_test.cc"
- "${AOM_ROOT}/test/arf_freq_test.cc"
- "${AOM_ROOT}/test/av1_dct_test.cc"
- "${AOM_ROOT}/test/av1_fht16x16_test.cc"
- "${AOM_ROOT}/test/av1_fht32x32_test.cc"
- "${AOM_ROOT}/test/av1_fht8x8_test.cc"
- "${AOM_ROOT}/test/av1_inv_txfm_test.cc"
- "${AOM_ROOT}/test/av1_fwd_txfm1d_test.cc"
- "${AOM_ROOT}/test/av1_fwd_txfm2d_test.cc"
- "${AOM_ROOT}/test/av1_inv_txfm1d_test.cc"
- "${AOM_ROOT}/test/av1_inv_txfm2d_test.cc"
- "${AOM_ROOT}/test/avg_test.cc"
- "${AOM_ROOT}/test/blend_a64_mask_1d_test.cc"
- "${AOM_ROOT}/test/blend_a64_mask_test.cc"
"${AOM_ROOT}/test/borders_test.cc"
"${AOM_ROOT}/test/cpu_speed_test.cc"
"${AOM_ROOT}/test/end_to_end_test.cc"
- "${AOM_ROOT}/test/error_block_test.cc"
- "${AOM_ROOT}/test/fdct4x4_test.cc"
- "${AOM_ROOT}/test/fdct8x8_test.cc"
"${AOM_ROOT}/test/frame_size_tests.cc"
- "${AOM_ROOT}/test/hadamard_test.cc"
- "${AOM_ROOT}/test/lossless_test.cc"
- "${AOM_ROOT}/test/minmax_test.cc"
- "${AOM_ROOT}/test/subtract_test.cc"
- "${AOM_ROOT}/test/sum_squares_test.cc"
- "${AOM_ROOT}/test/variance_test.cc")
-
- if (CONFIG_EXT_INTER)
- set(AOM_UNIT_TEST_ENCODER_SOURCES
- ${AOM_UNIT_TEST_ENCODER_SOURCES}
- "${AOM_ROOT}/test/av1_wedge_utils_test.cc"
- "${AOM_ROOT}/test/masked_sad_test.cc"
- "${AOM_ROOT}/test/masked_variance_test.cc")
- endif ()
+ "${AOM_ROOT}/test/lossless_test.cc")
- if (CONFIG_EXT_TX)
+ if (NOT BUILD_SHARED_LIBS)
set(AOM_UNIT_TEST_ENCODER_SOURCES
${AOM_UNIT_TEST_ENCODER_SOURCES}
- "${AOM_ROOT}/test/av1_fht16x32_test.cc"
- "${AOM_ROOT}/test/av1_fht16x8_test.cc"
- "${AOM_ROOT}/test/av1_fht32x16_test.cc"
- "${AOM_ROOT}/test/av1_fht4x4_test.cc"
- "${AOM_ROOT}/test/av1_fht4x8_test.cc"
- "${AOM_ROOT}/test/av1_fht8x16_test.cc"
- "${AOM_ROOT}/test/av1_fht8x4_test.cc")
-
- endif ()
+ "${AOM_ROOT}/test/arf_freq_test.cc"
+ "${AOM_ROOT}/test/av1_dct_test.cc"
+ "${AOM_ROOT}/test/av1_fht16x16_test.cc"
+ "${AOM_ROOT}/test/av1_fht32x32_test.cc"
+ "${AOM_ROOT}/test/av1_fht8x8_test.cc"
+ "${AOM_ROOT}/test/av1_inv_txfm_test.cc"
+ "${AOM_ROOT}/test/av1_fwd_txfm1d_test.cc"
+ "${AOM_ROOT}/test/av1_fwd_txfm2d_test.cc"
+ "${AOM_ROOT}/test/av1_inv_txfm1d_test.cc"
+ "${AOM_ROOT}/test/av1_inv_txfm2d_test.cc"
+ "${AOM_ROOT}/test/avg_test.cc"
+ "${AOM_ROOT}/test/blend_a64_mask_1d_test.cc"
+ "${AOM_ROOT}/test/blend_a64_mask_test.cc"
+ "${AOM_ROOT}/test/error_block_test.cc"
+ "${AOM_ROOT}/test/fdct4x4_test.cc"
+ "${AOM_ROOT}/test/fdct8x8_test.cc"
+ "${AOM_ROOT}/test/hadamard_test.cc"
+ "${AOM_ROOT}/test/minmax_test.cc"
+ "${AOM_ROOT}/test/quantize_func_test.cc"
+ "${AOM_ROOT}/test/subtract_test.cc"
+ "${AOM_ROOT}/test/sum_squares_test.cc"
+ "${AOM_ROOT}/test/variance_test.cc")
+
+ if (CONFIG_CONVOLVE_ROUND)
+ set(AOM_UNIT_TEST_ENCODER_SOURCES
+ ${AOM_UNIT_TEST_ENCODER_SOURCES}
+ "${AOM_ROOT}/test/av1_convolve_2d_test.cc"
+ "${AOM_ROOT}/test/av1_convolve_2d_test_util.cc"
+ "${AOM_ROOT}/test/av1_convolve_2d_test_util.h"
+ "${AOM_ROOT}/test/convolve_round_test.cc")
+ endif ()
- if (CONFIG_GLOBAL_MOTION)
- set(AOM_UNIT_TEST_ENCODER_INTRIN_SSE4_1
- ${AOM_UNIT_TEST_ENCODER_INTRIN_SSE4_1}
- "${AOM_ROOT}/test/corner_match_test.cc")
- endif ()
+ if (CONFIG_EXT_INTER)
+ set(AOM_UNIT_TEST_ENCODER_SOURCES
+ ${AOM_UNIT_TEST_ENCODER_SOURCES}
+ "${AOM_ROOT}/test/av1_wedge_utils_test.cc"
+ "${AOM_ROOT}/test/masked_sad_test.cc"
+ "${AOM_ROOT}/test/masked_variance_test.cc")
+ endif ()
- if (CONFIG_MOTION_VAR)
- set(AOM_UNIT_TEST_ENCODER_SOURCES
- ${AOM_UNIT_TEST_ENCODER_SOURCES}
- "${AOM_ROOT}/test/obmc_sad_test.cc"
- "${AOM_ROOT}/test/obmc_variance_test.cc")
- endif ()
+ if (CONFIG_EXT_TX)
+ set(AOM_UNIT_TEST_ENCODER_SOURCES
+ ${AOM_UNIT_TEST_ENCODER_SOURCES}
+ "${AOM_ROOT}/test/av1_fht16x32_test.cc"
+ "${AOM_ROOT}/test/av1_fht16x8_test.cc"
+ "${AOM_ROOT}/test/av1_fht32x16_test.cc"
+ "${AOM_ROOT}/test/av1_fht4x4_test.cc"
+ "${AOM_ROOT}/test/av1_fht4x8_test.cc"
+ "${AOM_ROOT}/test/av1_fht8x16_test.cc"
+ "${AOM_ROOT}/test/av1_fht8x4_test.cc")
+ endif ()
- if (CONFIG_TX64X64)
- set(AOM_UNIT_TEST_ENCODER_SOURCES
- ${AOM_UNIT_TEST_ENCODER_SOURCES}
- "${AOM_ROOT}/test/av1_fht64x64_test.cc")
+ if (CONFIG_GLOBAL_MOTION)
+ set(AOM_UNIT_TEST_ENCODER_INTRIN_SSE4_1
+ ${AOM_UNIT_TEST_ENCODER_INTRIN_SSE4_1}
+ "${AOM_ROOT}/test/corner_match_test.cc")
+ endif ()
+
+ if (CONFIG_MOTION_VAR)
+ set(AOM_UNIT_TEST_ENCODER_SOURCES
+ ${AOM_UNIT_TEST_ENCODER_SOURCES}
+ "${AOM_ROOT}/test/obmc_sad_test.cc"
+ "${AOM_ROOT}/test/obmc_variance_test.cc")
+ endif ()
+
+ if (CONFIG_TX64X64)
+ set(AOM_UNIT_TEST_ENCODER_SOURCES
+ ${AOM_UNIT_TEST_ENCODER_SOURCES}
+ "${AOM_ROOT}/test/av1_fht64x64_test.cc")
+ endif ()
endif ()
endif ()
-if (CONFIG_AV1_DECODER AND CONFIG_AV1_ENCODER)
- set(AOM_UNIT_TEST_COMMON_SOURCES
- ${AOM_UNIT_TEST_COMMON_SOURCES}
- "${AOM_ROOT}/test/divu_small_test.cc"
- "${AOM_ROOT}/test/ethread_test.cc"
- "${AOM_ROOT}/test/idct8x8_test.cc"
- "${AOM_ROOT}/test/partial_idct_test.cc"
- "${AOM_ROOT}/test/superframe_test.cc"
- "${AOM_ROOT}/test/binary_codes_test.cc"
- "${AOM_ROOT}/test/tile_independence_test.cc")
-
- if (CONFIG_ANS)
+if (NOT BUILD_SHARED_LIBS)
+ if (CONFIG_AV1_DECODER AND CONFIG_AV1_ENCODER)
set(AOM_UNIT_TEST_COMMON_SOURCES
${AOM_UNIT_TEST_COMMON_SOURCES}
- "${AOM_ROOT}/test/ans_codec_test.cc"
- "${AOM_ROOT}/test/ans_test.cc")
- else ()
- set(AOM_UNIT_TEST_COMMON_SOURCES
- ${AOM_UNIT_TEST_COMMON_SOURCES}
- "${AOM_ROOT}/test/boolcoder_test.cc")
- endif ()
+ "${AOM_ROOT}/test/binary_codes_test.cc"
+ "${AOM_ROOT}/test/divu_small_test.cc"
+ "${AOM_ROOT}/test/ethread_test.cc"
+ "${AOM_ROOT}/test/idct8x8_test.cc"
+ "${AOM_ROOT}/test/partial_idct_test.cc"
+ "${AOM_ROOT}/test/superframe_test.cc"
+ "${AOM_ROOT}/test/tile_independence_test.cc")
+
+ if (CONFIG_ANS)
+ set(AOM_UNIT_TEST_COMMON_SOURCES
+ ${AOM_UNIT_TEST_COMMON_SOURCES}
+ "${AOM_ROOT}/test/ans_codec_test.cc"
+ "${AOM_ROOT}/test/ans_test.cc")
+ else ()
+ set(AOM_UNIT_TEST_COMMON_SOURCES
+ ${AOM_UNIT_TEST_COMMON_SOURCES}
+ "${AOM_ROOT}/test/boolcoder_test.cc")
+ endif ()
- if (CONFIG_EXT_TILE)
- set(AOM_UNIT_TEST_COMMON_SOURCES
- ${AOM_UNIT_TEST_COMMON_SOURCES}
- "${AOM_ROOT}/test/av1_ext_tile_test.cc")
+ if (CONFIG_EXT_TILE)
+ set(AOM_UNIT_TEST_COMMON_SOURCES
+ ${AOM_UNIT_TEST_COMMON_SOURCES}
+ "${AOM_ROOT}/test/av1_ext_tile_test.cc")
+ endif ()
endif ()
endif ()
if (CONFIG_HIGHBITDEPTH)
- if (CONFIG_AV1_ENCODER)
+ if (CONFIG_AV1_ENCODER AND NOT BUILD_SHARED_LIBS)
set(AOM_UNIT_TEST_COMMON_INTRIN_SSE4_1
${AOM_UNIT_TEST_COMMON_INTRIN_SSE4_1}
"${AOM_ROOT}/test/av1_highbd_iht_test.cc"
@@ -242,6 +317,12 @@ if (CONFIG_HIGHBITDEPTH)
endif ()
if (CONFIG_UNIT_TESTS)
+ find_package(PythonInterp)
+ if (NOT PYTHONINTERP_FOUND)
+ message(WARNING "--- Unit tests disabled: Python not found.")
+ set(CONFIG_UNIT_TESTS 0)
+ endif ()
+
if (MSVC)
# Force static run time to avoid collisions with googletest.
include("${AOM_ROOT}/build/cmake/msvc_runtime.cmake")
@@ -249,6 +330,11 @@ if (CONFIG_UNIT_TESTS)
include_directories(
"${AOM_ROOT}/third_party/googletest/src/googletest/src"
"${AOM_ROOT}/third_party/googletest/src/googletest/include")
+
+ if (BUILD_SHARED_LIBS AND APPLE)
+ # Silence an RPATH warning.
+ set(CMAKE_MACOSX_RPATH 1)
+ endif ()
add_subdirectory("${AOM_ROOT}/third_party/googletest/src/googletest"
EXCLUDE_FROM_ALL)
@@ -263,55 +349,57 @@ endif ()
# exist before this function is called.
function (setup_aom_test_targets)
add_library(test_aom_common OBJECT ${AOM_UNIT_TEST_COMMON_SOURCES})
+ add_dependencies(test_aom_common aom)
if (CONFIG_AV1_DECODER)
add_library(test_aom_decoder OBJECT ${AOM_UNIT_TEST_DECODER_SOURCES})
+ add_dependencies(test_aom_decoder aom)
endif ()
if (CONFIG_AV1_ENCODER)
add_library(test_aom_encoder OBJECT ${AOM_UNIT_TEST_ENCODER_SOURCES})
+ add_dependencies(test_aom_encoder aom)
endif ()
- set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} test_aom_common test_aom_decoder
- test_aom_encoder PARENT_SCOPE)
-
add_executable(test_libaom ${AOM_UNIT_TEST_WRAPPER_SOURCES}
$<TARGET_OBJECTS:aom_common_app_util>
$<TARGET_OBJECTS:test_aom_common>)
if (CONFIG_AV1_DECODER)
- target_sources(test_libaom PUBLIC
+ target_sources(test_libaom PRIVATE
$<TARGET_OBJECTS:aom_decoder_app_util>
$<TARGET_OBJECTS:test_aom_decoder>)
if (CONFIG_DECODE_PERF_TESTS AND CONFIG_WEBM_IO)
- target_sources(test_libaom PUBLIC ${AOM_DECODE_PERF_TEST_SOURCES})
+ target_sources(test_libaom PRIVATE ${AOM_DECODE_PERF_TEST_SOURCES})
endif ()
endif ()
if (CONFIG_AV1_ENCODER)
- target_sources(test_libaom PUBLIC
+ target_sources(test_libaom PRIVATE
$<TARGET_OBJECTS:test_aom_encoder>
$<TARGET_OBJECTS:aom_encoder_app_util>)
if (CONFIG_ENCODE_PERF_TESTS)
- target_sources(test_libaom PUBLIC ${AOM_ENCODE_PERF_TEST_SOURCES})
+ target_sources(test_libaom PRIVATE ${AOM_ENCODE_PERF_TEST_SOURCES})
endif ()
- add_executable(test_intra_pred_speed
- ${AOM_TEST_INTRA_PRED_SPEED_SOURCES}
- $<TARGET_OBJECTS:aom_common_app_util>)
- target_link_libraries(test_intra_pred_speed ${AOM_LIB_LINK_TYPE} aom gtest)
+ if (NOT BUILD_SHARED_LIBS)
+ add_executable(test_intra_pred_speed
+ ${AOM_TEST_INTRA_PRED_SPEED_SOURCES}
+ $<TARGET_OBJECTS:aom_common_app_util>)
+ target_link_libraries(test_intra_pred_speed ${AOM_LIB_LINK_TYPE}
+ aom gtest)
+ endif ()
endif ()
target_link_libraries(test_libaom ${AOM_LIB_LINK_TYPE} aom gtest)
if (CONFIG_LIBYUV)
- target_sources(test_libaom PUBLIC $<TARGET_OBJECTS:yuv>)
+ target_sources(test_libaom PRIVATE $<TARGET_OBJECTS:yuv>)
endif ()
if (CONFIG_WEBM_IO)
- target_sources(test_libaom PUBLIC ${AOM_UNIT_TEST_WEBM_SOURCES}
- $<TARGET_OBJECTS:webm>)
+ target_sources(test_libaom PRIVATE $<TARGET_OBJECTS:webm>)
endif ()
if (HAVE_SSE2)
add_intrinsics_source_to_target("-msse2" "test_libaom"
@@ -331,11 +419,26 @@ function (setup_aom_test_targets)
endif ()
endif ()
endif ()
+ if (HAVE_AVX2)
+ add_intrinsics_source_to_target("-mavx2" "test_libaom"
+ "AOM_UNIT_TEST_COMMON_INTRIN_AVX2")
+ endif ()
if (HAVE_NEON)
add_intrinsics_source_to_target("${AOM_NEON_INTRIN_FLAG}" "test_libaom"
"AOM_UNIT_TEST_COMMON_INTRIN_NEON")
endif ()
+ if (NOT ENABLE_IDE_TEST_HOSTING)
+ if (MSVC OR XCODE)
+ # Skip creation of test data download and test run targets when generating
+ # for Visual Studio and Xcode unless the user explicitly requests IDE test
+ # hosting. This is done to make build cycles in the IDE tolerable when the
+ # IDE command for build project is used to build AOM. Default behavior in
+ # IDEs is to build all targets, and the test run takes hours.
+ return ()
+ endif ()
+ endif ()
+
make_test_data_lists("${AOM_UNIT_TEST_DATA_LIST_FILE}"
test_files test_file_checksums)
list(LENGTH test_files num_test_files)
@@ -366,8 +469,6 @@ function (setup_aom_test_targets)
set(num_test_targets 10)
endif ()
- # TODO(tomfinegan): This needs some work for MSVC and Xcode. Executable suffix
- # and config based executable output paths are the obvious issues.
math(EXPR max_shard_index "${num_test_targets} - 1")
foreach (shard_index RANGE ${max_shard_index})
set(test_name "test_${shard_index}")
@@ -382,15 +483,6 @@ function (setup_aom_test_targets)
endforeach ()
add_custom_target(runtests)
add_dependencies(runtests ${test_targets})
-
- if (MSVC)
- set_target_properties(${testdata_targets} PROPERTIES
- EXCLUDE_FROM_DEFAULT_BUILD TRUE)
- set_target_properties(${test_targets} PROPERTIES
- EXCLUDE_FROM_DEFAULT_BUILD TRUE)
- set_target_properties(testdata runtests PROPERTIES
- EXCLUDE_FROM_DEFAULT_BUILD TRUE)
- endif ()
endfunction ()
endif () # AOM_TEST_TEST_CMAKE_