1

I'm trying implement unit test in some of my Swift Scripts but I'm getting this error:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/swift/XCTest.swiftmodule/x86_64.swiftinterface:6:19: error: no such module 'XCTest'
@_exported import XCTest
                  ^
one.swift:3:8: error: failed to load module 'XCTest'
import XCTest
       ^

This is my script:

#!/usr/bin/swift
import Foundation
import XCTest

print("my script")

Any of you knows why I'm getting this error and if there is a work around this error?

I'll really appreciate your help.

user2924482
  • 8,380
  • 23
  • 89
  • 173
  • Did you check this https://stackoverflow.com/questions/24248439/how-can-i-run-xctest-for-a-swift-application-from-the-command-line ? – Martin R Jul 20 '20 at 20:08
  • @MartinR yes and doesn't work `Failure: No test bundle found at path `oneSwift` – user2924482 Jul 20 '20 at 20:19

0 Answers0