Commit d1cbd8c0 authored by Tom Finegan's avatar Tom Finegan

Use target file name generator exp in CMake test rules.

BUG=aomedia:76,aomedia:549

Change-Id: I692f4ad86061e53f9dc4b9a45d4dd9a8bd0d82d5
parent 770e6563
......@@ -364,11 +364,9 @@ function (setup_aom_test_targets)
set(test_name "test_${shard_index}")
add_custom_target(${test_name}
COMMAND ${CMAKE_COMMAND}
-DAOM_CONFIG_DIR="${AOM_CONFIG_DIR}"
-DAOM_ROOT="${AOM_ROOT}"
-DAOM_TEST_TARGET=test_libaom
-DGTEST_SHARD_INDEX=${shard_index}
-DGTEST_TOTAL_SHARDS=${num_test_targets}
-DTEST_LIBAOM=$<TARGET_FILE:test_libaom>
-P "${AOM_ROOT}/test/test_runner.cmake"
DEPENDS testdata test_libaom)
set(test_targets ${test_targets} ${test_name})
......@@ -378,13 +376,10 @@ function (setup_aom_test_targets)
if (MSVC)
set_target_properties(${testdata_targets} PROPERTIES
EXCLUDE_FROM_ALL TRUE
EXCLUDE_FROM_DEFAULT_BUILD TRUE)
set_target_properties(${test_targets} PROPERTIES
EXCLUDE_FROM_ALL TRUE
EXCLUDE_FROM_DEFAULT_BUILD TRUE)
set_target_properties(testdata runtests PROPERTIES
EXCLUDE_FROM_ALL TRUE
EXCLUDE_FROM_DEFAULT_BUILD TRUE)
endif ()
endfunction ()
......@@ -8,13 +8,13 @@
## Media Patent License 1.0 was not distributed with this source code in the
## PATENTS file, you can obtain it at www.aomedia.org/license/patent.
##
if (NOT AOM_ROOT OR NOT AOM_CONFIG_DIR OR NOT AOM_TEST_TARGET
OR NOT GTEST_TOTAL_SHARDS OR "${GTEST_SHARD_INDEX}" STREQUAL "")
if (NOT GTEST_TOTAL_SHARDS OR "${GTEST_SHARD_INDEX}" STREQUAL ""
OR NOT TEST_LIBAOM)
message(FATAL_ERROR
"The variables AOM_ROOT AOM_CONFIG_DIR AOM_TEST_TARGET
GTEST_SHARD_INDEX and GTEST_TOTAL_SHARDS must be defined.")
"The variables GTEST_SHARD_INDEX, GTEST_TOTAL_SHARDS and TEST_LIBAOM
must be defined.")
endif ()
set($ENV{GTEST_SHARD_INDEX} ${GTEST_SHARD_INDEX})
set($ENV{GTEST_TOTAL_SHARDS} ${GTEST_TOTAL_SHARDS})
execute_process(COMMAND ${AOM_CONFIG_DIR}/${AOM_TEST_TARGET})
execute_process(COMMAND ${TEST_LIBAOM})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment