From a867a9548383306f77b83bafeda85c6ee164dee5 Mon Sep 17 00:00:00 2001 From: Antonius Naumann Date: Sat, 10 Aug 2024 22:00:09 +0200 Subject: [PATCH] Fix end-to-end tests --- testing/end-to-end/init.swift | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/testing/end-to-end/init.swift b/testing/end-to-end/init.swift index a8450ea..b00fba2 100755 --- a/testing/end-to-end/init.swift +++ b/testing/end-to-end/init.swift @@ -47,37 +47,38 @@ guard fileExists(atPath: "\(projectName)/src/lib.rs") else { print("Running tests for cargo swift init in udl mode...") let cargoSwiftInitUdl = Process() -cargoSwiftInit.executableURL = URL(fileURLWithPath: "/usr/bin/env") -cargoSwiftInit.arguments = ["cargo", "swift", "init", projectName, "-y", "--silent", "--udl"] +let projectNameUdl = "\(projectName)_udl" +cargoSwiftInitUdl.executableURL = URL(fileURLWithPath: "/usr/bin/env") +cargoSwiftInitUdl.arguments = ["cargo", "swift", "init", projectNameUdl, "-y", "--silent", "--udl"] try! cargoSwiftInitUdl.run() cargoSwiftInitUdl.waitUntilExit() -guard dirExists(atPath: projectName) else { +guard dirExists(atPath: projectNameUdl) else { error("Project directory does not exist") exit(1) } -guard fileExists(atPath: "\(projectName)/Cargo.toml") else { +guard fileExists(atPath: "\(projectNameUdl)/Cargo.toml") else { error("No Cargo.toml found in project directory") exit(1) } -guard fileExists(atPath: "\(projectName)/build.rs") else { +guard fileExists(atPath: "\(projectNameUdl)/build.rs") else { error("No build.rs file found in project directory") exit(1) } -guard fileExists(atPath: "\(projectName)/.gitignore") else { +guard fileExists(atPath: "\(projectNameUdl)/.gitignore") else { error("No .gitignore found in project directory") exit(1) } -guard dirExists(atPath: "\(projectName)/src") else { +guard dirExists(atPath: "\(projectNameUdl)/src") else { error("No src-directory found in project directory") exit(1) } -guard fileExists(atPath: "\(projectName)/src/lib.rs") else { +guard fileExists(atPath: "\(projectNameUdl)/src/lib.rs") else { error("No lib.rs file found in src directory") exit(1) } -guard fileExists(atPath: "\(projectName)/src/lib.udl") else { +guard fileExists(atPath: "\(projectNameUdl)/src/lib.udl") else { error("No lib.udl file found in src directory") exit(1) }