mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-01-01 20:24:36 +01:00
Squashed 'externals/catch/' content from commit ab6c7375b
git-subtree-dir: externals/catch git-subtree-split: ab6c7375be9a8e71ee84c6f8537113f9f47daf99
This commit is contained in:
commit
6879e5bb1c
521 changed files with 182737 additions and 0 deletions
41
tests/TestScripts/testConfigureDefaultReporter.py
Normal file
41
tests/TestScripts/testConfigureDefaultReporter.py
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
# Copyright Catch2 Authors
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE.txt or copy at
|
||||
# https://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
# SPDX-License-Identifier: BSL-1.0
|
||||
|
||||
from ConfigureTestsCommon import configure_and_build, run_and_return_output
|
||||
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
"""
|
||||
Tests the CMake configure option for CATCH_CONFIG_DEFAULT_REPORTER
|
||||
|
||||
Requires 2 arguments, path folder where the Catch2's main CMakeLists.txt
|
||||
exists, and path to where the output files should be stored.
|
||||
"""
|
||||
|
||||
if len(sys.argv) != 3:
|
||||
print('Wrong number of arguments: {}'.format(len(sys.argv)))
|
||||
print('Usage: {} catch2-top-level-dir base-build-output-dir'.format(sys.argv[0]))
|
||||
exit(1)
|
||||
|
||||
catch2_source_path = os.path.abspath(sys.argv[1])
|
||||
build_dir_path = os.path.join(os.path.abspath(sys.argv[2]), 'CMakeConfigTests', 'DefaultReporter')
|
||||
|
||||
configure_and_build(catch2_source_path,
|
||||
build_dir_path,
|
||||
[("CATCH_CONFIG_DEFAULT_REPORTER", "xml")])
|
||||
|
||||
stdout, _ = run_and_return_output(os.path.join(build_dir_path, 'tests'), 'SelfTest', ['[approx][custom]'])
|
||||
|
||||
xml_tag = '</Catch2TestRun>'
|
||||
if xml_tag not in stdout:
|
||||
print("Could not find '{}' in the stdout".format(xml_tag))
|
||||
print('stdout: "{}"'.format(stdout))
|
||||
exit(2)
|
||||
Loading…
Add table
Add a link
Reference in a new issue