blob: d3747b1e30a15c542e43bd9bfd62518f3d79c06d [file] [log] [blame]
Johann589bae82018-04-27 10:57:44 -07001#
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#
11if(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 )
18endif()
Tom Finegane9d70c92017-05-10 11:31:05 -070019
20set($ENV{GTEST_SHARD_INDEX} ${GTEST_SHARD_INDEX})
21set($ENV{GTEST_TOTAL_SHARDS} ${GTEST_TOTAL_SHARDS})
Tom Finegand5aff9d2017-07-13 13:02:38 -070022execute_process(COMMAND ${TEST_LIBAOM} RESULT_VARIABLE test_result)
23set(test_message "Test shard ${GTEST_SHARD_INDEX}/${GTEST_TOTAL_SHARDS} result")
24message("${test_message}: ${test_result}")
Tom Finegan71974112017-12-18 11:52:45 -080025
Johann589bae82018-04-27 10:57:44 -070026if(NOT "${test_result}" STREQUAL "0")
Tom Finegan71974112017-12-18 11:52:45 -080027 message(FATAL_ERROR "${test_message}: FAILED, non-zero exit code.")
Johann589bae82018-04-27 10:57:44 -070028endif()