test_runner.cmake (1160B)
1 # 2 # Copyright (c) 2017, Alliance for Open Media. All rights reserved. 3 # 4 # This source code is subject to the terms of the BSD 2 Clause License and the 5 # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 # not distributed with this source code in the LICENSE file, you can obtain it 7 # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 # License 1.0 was not distributed with this source code in the PATENTS file, you 9 # can obtain it at www.aomedia.org/license/patent. 10 # 11 if(NOT GTEST_TOTAL_SHARDS 12 OR "${GTEST_SHARD_INDEX}" STREQUAL "" 13 OR NOT TEST_LIBAOM) 14 message( 15 FATAL_ERROR 16 "The variables GTEST_SHARD_INDEX, GTEST_TOTAL_SHARDS and TEST_LIBAOM 17 must be defined.") 18 endif() 19 20 set($ENV{GTEST_SHARD_INDEX} ${GTEST_SHARD_INDEX}) 21 set($ENV{GTEST_TOTAL_SHARDS} ${GTEST_TOTAL_SHARDS}) 22 execute_process(COMMAND ${TEST_LIBAOM} RESULT_VARIABLE test_result) 23 set(test_message "Test shard ${GTEST_SHARD_INDEX}/${GTEST_TOTAL_SHARDS} result") 24 message("${test_message}: ${test_result}") 25 26 if(NOT "${test_result}" STREQUAL "0") 27 message(FATAL_ERROR "${test_message}: FAILED, non-zero exit code.") 28 endif()