[lldb] Add targets for running test suite against Watch/TV/iPhone simulators

This patch adds several build system targets that run the normal test suite but
against the Watch/TV/iPhone simulators.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D89224
This commit is contained in:
Raphael Isemann 2020-10-13 16:50:40 +02:00
parent 388fb67b0d
commit ef733d9df4
2 changed files with 47 additions and 0 deletions

View File

@ -146,6 +146,20 @@ if lldb_repro_mode:
elif lldb_repro_mode == 'replay':
config.available_features.add('lldb-repro-replay')
lldb_use_simulator = lit_config.params.get('lldb-run-with-simulator', None)
if lldb_use_simulator:
if lldb_use_simulator == "ios":
lit_config.note("Running API tests on iOS simulator")
config.available_features.add('lldb-simulator-ios')
elif lldb_use_simulator == "watchos":
lit_config.note("Running API tests on watchOS simulator")
config.available_features.add('lldb-simulator-watchos')
elif lldb_use_simulator == "tvos":
lit_config.note("Running API tests on tvOS simulator")
config.available_features.add('lldb-simulator-tvos')
else:
lit_config.error("Unknown simulator id '{}'".format(lldb_use_simulator))
# Set a default per-test timeout of 10 minutes. Setting a timeout per test
# requires that killProcessAndChildren() is supported on the platform and
# lit complains if the value is set but it is not supported.
@ -216,6 +230,16 @@ if 'lldb-repro-capture' in config.available_features or \
'lldb-repro-replay' in config.available_features:
dotest_cmd += ['--skip-category=lldb-vscode', '--skip-category=std-module']
if 'lldb-simulator-ios' in config.available_features:
dotest_cmd += ['--apple-sdk', 'iphonesimulator',
'--platform-name', 'ios-simulator']
elif 'lldb-simulator-watchos' in config.available_features:
dotest_cmd += ['--apple-sdk', 'watchsimulator',
'--platform-name', 'watchos-simulator']
elif 'lldb-simulator-tvos' in config.available_features:
dotest_cmd += ['--apple-sdk', 'appletvsimulator',
'--platform-name', 'tvos-simulator']
if is_configured('enabled_plugins'):
for plugin in config.enabled_plugins:
dotest_cmd += ['--enable-plugin', plugin]

View File

@ -214,6 +214,29 @@ add_lit_testsuite(check-lldb-reproducers
DEPENDS lldb-test-deps)
add_dependencies(check-lldb-reproducers check-lldb-reproducers-capture)
# Targets for running the test suite on the different Apple simulators.
add_lit_testsuite(check-lldb-simulator-ios
"Running lldb test suite on the iOS simulator"
${CMAKE_CURRENT_BINARY_DIR}/API
PARAMS "lldb-run-with-simulator=ios"
EXCLUDE_FROM_CHECK_ALL
DEPENDS lldb-test-deps)
add_lit_testsuite(check-lldb-simulator-watchos
"Running lldb test suite on the watchOS simulator"
${CMAKE_CURRENT_BINARY_DIR}/API
PARAMS "lldb-run-with-simulator=watchos"
EXCLUDE_FROM_CHECK_ALL
DEPENDS lldb-test-deps)
add_lit_testsuite(check-lldb-simulator-tvos
"Running lldb test suite on the tvOS simulator"
${CMAKE_CURRENT_BINARY_DIR}/API
PARAMS "lldb-run-with-simulator=tvos"
EXCLUDE_FROM_CHECK_ALL
DEPENDS lldb-test-deps)
if(LLDB_BUILT_STANDALONE)
# This has to happen *AFTER* add_lit_testsuite.
if (EXISTS ${LLVM_MAIN_SRC_DIR}/utils/llvm-lit)