[Lldb-commits] [lldb] ef733d9 - [lldb] Add targets for running test suite against Watch/TV/iPhone simulators

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 13 08:08:12 PDT 2020


Author: Raphael Isemann
Date: 2020-10-13T17:07:46+02:00
New Revision: ef733d9df486884aa33de9f5a9f6bade4e70f187

URL: https://github.com/llvm/llvm-project/commit/ef733d9df486884aa33de9f5a9f6bade4e70f187
DIFF: https://github.com/llvm/llvm-project/commit/ef733d9df486884aa33de9f5a9f6bade4e70f187.diff

LOG: [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

Added: 
    

Modified: 
    lldb/test/API/lit.cfg.py
    lldb/test/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/lit.cfg.py b/lldb/test/API/lit.cfg.py
index a4d4d83fd366..4bc31206c9f2 100644
--- a/lldb/test/API/lit.cfg.py
+++ b/lldb/test/API/lit.cfg.py
@@ -146,6 +146,20 @@ def delete_module_cache(path):
   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 @@ def delete_module_cache(path):
     '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]

diff  --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt
index 21d8c61f11ed..91665e7b6666 100644
--- a/lldb/test/CMakeLists.txt
+++ b/lldb/test/CMakeLists.txt
@@ -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 
diff erent 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)


        


More information about the lldb-commits mailing list