@@ -119,6 +119,17 @@ private func checkCASForResults(jobs: [Job], cas: SwiftScanCAS, fs: FileSystem)
119
119
XCTAssertTrue ( output. isMaterialized, " Cached output not founded in CAS " )
120
120
let success = try await output. load ( )
121
121
XCTAssertTrue ( success, " Cached output not founded in CAS " )
122
+
123
+ // Try async download. Download should succeed even on a local CAS.
124
+ let casID = try output. getCASID ( )
125
+ let downloaded = try await cas. download ( with: casID)
126
+ XCTAssertTrue ( downloaded, " Cached output cannot be downloaded " )
127
+ }
128
+ // Execise the uploading path.
129
+ try await compilation. makeGlobal ( )
130
+ // Execise call back uploading method.
131
+ compilation. makeGlobal { error in
132
+ XCTAssertTrue ( error == nil , " Upload Error " )
122
133
}
123
134
compilations. append ( compilation)
124
135
} else {
@@ -562,6 +573,9 @@ final class CachingBuildTests: XCTestCase {
562
573
try fooBuildDriver. run ( jobs: fooJobs)
563
574
XCTAssertFalse ( fooBuildDriver. diagnosticEngine. hasErrors)
564
575
576
+ let cas = try dependencyOracle. createCAS ( pluginPath: nil , onDiskPath: casPath, pluginOptions: [ ] )
577
+ try checkCASForResults ( jobs: fooJobs, cas: cas, fs: fooBuildDriver. fileSystem)
578
+
565
579
var driver = try Driver ( args: [ " swiftc " ,
566
580
" -I " , FooInstallPath . nativePathString ( escaped: true ) ,
567
581
" -explicit-module-build " , " -emit-module " , " -emit-module-path " ,
0 commit comments