Skip to content

[lldb][swift] Only run Swift Shell tests when Swift support is enabled #1893

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lldb/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@ llvm_canonicalize_cmake_booleans(
LLVM_ENABLE_SHARED_LIBS
LLDB_IS_64_BITS)

# BEGIN SWIFT
llvm_canonicalize_cmake_booleans(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why isn't this conditional on having swift support enabled?
Ah.. this is the code that declares LLDB_ENABLE_SWIFT_SUPPORT? My CMake is not very good.

Copy link
Author

@Teemperor Teemperor Oct 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GitHub diff doesn't show enough context above this change to get the context, but this code (and the one above) is 'canonicalizing' the bool variable so that we can use it in the lit.site.cfg.py.in file (it essentially just turns all the different strings CMake interprets as True or False into 1 and 0 respectively so that we can write the value into the Python file). Without that our config file would be turn the line config.lldb_enable_swift = @LLDB_ENABLE_SWIFT_SUPPORT@ to config.lldb_enable_swift = Off (as Off is a legit 'false' value in CMake) and then Python would ask 'what does Off mean'? With this line the config file instead gets config.lldb_enable_swift = 0 which Python understands.

LLDB_ENABLE_SWIFT_SUPPORT
)
# END SWIFT

# Configure the individual test suites.
add_subdirectory(API)
add_subdirectory(Shell)
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/Reproducer/Swift/TestBridging.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# UNSUPPORTED: system-windows, system-freebsd, system-linux
# REQUIRES: swift

# This tests replaying a Swift reproducer with bridging.

Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/Reproducer/Swift/TestModule.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# UNSUPPORTED: system-windows, system-freebsd
# REQUIRES: swift

# This tests replaying a Swift reproducer with bridging.

Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/Reproducer/Swift/TestSimple.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# UNSUPPORTED: system-windows, system-freebsd
# REQUIRES: swift

# This tests replaying a simple reproducer.

Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/Reproducer/Swift/TestSwiftInterface.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Test that reproducers can deal with .swiftinterface files.

# REQUIRES: system-darwin
# REQUIRES: swift
#
# rdar://problem/55564275
# XFAIL: *
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/Swift/DeserializationFailure.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# REQUIRES: system-darwin
# REQUIRES: swift
# Tests that error messages from deserializing Swift modules are
# printed to the error stream. Architecturally it is not possible to
# write this as a dotest.py test.
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/Swift/DynamicTyperesolutionConflict.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# REQUIRES: system-darwin
# REQUIRES: rdar50667488
# REQUIRES: swift

# This testcase causes the scratch context to get destroyed by a
# conflict that is triggered via dynamic type resolution. The conflict
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/Swift/MissingVFSOverlay.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Test that error messages from constructing ClangImporter
# are surfaced to the user.
# REQUIRES: swift

# RUN: rm -rf %t && mkdir %t && cd %t
# RUN: cp %p/../../API/lang/swift/deserialization_failure/Inputs/main.swift %t/main.swift
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/Swift/No.swiftmodule-ObjC.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# REQUIRES: system-darwin
# REQUIRES: swift
# This tests debugging without the presence of a .swiftmodule.

# RUN: rm -rf %t && mkdir %t && cd %t
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/Swift/No.swiftmodule.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This tests debugging without the presence of a .swiftmodule.
# REQUIRES: swift

# RUN: rm -rf %t && mkdir %t && cd %t
#
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/Swift/RemoteASTImport.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# REQUIRES: system-darwin
# REQUIRES: swift

# This tests that RemoteAST querying the dynamic type of a variable
# doesn't import any modules into a module SwiftASTContext that
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/Swift/astcontext_error.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# REQUIRES: swift
# RUN: rm -rf %t && mkdir %t && cd %t
# RUN: %target-swiftc -g %S/Inputs/ContextError.swift
# RUN: %lldb ContextError -s %s | FileCheck %S/Inputs/ContextError.swift
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/Swift/cond-breakpoint.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# REQUIRES: swift
# RUN: rm -rf %t && mkdir %t && cd %t
# RUN: %target-swiftc -g %S/Inputs/main.swift -o a.out
# RUN: %lldb a.out -b -s %s 2>&1 | FileCheck %s
Expand Down
2 changes: 2 additions & 0 deletions lldb/test/Shell/Swift/global.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# REQUIRES: swift

# RUN: rm -rf %t && mkdir %t && cd %t
# RUN: %target-swiftc -g \
# RUN: -module-cache-path %t/cache %S/Inputs/Global.swift \
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/Swift/runtime-initialization.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# REQUIRES: swift
# RUN: rm -rf %t && mkdir %t
# RUN: %target-swiftc -g \
# RUN: -module-cache-path %t/cache %S/Inputs/RuntimeInit.swift \
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/Basic.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Basic sanity checking of the REPL.
// REQUIRES: swift

// RUN: %lldb --repl --repl-language swift | FileCheck %s --check-prefix=SWIFT
// SWIFT: Welcome to {{.*}}Swift
Expand Down
2 changes: 1 addition & 1 deletion lldb/test/Shell/SwiftREPL/BreakpointSimple.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Test that we can set breakpoints in the REPL.

// REQUIRES: swift
// RUN: %lldb --repl < %s | FileCheck %s

func foo() -> Int {
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/CFString.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Test that CFString works in the REPL.
// REQUIRES: system-darwin
// REQUIRES: swift

// RUN: %lldb --repl < %s | FileCheck %s
// CHECK: Welcome to {{.*}}Swift
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/Class.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Test that we can define and use a basic class.
// REQUIRES: swift

// RUN: %lldb --repl < %s | FileCheck %s

Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/ComputedProperties.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Check that we print computed properties correctly.
// REQUIRES: swift

// RUN: %lldb --repl < %s | FileCheck %s

Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/CrashArgs.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Make sure we don't crash if we pass args to the repl.
// REQUIRES: swift

// RUN: %lldb --repl="-some-argument" | FileCheck %s --check-prefix=SWIFT
// SWIFT: Welcome to {{.*}}Swift
6 changes: 4 additions & 2 deletions lldb/test/Shell/SwiftREPL/Deadlock.test
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
// REQUIRES: swift

// RUN: %lldb --repl < %s | FileCheck %s

// From https://bugs.swift.org/browse/SR-7114
// This sequence was deadlocking.

let a = 9007199254740991.0
// CHECK: a: Double = 9007199254740991
(a * a - a * a).squareRoot()
(a * a - a * a).squareRoot()
// CHECK: (Double) = {
// CHECK-NEXT: _value = 0
// CHECK-NEXT: }
(a * a).addingProduct(-a, a).squareRoot()
// CHECK: (Double) = {
// CHECK-NEXT: _value = NaN
// CHECK-NEXT: _value = NaN
// CHECK-NEXT: }
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/DeferredNSArray.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Test that NSDeferredArray data formatter works.
// REQUIRES: system-darwin
// REQUIRES: swift

// RUN: %lldb --repl < %s | FileCheck %s

Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/DeploymentTarget.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Test that the REPL can call a *really* new function.
// REQUIRES: system-darwin
// REQUIRES: swift

// RUN: echo -n "@available(macOS " >%t.swift
// RUN: python -c 'from __future__ import print_function; import platform; print(platform.mac_ver()[0],end="")' >>%t.swift
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/Dict.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Test that the dictionary data formatter works in the REPL.
// REQUIRES: swift

// RUN: %lldb --repl < %s | FileCheck %s --check-prefix=DICT

Expand Down
2 changes: 2 additions & 0 deletions lldb/test/Shell/SwiftREPL/DictBridging.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// -*- mode: swift; -*-
// Test formatters on bridged dictionaries in the REPL.
// REQUIRES: system-darwin
// REQUIRES: swift

// RUN: %lldb --repl < %s | FileCheck %s --check-prefix=DICT

import Foundation
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/ErrorReturn.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// XFAIL: powerpc64le
// SR-10212
// Test that we can handle errors.
// REQUIRES: swift

// RUN: %lldb --repl < %s | FileCheck %s

Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/ErrorReturnObjC.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// types when they're stored in REPL-defined globals.

// REQUIRES: system-darwin
// REQUIRES: swift

// RUN: %lldb --repl < %s | FileCheck %s

Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/ExclusivityREPL.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Runtime checks for exclusive access should be enabled in the REPL.
// REQUIRES: swift

// RUN: %lldb --repl < %s 2>&1 | FileCheck %s
// CHECK: modification requires exclusive access
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/FoundationTypes.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// types when they're stored in REPL-defined globals.

// REQUIRES: system-darwin
// REQUIRES: swift

// RUN: %lldb --repl < %s | FileCheck %s

Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/FrameworkPath.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Test target.swift-framework-search-paths works in the REPL.
// REQUIRES: system-darwin
// REQUIRES: swift

// RUN: %lldb -O "settings set target.swift-framework-search-paths %S/Inputs/Frameworks" --repl < %s | FileCheck %s

Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/GLKIT.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Test formatters for Accelerate/simd.
// REQUIRES: system-darwin
// REQUIRES: swift

// RUN: %lldb --repl < %s | FileCheck %s

Expand Down
2 changes: 2 additions & 0 deletions lldb/test/Shell/SwiftREPL/GenericTypealias.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// Test that generic typealiases are reconstructed correctly.
// REQUIRES: swift

// RUN: %lldb --repl < %s | FileCheck %s

class Tinky<T> {
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/Generics.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Test that generics work in the REPL.
// REQUIRES: swift

// RUN: %lldb --repl < %s | FileCheck %s

Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/ImportCocoa.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Test that importing Cocoa works.
// REQUIRES: system-darwin
// REQUIRES: swift

// RUN: %lldb --repl < %s 2>&1 | FileCheck %s

Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/ImportDispatch.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Test that importing Dispatch works.
// REQUIRES: system-darwin
// REQUIRES: swift

// RUN: %lldb --repl < %s 2>&1 | FileCheck %s

Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/ImportError.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Test that importing non-existing module fails.
// REQUIRES: swift

// RUN: %lldb --repl < %s 2>&1 | FileCheck %s

Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/ImportFoundation.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Test that type lookup chooses the right language.
// REQUIRES: system-darwin
// REQUIRES: swift

// RUN: %lldb --repl < %s | FileCheck %s

Expand Down
2 changes: 2 additions & 0 deletions lldb/test/Shell/SwiftREPL/InitFile.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Test that the Swift REPL init file works.
// REQUIRES: system-darwin
// REQUIRES: swift

// RUN: export HOME=%t
// RUN: mkdir -p %t
// RUN: echo 'br set -f main.c -l 123' > ~/.lldbinit
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/LookupAfterImport.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Make sure we properly load in new extension members after an import.
// rdar://64040436
// REQUIRES: swift

// RUN: rm -rf %t
// RUN: mkdir %t
Expand Down
2 changes: 2 additions & 0 deletions lldb/test/Shell/SwiftREPL/MetatypeRepl.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// REQUIRES: swift

// RUN: %lldb --repl < %s | FileCheck %s

let x = [Double.self]
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/NSObjectSubclass.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Test that the REPL allows defining subclasses of NSObject.
// REQUIRES: system-darwin
// REQUIRES: swift

// RUN: %lldb --repl < %s | FileCheck %s

Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/NSString.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Test that NSString works in the REPL.
// REQUIRES: system-darwin
// REQUIRES: swift

// RUN: %lldb --repl < %s | FileCheck %s --check-prefix=NSSTRING

Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/OpenClass.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %lldb --repl < %s 2>&1 | FileCheck %s
// REQUIRES: swift

class Foo {
// Don't make any of these 'open'.
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/Optional.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %lldb --repl < %s | FileCheck %s
// REQUIRES: swift

enum Patatino {
case first
Expand Down
2 changes: 2 additions & 0 deletions lldb/test/Shell/SwiftREPL/OptionalUnowned.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// REQUIRES: swift

// RUN: %lldb --repl < %s | FileCheck %s

class C
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/OptionalWithDynamicType.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// optional.

// REQUIRES: system-darwin
// REQUIRES: swift

// RUN: %lldb --repl < %s 2>&1 | FileCheck %s

Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/PropertyWrapperPrivate.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Test that we don't crash when SILGen(ing) property wrappers
// [private].
// REQUIRES: swift

// RUN: %lldb --repl < %s | FileCheck %s

Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/PropertyWrapperPublic.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Test that we don't crash when SILGen(ing) property wrappers
// [public].
// REQUIRES: swift

// RUN: %lldb --repl < %s | FileCheck %s

Expand Down
2 changes: 2 additions & 0 deletions lldb/test/Shell/SwiftREPL/PropertyWrapperTopLevel.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// REQUIRES: swift

// RUN: %lldb --repl < %s 2>&1 | FileCheck %s

@propertyWrapper struct A<T> {
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/RecursiveClass.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Test that recursive class instances work in the REPL.
// REQUIRES: swift

// RUN: %lldb --repl < %s | FileCheck %s

Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/Redefinition.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Test that we can set breakpoints in the REPL.
// REQUIRES: swift

// RUN: %lldb --repl < %s | FileCheck %s

Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/RedirectInput.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Test that input can be redirected from A.swift
// REQUIRES: swift

// RUN: mkdir -p %t
// RUN: cp %S/Inputs/A.swift %t/A.swift
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/RedirectInputNoSuchFile.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Test that input can't be redirected from non-existent file A.swift
// REQUIRES: swift

// RUN: mkdir -p %t
// RUN: cd %t
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/SwiftREPL/RedirectInputUnreadable.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Test that input can't be redirected from unreadable A.swift
// REQUIRES: swift

// RUN: mkdir -p %t
// RUN: cp %S/Inputs/A.swift %t/A.swift
Expand Down
2 changes: 2 additions & 0 deletions lldb/test/Shell/SwiftREPL/ResilientArray.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// REQUIRES: system-darwin
// REQUIRES: swift

// RUN: %lldb --repl < %s | FileCheck %s

import Foundation
Expand Down
Loading