Skip to content

Remove the last lit test #2160

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
merged 1 commit into from
Sep 7, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,6 @@ struct Test: ParsableCommand, BuildCommand {
@OptionGroup
var arguments: BuildArguments

@Flag(help: "Don't run lit-based tests")
var skipLitTests: Bool = false

@Option(
help: """
Path to the FileCheck executable that was built as part of the LLVM repository.
If not specified, it will be looked up from PATH.
"""
)
var filecheckExec: String?

func run() throws {
try buildExample(exampleName: "ExamplePlugin")

Expand All @@ -44,74 +33,6 @@ struct Test: ParsableCommand, BuildCommand {

private func runTests() throws {
logSection("Running SwiftSyntax Tests")

if !skipLitTests {
try runLitTests()
}

try runXCTests()
}

private func runLitTests() throws {
logSection("Running lit-based tests")

guard FileManager.default.fileExists(atPath: Paths.litExec.path) else {
throw ScriptExectutionError(
message: """
Error: Could not find lit.py.
Looking at '\(Paths.litExec.path)'.

Make sure you have the llvm repo checked out next to the swift-syntax repo.
Refer to README.md for more information.
"""
)
}

let examplesBinPath = try findExamplesBinPath()

var litCall = [
Paths.litExec.path,
Paths.packageDir.appendingPathComponent("lit_tests").path,
]

if let filecheckExec {
litCall += ["--param", "FILECHECK=" + filecheckExec]
}

litCall += ["--param", "EXAMPLES_BIN_PATH=" + examplesBinPath.path]
litCall += ["--param", "TOOLCHAIN=" + arguments.toolchain.path]

// Print all failures
litCall += ["--verbose"]
// Don't show all commands if verbose is not enabled
if !arguments.verbose {
litCall += ["--succinct"]
}

guard let pythonExec = Paths.python3Exec else {
throw ScriptExectutionError(message: "Didn't find python3 executable")
}

let process = ProcessRunner(
executableURL: pythonExec,
arguments: litCall
)

let processOutput = try process.run(verbose: arguments.verbose)

if !processOutput.stdout.isEmpty {
logSection("lit test stdout")
print(processOutput.stdout)
}

if !processOutput.stderr.isEmpty {
logSection("lit test stderr")
print(processOutput.stderr)
}
}

private func runXCTests() throws {
logSection("Running XCTests")
var swiftpmCallArguments: [String] = []

if arguments.verbose {
Expand Down
108 changes: 0 additions & 108 deletions lit_tests/compiler_plugin_basic.swift

This file was deleted.

81 changes: 0 additions & 81 deletions lit_tests/lit.cfg

This file was deleted.