Johann | 589bae8 | 2018-04-27 10:57:44 -0700 | [diff] [blame] | 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 OR "${GTEST_SHARD_INDEX}" STREQUAL "" OR NOT |
| 12 | TEST_LIBAOM) |
| 13 | message( |
| 14 | FATAL_ERROR |
| 15 | "The variables GTEST_SHARD_INDEX, GTEST_TOTAL_SHARDS and TEST_LIBAOM |
| 16 | must be defined." |
| 17 | ) |
| 18 | endif() |
Tom Finegan | e9d70c9 | 2017-05-10 11:31:05 -0700 | [diff] [blame] | 19 | |
| 20 | set($ENV{GTEST_SHARD_INDEX} ${GTEST_SHARD_INDEX}) |
| 21 | set($ENV{GTEST_TOTAL_SHARDS} ${GTEST_TOTAL_SHARDS}) |
Tom Finegan | d5aff9d | 2017-07-13 13:02:38 -0700 | [diff] [blame] | 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}") |
Tom Finegan | 7197411 | 2017-12-18 11:52:45 -0800 | [diff] [blame] | 25 | |
Johann | 589bae8 | 2018-04-27 10:57:44 -0700 | [diff] [blame] | 26 | if(NOT "${test_result}" STREQUAL "0") |
Tom Finegan | 7197411 | 2017-12-18 11:52:45 -0800 | [diff] [blame] | 27 | message(FATAL_ERROR "${test_message}: FAILED, non-zero exit code.") |
Johann | 589bae8 | 2018-04-27 10:57:44 -0700 | [diff] [blame] | 28 | endif() |