This revision was automatically updated to reflect the committed changes.
Closed by commit rG22314179f066: [test] Split LLDB tests into API, Shell & 
Unit (authored by JDevlieghere).

Changed prior to commit:
  https://reviews.llvm.org/D68606?vs=224072&id=224087#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68606/new/

https://reviews.llvm.org/D68606

Files:
  lldb/CMakeLists.txt
  lldb/lit/Breakpoint/Inputs/case-sensitive.c
  lldb/lit/Breakpoint/Inputs/debug_addrx.yaml
  lldb/lit/Breakpoint/Inputs/debug_rnglist_basic.yaml
  lldb/lit/Breakpoint/Inputs/debug_rnglist_offset_pair.yaml
  lldb/lit/Breakpoint/Inputs/debug_rnglist_rlestartend.yaml
  lldb/lit/Breakpoint/Inputs/debug_rnglistx_rlex.yaml
  lldb/lit/Breakpoint/Inputs/implicit_const_form_support.yaml
  lldb/lit/Breakpoint/Inputs/jitbp.cpp
  lldb/lit/Breakpoint/Inputs/ppc64-localentry.s
  lldb/lit/Breakpoint/Inputs/single-file-split-dwarf.o.yaml
  lldb/lit/Breakpoint/Inputs/single-file-split-dwarf.yaml
  lldb/lit/Breakpoint/Inputs/split-dwarf-5-addrbase.dwo.yaml
  lldb/lit/Breakpoint/Inputs/split-dwarf-5-addrbase.yaml
  lldb/lit/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file1.dwo.yaml
  lldb/lit/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-file2.dwo.yaml
  lldb/lit/Breakpoint/Inputs/split-dwarf5-debug-stroffsets-main.yaml
  lldb/lit/Breakpoint/case-insensitive.test
  lldb/lit/Breakpoint/case-sensitive.test
  lldb/lit/Breakpoint/debug_addrx.test
  lldb/lit/Breakpoint/debug_rnglist_basic.test
  lldb/lit/Breakpoint/debug_rnglist_offset_pair.test
  lldb/lit/Breakpoint/debug_rnglist_rlestartend.test
  lldb/lit/Breakpoint/debug_rnglistx_rlex.test
  lldb/lit/Breakpoint/implicit_const_form_support.test
  lldb/lit/Breakpoint/jitbp_elf.test
  lldb/lit/Breakpoint/ppc64-localentry.test
  lldb/lit/Breakpoint/single-file-split-dwarf.test
  lldb/lit/Breakpoint/split-dwarf-5-addrbase.test
  lldb/lit/Breakpoint/split-dwarf5-debug-stroffsets.test
  lldb/lit/BuildScript/compiler-full-path.test
  lldb/lit/BuildScript/modes.test
  lldb/lit/BuildScript/script-args.test
  lldb/lit/BuildScript/toolchain-clang-cl.test
  lldb/lit/BuildScript/toolchain-clang.test
  lldb/lit/BuildScript/toolchain-msvc.test
  lldb/lit/CMakeLists.txt
  
lldb/lit/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputConsole.test
  
lldb/lit/Commands/CommandScriptImmediateOutput/CommandScriptImmediateOutputFile.test
  lldb/lit/Commands/CommandScriptImmediateOutput/Inputs/custom_command.py
  lldb/lit/Commands/CommandScriptImmediateOutput/lit.local.cfg
  lldb/lit/Commands/Inputs/frame.py
  lldb/lit/Commands/Inputs/main.c
  lldb/lit/Commands/command-backtrace.test
  lldb/lit/Commands/command-regex-delete.test
  lldb/lit/Commands/command-regex-unalias.test
  lldb/lit/Commands/command-script-import.test
  lldb/lit/Commands/command-source.test
  lldb/lit/Driver/Inputs/.lldbinit
  lldb/lit/Driver/Inputs/Print0.in
  lldb/lit/Driver/Inputs/Print2.in
  lldb/lit/Driver/Inputs/Print4.in
  lldb/lit/Driver/Inputs/Print6.in
  lldb/lit/Driver/Inputs/convenience.in
  lldb/lit/Driver/Inputs/hello.c
  lldb/lit/Driver/Inputs/hello.cpp
  lldb/lit/Driver/Inputs/process_attach_pid.in
  lldb/lit/Driver/Inputs/syntax_error.py
  lldb/lit/Driver/LocalLLDBInit.test
  lldb/lit/Driver/TestCommands.test
  lldb/lit/Driver/TestConvenienceVariables.test
  lldb/lit/Driver/TestCore.test
  lldb/lit/Driver/TestFile.test
  lldb/lit/Driver/TestNoUseColor.test
  lldb/lit/Driver/TestProcessAttach.test
  lldb/lit/Driver/TestRepl.test
  lldb/lit/Driver/TestSingleQuote.test
  lldb/lit/Driver/TestTarget.test
  lldb/lit/ExecControl/StopHook/Inputs/stop-hook-1.lldbinit
  lldb/lit/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit
  lldb/lit/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit
  lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit
  lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit
  lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads.cpp
  lldb/lit/ExecControl/StopHook/Inputs/stop-hook.c
  lldb/lit/ExecControl/StopHook/stop-hook-threads.test
  lldb/lit/ExecControl/StopHook/stop-hook.test
  lldb/lit/Expr/Inputs/call-function.cpp
  lldb/lit/Expr/Inputs/ir-memory-map-basic
  lldb/lit/Expr/Inputs/ir-memory-map-mix-malloc-free
  lldb/lit/Expr/Inputs/ir-memory-map-overlap1
  lldb/lit/Expr/TestIRMemoryMap.test
  lldb/lit/Expr/TestIRMemoryMapWindows.test
  lldb/lit/Expr/TestMultilineExpr.test
  lldb/lit/Expr/TestTypeOfDeclTypeExpr.test
  lldb/lit/Heap/Inputs/cstr.c
  lldb/lit/Heap/heap-cstr.test
  lldb/lit/Host/Inputs/simple.c
  lldb/lit/Host/TestCustomShell.test
  lldb/lit/Minidump/Inputs/linux-x86_64.syms
  lldb/lit/Minidump/Inputs/linux-x86_64.yaml
  lldb/lit/Minidump/Windows/Inputs/find-module.dmp.yaml
  lldb/lit/Minidump/Windows/Inputs/find-module.exe.yaml
  lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.cpp
  lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.dmp
  lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.lldbinit
  lldb/lit/Minidump/Windows/Sigsegv/Inputs/sigsegv.pdb
  lldb/lit/Minidump/Windows/Sigsegv/sigsegv.test
  lldb/lit/Minidump/Windows/find-module.test
  lldb/lit/Minidump/breakpad-symbols.test
  lldb/lit/Minidump/disassemble-no-module.yaml
  lldb/lit/Minidump/dump-all.test
  lldb/lit/Minidump/fb-dump.test
  lldb/lit/Minidump/lit.local.cfg
  lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-1.syms
  lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-2.syms
  lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-3.syms
  lldb/lit/ObjectFile/Breakpad/Inputs/discontiguous-sections.syms
  lldb/lit/ObjectFile/Breakpad/Inputs/identification-linux.syms
  lldb/lit/ObjectFile/Breakpad/Inputs/identification-macosx-arm64e.syms
  lldb/lit/ObjectFile/Breakpad/Inputs/identification-macosx.syms
  lldb/lit/ObjectFile/Breakpad/Inputs/identification-windows.syms
  lldb/lit/ObjectFile/Breakpad/Inputs/sections-trailing-func.syms
  lldb/lit/ObjectFile/Breakpad/Inputs/sections.syms
  lldb/lit/ObjectFile/Breakpad/Inputs/uuid-matching-mac.syms
  lldb/lit/ObjectFile/Breakpad/Inputs/uuid-matching-mac.yaml
  lldb/lit/ObjectFile/Breakpad/breakpad-identification.test
  lldb/lit/ObjectFile/Breakpad/discontiguous-sections.test
  lldb/lit/ObjectFile/Breakpad/lit.local.cfg
  lldb/lit/ObjectFile/Breakpad/sections-trailing-func.test
  lldb/lit/ObjectFile/Breakpad/sections.test
  lldb/lit/ObjectFile/Breakpad/uuid-matching-mac.test
  lldb/lit/ObjectFile/ELF/Inputs/PT_LOAD-overlap-section.elf
  lldb/lit/ObjectFile/ELF/Inputs/minidebuginfo-main.c
  lldb/lit/ObjectFile/ELF/Inputs/netbsd-amd64.core
  lldb/lit/ObjectFile/ELF/PT_LOAD-empty.yaml
  lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-PT_INTERP.yaml
  lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-PT_TLS.yaml
  lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-section.yaml
  lldb/lit/ObjectFile/ELF/PT_LOAD-overlap.yaml
  lldb/lit/ObjectFile/ELF/PT_LOAD.yaml
  lldb/lit/ObjectFile/ELF/PT_TLS-overlap-PT_LOAD.yaml
  lldb/lit/ObjectFile/ELF/aarch64-relocations.yaml
  lldb/lit/ObjectFile/ELF/base-address.yaml
  lldb/lit/ObjectFile/ELF/basic-info.yaml
  lldb/lit/ObjectFile/ELF/build-id-case.yaml
  lldb/lit/ObjectFile/ELF/compressed-sections.yaml
  lldb/lit/ObjectFile/ELF/duplicate-section.yaml
  lldb/lit/ObjectFile/ELF/gnu-debuglink.yaml
  lldb/lit/ObjectFile/ELF/many-sections.s
  lldb/lit/ObjectFile/ELF/minidebuginfo-corrupt-xz.yaml
  lldb/lit/ObjectFile/ELF/minidebuginfo-find-symbols.yaml
  lldb/lit/ObjectFile/ELF/minidebuginfo-no-lzma.yaml
  lldb/lit/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test
  lldb/lit/ObjectFile/ELF/netbsd-core-amd64.test
  lldb/lit/ObjectFile/ELF/netbsd-exec-8.99.30-amd64.yaml
  lldb/lit/ObjectFile/ELF/section-addresses.yaml
  lldb/lit/ObjectFile/ELF/section-overlap.yaml
  lldb/lit/ObjectFile/ELF/section-permissions.yaml
  lldb/lit/ObjectFile/ELF/section-types-edgecases.yaml
  lldb/lit/ObjectFile/ELF/section-types.yaml
  lldb/lit/ObjectFile/ELF/short-build-id.yaml
  lldb/lit/ObjectFile/MachO/lc_build_version.yaml
  lldb/lit/ObjectFile/MachO/lc_build_version_notools.yaml
  lldb/lit/ObjectFile/MachO/lc_version_min.yaml
  lldb/lit/ObjectFile/MachO/subsections.yaml
  lldb/lit/ObjectFile/MachO/symtab.yaml
  lldb/lit/ObjectFile/PECOFF/basic-info-arm.yaml
  lldb/lit/ObjectFile/PECOFF/basic-info-arm64.yaml
  lldb/lit/ObjectFile/PECOFF/basic-info.yaml
  lldb/lit/ObjectFile/PECOFF/dep-modules.yaml
  lldb/lit/ObjectFile/PECOFF/export-dllfunc.yaml
  lldb/lit/ObjectFile/PECOFF/lit.local.cfg
  lldb/lit/ObjectFile/PECOFF/sections-names.yaml
  lldb/lit/ObjectFile/PECOFF/subsections.yaml
  lldb/lit/ObjectFile/PECOFF/uuid.yaml
  lldb/lit/ObjectFile/lit.local.cfg
  lldb/lit/Process/Inputs/env.cpp
  lldb/lit/Process/TestEnvironment.test
  lldb/lit/Process/Windows/exception_access_violation.cpp
  lldb/lit/Python/crashlog.test
  lldb/lit/Quit/TestQuitExitCode-30.test
  lldb/lit/Quit/TestQuitExitCode0.test
  lldb/lit/Quit/TestQuitExitCode30.test
  lldb/lit/Quit/TestQuitExitCodeHex0.test
  lldb/lit/Quit/TestQuitExitCodeHexA.test
  lldb/lit/Quit/TestQuitExitCodeImplicit0.test
  lldb/lit/Quit/TestQuitExitCodeNonInt.test
  lldb/lit/Quit/TestQuitExitCodeTooManyArgs.test
  lldb/lit/Quit/expect_exit_code.py
  lldb/lit/Register/Inputs/x86-64-gp-read.cpp
  lldb/lit/Register/Inputs/x86-64-gp-write.cpp
  lldb/lit/Register/Inputs/x86-64-read.cpp
  lldb/lit/Register/Inputs/x86-64-write.cpp
  lldb/lit/Register/Inputs/x86-gp-read.cpp
  lldb/lit/Register/Inputs/x86-gp-write.cpp
  lldb/lit/Register/Inputs/x86-mm-xmm-read.cpp
  lldb/lit/Register/Inputs/x86-mm-xmm-write.cpp
  lldb/lit/Register/Inputs/x86-ymm-read.cpp
  lldb/lit/Register/Inputs/x86-ymm-write.cpp
  lldb/lit/Register/Inputs/x86-zmm-read.cpp
  lldb/lit/Register/Inputs/x86-zmm-write.cpp
  lldb/lit/Register/x86-64-gp-read.test
  lldb/lit/Register/x86-64-gp-write.test
  lldb/lit/Register/x86-64-read.test
  lldb/lit/Register/x86-64-write.test
  lldb/lit/Register/x86-64-xmm16-read.test
  lldb/lit/Register/x86-64-xmm16-write.test
  lldb/lit/Register/x86-64-ymm-read.test
  lldb/lit/Register/x86-64-ymm-write.test
  lldb/lit/Register/x86-64-ymm16-read.test
  lldb/lit/Register/x86-64-ymm16-write.test
  lldb/lit/Register/x86-64-zmm-read.test
  lldb/lit/Register/x86-64-zmm-write.test
  lldb/lit/Register/x86-gp-read.test
  lldb/lit/Register/x86-gp-write.test
  lldb/lit/Register/x86-mm-xmm-read.test
  lldb/lit/Register/x86-mm-xmm-write.test
  lldb/lit/Register/x86-ymm-read.test
  lldb/lit/Register/x86-ymm-write.test
  lldb/lit/Register/x86-zmm-read.test
  lldb/lit/Register/x86-zmm-write.test
  lldb/lit/Reproducer/Functionalities/Inputs/DataFormatter.in
  lldb/lit/Reproducer/Functionalities/Inputs/foo.cpp
  lldb/lit/Reproducer/Functionalities/Inputs/stepping.c
  lldb/lit/Reproducer/Functionalities/TestDataFormatter.test
  lldb/lit/Reproducer/Functionalities/TestImageList.test
  lldb/lit/Reproducer/Functionalities/TestStepping.test
  lldb/lit/Reproducer/Inputs/FileCapture.in
  lldb/lit/Reproducer/Inputs/GDBRemoteCapture.in
  lldb/lit/Reproducer/Inputs/simple.c
  lldb/lit/Reproducer/Modules/Inputs/Bar.h
  lldb/lit/Reproducer/Modules/Inputs/Foo.h
  lldb/lit/Reproducer/Modules/Inputs/ModuleCXX.in
  lldb/lit/Reproducer/Modules/Inputs/main.cpp
  lldb/lit/Reproducer/Modules/Inputs/module.modulemap
  lldb/lit/Reproducer/Modules/TestModuleCXX.test
  lldb/lit/Reproducer/TestDriverOptions.test
  lldb/lit/Reproducer/TestDump.test
  lldb/lit/Reproducer/TestFileRepro.test
  lldb/lit/Reproducer/TestGDBRemoteRepro.test
  lldb/lit/Reproducer/TestRelativePath.test
  lldb/lit/Reproducer/TestReuseDirectory.test
  lldb/lit/Reproducer/TestSynchronous.test
  lldb/lit/Settings/Inputs/DontStopCommandSource.in
  lldb/lit/Settings/Inputs/EchoCommandsAll.out
  lldb/lit/Settings/Inputs/EchoCommandsNoComments.out
  lldb/lit/Settings/Inputs/EchoCommandsNone.out
  lldb/lit/Settings/Inputs/EchoCommandsQuiet.out
  lldb/lit/Settings/Inputs/EchoCommandsTest.in
  lldb/lit/Settings/Inputs/StopCommandSource.in
  lldb/lit/Settings/Inputs/main.c
  lldb/lit/Settings/TestDisableColor.test
  lldb/lit/Settings/TestDisassemblyFormat.test
  lldb/lit/Settings/TestEchoCommands.test
  lldb/lit/Settings/TestFrameFormatColor.test
  lldb/lit/Settings/TestFrameFormatNoColor.test
  lldb/lit/Settings/TestModuleCacheSanity.test
  lldb/lit/Settings/TestSettingsSet.test
  lldb/lit/Settings/TestSettingsWrite.test
  (641 more files...)

Index: lldb/test/lit.cfg.py
===================================================================
--- /dev/null
+++ lldb/test/lit.cfg.py
@@ -0,0 +1,41 @@
+# -*- Python -*-
+
+import os
+import platform
+import re
+import shutil
+import site
+import sys
+
+import lit.formats
+from lit.llvm import llvm_config
+from lit.llvm.subst import FindTool
+from lit.llvm.subst import ToolSubst
+from distutils.spawn import find_executable
+
+# This is the top level configuration. Most of these configuration options will
+# be overriden by individual lit configuration files in the test
+# subdirectories.
+
+# name: The name of this test suite.
+config.name = 'lldb'
+
+# testFormat: The test format to use to interpret tests.
+config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)
+
+# suffixes: A list of file extensions to treat as test files. This is overriden
+# by individual lit.local.cfg files in the test subdirectories.
+config.suffixes = ['.test', '.cpp', '.s']
+
+# excludes: A list of directories to exclude from the testsuite. The 'Inputs'
+# subdirectories contain auxiliary inputs for various tests in their parent
+# directories.
+config.excludes = ['Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt']
+
+# test_source_root: The root path where tests are located.
+config.test_source_root = os.path.dirname(__file__)
+
+# test_exec_root: The root path where tests should be run.
+config.test_exec_root = os.path.join(config.lldb_obj_root, 'test')
+
+llvm_config.use_default_substitutions()
Index: lldb/test/Unit/lit.site.cfg.py.in
===================================================================
--- lldb/test/Unit/lit.site.cfg.py.in
+++ lldb/test/Unit/lit.site.cfg.py.in
@@ -26,4 +26,4 @@
 lit.llvm.initialize(lit_config, config)
 
 # Let the main config do the real work.
-lit_config.load_config(config, "@LLDB_SOURCE_DIR@/lit/Unit/lit.cfg.py")
+lit_config.load_config(config, "@LLDB_SOURCE_DIR@/test/Unit/lit.cfg.py")
Index: lldb/test/Unit/lit.cfg.py
===================================================================
--- lldb/test/Unit/lit.cfg.py
+++ lldb/test/Unit/lit.cfg.py
@@ -9,7 +9,7 @@
 from lit.llvm import llvm_config
 
 # name: The name of this test suite.
-config.name = 'lldb-Unit'
+config.name = 'lldb-unit'
 
 # suffixes: A list of file extensions to treat as test files.
 config.suffixes =  []
Index: lldb/test/Unit/README.md
===================================================================
--- /dev/null
+++ lldb/test/Unit/README.md
@@ -0,0 +1,4 @@
+# LLDB Unit Tests
+
+This directory only exists for the lit test driver. The actual tests live in
+the `unittest` directory in top level LLDB directory.
Index: lldb/test/Shell/lit.site.cfg.py.in
===================================================================
--- lldb/test/Shell/lit.site.cfg.py.in
+++ lldb/test/Shell/lit.site.cfg.py.in
@@ -41,4 +41,4 @@
 lit.llvm.initialize(lit_config, config)
 
 # Let the main config do the real work.
-lit_config.load_config(config, "@LLDB_SOURCE_DIR@/lit/lit.cfg.py")
+lit_config.load_config(config, "@LLDB_SOURCE_DIR@/test/Shell/lit.cfg.py")
Index: lldb/test/Shell/lit.cfg.py
===================================================================
--- lldb/test/Shell/lit.cfg.py
+++ lldb/test/Shell/lit.cfg.py
@@ -17,7 +17,7 @@
 from helper import toolchain
 
 # name: The name of this test suite.
-config.name = 'LLDB'
+config.name = 'lldb-shell'
 
 # testFormat: The test format to use to interpret tests.
 config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)
@@ -35,7 +35,7 @@
 config.test_source_root = os.path.dirname(__file__)
 
 # test_exec_root: The root path where tests should be run.
-config.test_exec_root = os.path.join(config.lldb_obj_root, 'lit')
+config.test_exec_root = os.path.join(config.lldb_obj_root, 'test')
 
 
 llvm_config.use_default_substitutions()
Index: lldb/test/Shell/helper/toolchain.py
===================================================================
--- lldb/test/Shell/helper/toolchain.py
+++ lldb/test/Shell/helper/toolchain.py
@@ -29,7 +29,7 @@
     if config.llvm_libs_dir:
         build_script_args.append('--libs-dir={0}'.format(config.llvm_libs_dir))
 
-    lldb_init = os.path.join(config.test_exec_root, 'lit-lldb-init')
+    lldb_init = os.path.join(config.test_exec_root, 'Shell', 'lit-lldb-init')
 
     primary_tools = [
         ToolSubst('%lldb',
Index: lldb/test/Shell/Python/crashlog.test
===================================================================
--- lldb/test/Shell/Python/crashlog.test
+++ lldb/test/Shell/Python/crashlog.test
@@ -1,6 +1,6 @@
 #                                                                 -*- python -*-
 # REQUIRES: system-darwin
-# RUN: cd %S/../../examples/python && cat %s | %lldb | FileCheck %s
+# RUN: cd %S/../../../examples/python && cat %s | %lldb | FileCheck %s
 # CHECK-LABEL: {{S}}KIP BEYOND CHECKS
 script
 import crashlog
@@ -44,7 +44,7 @@
 # CHECK: (0)
 # CHECK: 01234
 # CHECK: /tmp/MyApp Pro.app/MyApp Pro
-    
+
 "0x7fff63f20000 - 0x7fff63f77ff7  libc++.1.dylib (400.9.4) /usr/lib/libc++.1.dylib"
 # CHECK: 0x7fff63f20000
 # CHECK: 0x7fff63f77ff7
Index: lldb/test/API/lit.site.cfg.in
===================================================================
--- lldb/test/API/lit.site.cfg.in
+++ lldb/test/API/lit.site.cfg.in
@@ -20,7 +20,7 @@
 config.lldb_module_cache = "@LLDB_TEST_MODULE_CACHE_LLDB@"
 config.clang_module_cache = "@LLDB_TEST_MODULE_CACHE_CLANG@"
 config.python_executable = "@PYTHON_EXECUTABLE@"
-config.dotest_path = "@LLDB_SOURCE_DIR@/test/dotest.py"
+config.dotest_path = "@LLDB_SOURCE_DIR@/test/API/dotest.py"
 config.dotest_args_str = "@LLDB_DOTEST_ARGS@"
 config.lldb_disable_python = @LLDB_DISABLE_PYTHON@
 config.dotest_lit_args_str = None
@@ -43,4 +43,4 @@
     lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))
 
 # Let the main config do the real work.
-lit_config.load_config(config, "@LLDB_SOURCE_DIR@/lit/Suite/lit.cfg")
+lit_config.load_config(config, "@LLDB_SOURCE_DIR@/test/API/lit.cfg")
Index: lldb/test/API/lit.cfg
===================================================================
--- lldb/test/API/lit.cfg
+++ lldb/test/API/lit.cfg
@@ -9,7 +9,7 @@
 import lit.formats
 
 # name: The name of this test suite.
-config.name = 'lldb-Suite'
+config.name = 'lldb-api'
 
 # suffixes: A list of file extensions to treat as test files.
 config.suffixes = ['.py']
@@ -73,7 +73,7 @@
   dotest_cmd += ['--module-cache-dir', config.lldb_module_cache]
 
 # Load LLDB test format.
-sys.path.append(os.path.join(config.lldb_src_root, "lit", "Suite"))
+sys.path.append(os.path.join(config.lldb_src_root, "test", "API"))
 import lldbtest
 
 # testFormat: The test format to use to interpret tests.
Index: lldb/test/API/README.md
===================================================================
--- /dev/null
+++ lldb/test/API/README.md
@@ -0,0 +1,4 @@
+# LLDB API Tests
+
+This directory only exists for the lit test driver. The actual tests live in
+the `tests` directory in top level LLDB directory.
Index: lldb/test/CMakeLists.txt
===================================================================
--- lldb/test/CMakeLists.txt
+++ lldb/test/CMakeLists.txt
@@ -1,149 +1,117 @@
-function(add_python_test_target name test_script args comment)
-  set(PYTHON_TEST_COMMAND
-    ${PYTHON_EXECUTABLE}
-    ${test_script}
-    ${args}
-    )
-
-  add_custom_target(${name}
-    COMMAND ${PYTHON_TEST_COMMAND} ${ARG_DEFAULT_ARGS}
-    COMMENT "${comment}"
-    USES_TERMINAL
-    )
-  add_dependencies(${name} lldb-test-deps)
-endfunction()
-
-# The default architecture with which to compile test executables is the default LLVM target
-# architecture, which itself defaults to the host architecture.
-string(TOLOWER "${LLVM_TARGET_ARCH}" LLDB_DEFAULT_TEST_ARCH)
-if( LLDB_DEFAULT_TEST_ARCH STREQUAL "host" )
-  string(REGEX MATCH "^[^-]*" LLDB_DEFAULT_TEST_ARCH ${LLVM_HOST_TRIPLE})
-endif ()
-
-# Allow the user to override the default by setting LLDB_TEST_ARCH
-set(LLDB_TEST_ARCH
-  ${LLDB_DEFAULT_TEST_ARCH}
-  CACHE STRING "Specify the architecture to run LLDB tests as (x86|x64).  Determines whether tests are compiled with -m32 or -m64")
-
-# Users can override LLDB_TEST_USER_ARGS to specify arbitrary arguments to pass to the script
-set(LLDB_TEST_USER_ARGS
-  ""
-  CACHE STRING "Specify additional arguments to pass to test runner. For example: '-C gcc -C clang -A i386 -A x86_64'")
-
-# The .noindex suffix is a marker for Spotlight to never index the
-# build directory.  LLDB queries Spotlight to locate .dSYM bundles
-# based on the UUID embedded in a binary, and because the UUID is a
-# hash of filename and .text section, there *will* be conflicts inside
-# the build directory.
-set(LLDB_TEST_COMMON_ARGS
-  --arch=${LLDB_TEST_ARCH}
-  -s
-  ${CMAKE_BINARY_DIR}/lldb-test-traces
-  -S nm
-  -u CXXFLAGS
-  -u CFLAGS
-  )
-
-list(APPEND LLDB_TEST_COMMON_ARGS
-  --executable ${LLDB_TEST_EXECUTABLE}
-  --dsymutil ${LLDB_TEST_DSYMUTIL}
-  --filecheck ${LLDB_TEST_FILECHECK}
-  -C ${LLDB_TEST_C_COMPILER}
-  )
-
-if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
-  # All tests are currently flaky on Windows, so rerun them all once when they fail.
-  set(LLDB_TEST_COMMON_ARGS ${LLDB_TEST_COMMON_ARGS} --rerun-all-issues)
-
-  set(LLDB_TEST_DEBUG_TEST_CRASHES
-    0
-    CACHE BOOL "(Windows only) Enables debugging of tests in the test suite by showing the crash dialog when lldb crashes")
+# Test runner infrastructure for LLDB. This configures the LLDB test trees
+# for use by Lit, and delegates to LLVM's lit test handlers.
 
-  set(LLDB_TEST_HIDE_CONSOLE_WINDOWS
-    1
-    CACHE BOOL "(Windows only) Hides the console window for an inferior when it is launched through the test suite")
+add_subdirectory(API)
 
-  if (LLDB_TEST_DEBUG_TEST_CRASHES)
-    set(LLDB_TEST_COMMON_ARGS ${LLDB_TEST_COMMON_ARGS} --enable-crash-dialog)
-  endif()
-
-  if (NOT LLDB_TEST_HIDE_CONSOLE_WINDOWS)
-    set(LLDB_TEST_COMMON_ARGS ${LLDB_TEST_COMMON_ARGS} --show-inferior-console)
-  endif()
-endif()
+# LLVM_BUILD_MODE is used in lit.site.cfg
+if (CMAKE_CFG_INTDIR STREQUAL ".")
+  set(LLVM_BUILD_MODE ".")
+else ()
+  set(LLVM_BUILD_MODE "%(build_mode)s")
+endif ()
 
-if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows|Darwin")
-  list(APPEND LLDB_TEST_COMMON_ARGS
-    --env ARCHIVER=${CMAKE_AR} --env OBJCOPY=${CMAKE_OBJCOPY})
+if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+  set(LLDB_IS_64_BITS 1)
 endif()
 
-if (NOT "${LLDB_LIT_TOOLS_DIR}" STREQUAL "")
-  if (NOT EXISTS "${LLDB_LIT_TOOLS_DIR}")
-    message(WARNING "LLDB_LIT_TOOLS_DIR ${LLDB_LIT_TOOLS_DIR} does not exist.")
+get_property(LLDB_DOTEST_ARGS GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY)
+set(dotest_args_replacement ${LLVM_BUILD_MODE})
+
+set(LLDB_TEST_MODULE_CACHE_LLDB "${LLDB_TEST_BUILD_DIRECTORY}/module-cache-lldb" CACHE PATH "The Clang module cache used by the Clang embedded in LLDB while running tests.")
+set(LLDB_TEST_MODULE_CACHE_CLANG "${LLDB_TEST_BUILD_DIRECTORY}/module-cache-clang" CACHE PATH "The Clang module cache used by the Clang while building tests.")
+
+if(LLDB_BUILT_STANDALONE)
+  # In paths to our build-tree, replace CMAKE_CFG_INTDIR with our configuration name placeholder.
+  string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} config_runtime_output_dir ${LLVM_RUNTIME_OUTPUT_INTDIR})
+  string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}")
+
+  # Remaining ones must be paths to the provided LLVM build-tree.
+  if(LLVM_CONFIGURATION_TYPES)
+    # LLDB uses single-config; LLVM multi-config; pick one and prefer Release types.
+    # Otherwise, if both use multi-config the default is fine.
+    if(NOT CMAKE_CONFIGURATION_TYPES)
+      if(RelWithDebInfo IN_LIST LLVM_CONFIGURATION_TYPES)
+        set(dotest_args_replacement RelWithDebInfo)
+      elseif(Release IN_LIST LLVM_CONFIGURATION_TYPES)
+        set(dotest_args_replacement Release)
+      else()
+        list(GET LLVM_CONFIGURATION_TYPES 0 dotest_args_replacement)
+      endif()
+    endif()
+  else()
+    # Common case: LLVM used a single-configuration generator like Ninja.
+    set(dotest_args_replacement ".")
   endif()
 endif()
 
-if(CMAKE_HOST_APPLE)
-  if(LLDB_BUILD_FRAMEWORK)
-    get_target_property(framework_build_dir liblldb LIBRARY_OUTPUT_DIRECTORY)
-    list(APPEND LLDB_TEST_COMMON_ARGS --framework ${framework_build_dir}/LLDB.framework)
-  endif()
-
-  # Use the same identity for testing
-  get_property(code_sign_identity_used GLOBAL PROPERTY LLDB_DEBUGSERVER_CODESIGN_IDENTITY)
-  if(code_sign_identity_used)
-    list(APPEND LLDB_TEST_COMMON_ARGS --codesign-identity "${code_sign_identity_used}")
-  endif()
+string(REPLACE ${CMAKE_CFG_INTDIR} ${dotest_args_replacement} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}")
+string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_LIBS_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
+string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
+
+add_lldb_test_dependency(
+  lit-cpuid
+  llc
+  lli
+  llvm-config
+  llvm-dwarfdump
+  llvm-nm
+  llvm-mc
+  llvm-objcopy
+  llvm-readobj
+  llvm-strip
+  )
 
-  if(LLDB_USE_SYSTEM_DEBUGSERVER)
-    lldb_find_system_debugserver(system_debugserver_path)
-    add_custom_target(debugserver
-      COMMAND ${CMAKE_COMMAND} -E copy_if_different
-      ${system_debugserver_path} ${LLVM_RUNTIME_OUTPUT_INTDIR}
-      COMMENT "Copying the system debugserver to LLDB's binaries directory for testing.")
-    # The custom target for the system debugserver has no install target, so we
-    # need to remove it from the LLVM_DISTRIBUTION_COMPONENTS list.
-    if (LLVM_DISTRIBUTION_COMPONENTS)
-      list(REMOVE_ITEM LLVM_DISTRIBUTION_COMPONENTS debugserver)
-      set(LLVM_DISTRIBUTION_COMPONENTS ${LLVM_DISTRIBUTION_COMPONENTS} PARENT_SCOPE)
-    endif()
-    message(STATUS "LLDB tests use out-of-tree debugserver: ${system_debugserver_path}")
-    list(APPEND LLDB_TEST_COMMON_ARGS --out-of-tree-debugserver)
-    add_lldb_test_dependency(debugserver)
-  elseif(TARGET debugserver)
-    set(debugserver_path ${LLVM_RUNTIME_OUTPUT_INTDIR}/debugserver)
-    message(STATUS "LLDB Tests use just-built debugserver: ${debugserver_path}")
-    list(APPEND LLDB_TEST_COMMON_ARGS --server ${debugserver_path})
-    add_lldb_test_dependency(debugserver)
-  elseif(TARGET lldb-server)
-    set(lldb_server_path ${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb-server)
-    message(STATUS "LLDB Tests use just-built lldb-server: ${lldb_server_path}")
-    list(APPEND LLDB_TEST_COMMON_ARGS --server ${lldb_server_path})
-    add_lldb_test_dependency(lldb-server)
-  else()
-    message(WARNING "LLDB Tests enabled, but no server available")
-  endif()
+if(TARGET lld)
+  add_lldb_test_dependency(lld)
 endif()
 
-set(LLDB_DOTEST_ARGS ${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS})
-set_property(GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY ${LLDB_DOTEST_ARGS})
+# the value is not canonicalized within LLVM
+llvm_canonicalize_cmake_booleans(
+  LLDB_DISABLE_PYTHON
+  LLVM_ENABLE_ZLIB
+  LLVM_ENABLE_SHARED_LIBS
+  LLDB_IS_64_BITS)
+
+configure_lit_site_cfg(
+  ${CMAKE_CURRENT_SOURCE_DIR}/Shell/lit.site.cfg.py.in
+  ${CMAKE_CURRENT_BINARY_DIR}/Shell/lit.site.cfg.py
+  MAIN_CONFIG
+  ${CMAKE_CURRENT_SOURCE_DIR}/Shell/lit.cfg.py)
+configure_lit_site_cfg(
+  ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in
+  ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py
+  MAIN_CONFIG
+  ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py)
+configure_lit_site_cfg(
+  ${CMAKE_CURRENT_SOURCE_DIR}/API/lit.site.cfg.in
+  ${CMAKE_CURRENT_BINARY_DIR}/API/lit.site.cfg)
+
+configure_file(
+  ${CMAKE_CURRENT_SOURCE_DIR}/Shell/lit-lldb-init.in
+  ${CMAKE_CURRENT_BINARY_DIR}/Shell/lit-lldb-init)
+
+if(NOT LLDB_BUILT_STANDALONE)
+  add_lldb_test_dependency(
+    FileCheck
+    count
+    not
+  )
+endif()
 
-add_custom_target(check-lldb)
-add_dependencies(check-lldb lldb-test-deps)
-set_target_properties(check-lldb PROPERTIES FOLDER "lldb misc")
+add_lit_testsuite(check-lldb-lit "Running lldb lit test suite"
+  ${CMAKE_CURRENT_BINARY_DIR}
+  DEPENDS lldb-test-deps
+  )
 
-# LLD is required to link test executables on Windows.
-if (CMAKE_SYSTEM_NAME MATCHES "Windows")
-  if (TARGET lld)
-    add_lldb_test_dependency(lld)
-  else ()
-    message(WARNING "lld required to test LLDB on Windows")
-  endif ()
-endif ()
+set_target_properties(check-lldb-lit PROPERTIES FOLDER "lldb tests")
 
-# Run the lit-style tests and the unittests as part of the check-lldb target.
-add_dependencies(check-lldb check-lldb-lit)
+# If we're building with an in-tree clang, then list clang as a dependency
+# to run tests.
+if (TARGET clang)
+  add_dependencies(check-lldb-lit clang)
+endif()
 
-# This will add LLDB's test dependencies to the dependencies for check-all and
-# include them in the test-depends target.
-set_property(GLOBAL APPEND PROPERTY LLVM_LIT_DEPENDS ${ARG_DEPENDS})
+add_lit_testsuites(LLDB
+  ${CMAKE_CURRENT_SOURCE_DIR}
+  DEPENDS lldb-test-deps
+  )
Index: lldb/lit/CMakeLists.txt
===================================================================
--- lldb/lit/CMakeLists.txt
+++ /dev/null
@@ -1,115 +0,0 @@
-# Test runner infrastructure for LLDB. This configures the LLDB test trees
-# for use by Lit, and delegates to LLVM's lit test handlers.
-
-# LLVM_BUILD_MODE is used in lit.site.cfg
-if (CMAKE_CFG_INTDIR STREQUAL ".")
-  set(LLVM_BUILD_MODE ".")
-else ()
-  set(LLVM_BUILD_MODE "%(build_mode)s")
-endif ()
-
-if (CMAKE_SIZEOF_VOID_P EQUAL 8)
-  set(LLDB_IS_64_BITS 1)
-endif()
-
-get_property(LLDB_DOTEST_ARGS GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY)
-set(dotest_args_replacement ${LLVM_BUILD_MODE})
-
-set(LLDB_TEST_MODULE_CACHE_LLDB "${LLDB_TEST_BUILD_DIRECTORY}/module-cache-lldb" CACHE PATH "The Clang module cache used by the Clang embedded in LLDB while running tests.")
-set(LLDB_TEST_MODULE_CACHE_CLANG "${LLDB_TEST_BUILD_DIRECTORY}/module-cache-clang" CACHE PATH "The Clang module cache used by the Clang while building tests.")
-
-if(LLDB_BUILT_STANDALONE)
-  # In paths to our build-tree, replace CMAKE_CFG_INTDIR with our configuration name placeholder.
-  string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} config_runtime_output_dir ${LLVM_RUNTIME_OUTPUT_INTDIR})
-  string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}")
-
-  # Remaining ones must be paths to the provided LLVM build-tree.
-  if(LLVM_CONFIGURATION_TYPES)
-    # LLDB uses single-config; LLVM multi-config; pick one and prefer Release types.
-    # Otherwise, if both use multi-config the default is fine.
-    if(NOT CMAKE_CONFIGURATION_TYPES)
-      if(RelWithDebInfo IN_LIST LLVM_CONFIGURATION_TYPES)
-        set(dotest_args_replacement RelWithDebInfo)
-      elseif(Release IN_LIST LLVM_CONFIGURATION_TYPES)
-        set(dotest_args_replacement Release)
-      else()
-        list(GET LLVM_CONFIGURATION_TYPES 0 dotest_args_replacement)
-      endif()
-    endif()
-  else()
-    # Common case: LLVM used a single-configuration generator like Ninja.
-    set(dotest_args_replacement ".")
-  endif()
-endif()
-
-string(REPLACE ${CMAKE_CFG_INTDIR} ${dotest_args_replacement} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}")
-string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_LIBS_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
-string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
-
-add_lldb_test_dependency(
-  lit-cpuid
-  llc
-  lli
-  llvm-config
-  llvm-dwarfdump
-  llvm-nm
-  llvm-mc
-  llvm-objcopy
-  llvm-readobj
-  llvm-strip
-  )
-
-if(TARGET lld)
-  add_lldb_test_dependency(lld)
-endif()
-
-# the value is not canonicalized within LLVM
-llvm_canonicalize_cmake_booleans(
-  LLDB_DISABLE_PYTHON
-  LLVM_ENABLE_ZLIB
-  LLVM_ENABLE_SHARED_LIBS
-  LLDB_IS_64_BITS)
-
-configure_lit_site_cfg(
-  ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
-  ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
-  MAIN_CONFIG
-  ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py)
-configure_lit_site_cfg(
-  ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in
-  ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg.py
-  MAIN_CONFIG
-  ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py)
-configure_lit_site_cfg(
-  ${CMAKE_CURRENT_SOURCE_DIR}/Suite/lit.site.cfg.in
-  ${CMAKE_CURRENT_BINARY_DIR}/Suite/lit.site.cfg)
-
-configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/lit-lldb-init.in
-  ${CMAKE_CURRENT_BINARY_DIR}/lit-lldb-init)
-
-if(NOT LLDB_BUILT_STANDALONE)
-  add_lldb_test_dependency(
-    FileCheck
-    count
-    not
-  )
-endif()
-
-add_lit_testsuite(check-lldb-lit "Running lldb lit test suite"
-  ${CMAKE_CURRENT_BINARY_DIR}
-  DEPENDS lldb-test-deps
-  )
-
-set_target_properties(check-lldb-lit PROPERTIES FOLDER "lldb tests")
-
-# If we're building with an in-tree clang, then list clang as a dependency
-# to run tests.
-if (TARGET clang)
-  add_dependencies(check-lldb-lit clang)
-endif()
-
-add_lit_testsuites(LLDB
-  ${CMAKE_CURRENT_SOURCE_DIR}
-  DEPENDS lldb-test-deps
-  )
Index: lldb/CMakeLists.txt
===================================================================
--- lldb/CMakeLists.txt
+++ lldb/CMakeLists.txt
@@ -185,7 +185,6 @@
 
   add_subdirectory(test)
   add_subdirectory(unittests)
-  add_subdirectory(lit)
   add_subdirectory(utils/lit-cpuid)
   add_subdirectory(utils/lldb-dotest)
 endif()
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to