@@ -119,6 +119,18 @@ 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
+ let uploaded = try await compilation. makeGlobal ( )
130
+ XCTAssertTrue ( uploaded, " Cached output cannot be uploaded " )
131
+ // Execise call back uploading method.
132
+ compilation. makeGlobal { error in
133
+ XCTAssertTrue ( error == nil , " Upload Error " )
122
134
}
123
135
compilations. append ( compilation)
124
136
} else {
@@ -562,6 +574,9 @@ final class CachingBuildTests: XCTestCase {
562
574
try fooBuildDriver. run ( jobs: fooJobs)
563
575
XCTAssertFalse ( fooBuildDriver. diagnosticEngine. hasErrors)
564
576
577
+ let cas = try dependencyOracle. createCAS ( pluginPath: nil , onDiskPath: casPath, pluginOptions: [ ] )
578
+ try checkCASForResults ( jobs: fooJobs, cas: cas, fs: fooBuildDriver. fileSystem)
579
+
565
580
var driver = try Driver ( args: [ " swiftc " ,
566
581
" -I " , FooInstallPath . nativePathString ( escaped: true ) ,
567
582
" -explicit-module-build " , " -emit-module " , " -emit-module-path " ,
0 commit comments