Skip to content

Commit

Permalink
Remove generated test data by defer
Browse files Browse the repository at this point in the history
  • Loading branch information
ikesyo committed Oct 24, 2024
1 parent 7176da2 commit ead3d74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Tests/ScipioKitTests/FrameworkBundleAssemblerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct FrameworkBundleAssemblerTests {
@Test
func copyHeaders_keepPublicHeadersStructure_is_false() throws {
let outputDirectory = temporaryDirectory.appending(component: #function)
try fileSystem.removeFileTree(outputDirectory)
defer { try? fileSystem.removeFileTree(outputDirectory) }

try assembleFramework(keepPublicHeadersStructure: false, outputDirectory: outputDirectory)

Expand All @@ -32,7 +32,7 @@ struct FrameworkBundleAssemblerTests {
@Test
func copyHeaders_keepPublicHeadersStructure_is_true() throws {
let outputDirectory = temporaryDirectory.appending(component: #function)
try fileSystem.removeFileTree(outputDirectory)
defer { try? fileSystem.removeFileTree(outputDirectory) }

try assembleFramework(keepPublicHeadersStructure: true, outputDirectory: outputDirectory)

Expand Down
2 changes: 2 additions & 0 deletions Tests/ScipioKitTests/FrameworkModuleMapGeneratorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ struct FrameworkModuleMapGeneratorTests {
@Test
func generate_keepPublicHeadersStructure_is_false() throws {
let outputDirectory = temporaryDirectory.appending(component: #function)
defer { try? fileSystem.removeFileTree(outputDirectory) }

let generatedModuleMapContents = try generateModuleMap(
keepPublicHeadersStructure: false,
Expand All @@ -47,6 +48,7 @@ framework module MyTarget {
@Test
func generate_keepPublicHeadersStructure_is_true() throws {
let outputDirectory = temporaryDirectory.appending(component: #function)
defer { try? fileSystem.removeFileTree(outputDirectory) }

let generatedModuleMapContents = try generateModuleMap(
keepPublicHeadersStructure: true,
Expand Down

0 comments on commit ead3d74

Please sign in to comment.