Skip to content

Commit

Permalink
Debug CI
Browse files Browse the repository at this point in the history
  • Loading branch information
arg0d committed Jan 6, 2025
1 parent 9c5f844 commit cdd2324
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 80 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
test:
runs-on: ubuntu-22.04
container:
image: ghcr.io/nordsecurity/uniffi-rs-test-runner:v0.3.0
image: ghcr.io/nordsecurity/uniffi-rs-test-runner:v0.2.0
options: --user root
steps:
- uses: actions/checkout@v3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,103 +1,116 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// /* This Source Code Form is subject to the terms of the Mozilla Public
// * License, v. 2.0. If a copy of the MPL was not distributed with this
// * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

print("AAAAAAAAAAAAAAAAAAAAAAA 1")
fflush(stdout)

import imported_types_lib
import Foundation

print("AAAAAAAAAAAAAAAAAAAAAAA 2")
fflush(stdout)
let semaphore = DispatchSemaphore(value: 0)
print("test 1")
Task {
print("test 1.1")
semaphore.signal()
print("test 1.2")
}
print("test 2")
semaphore.wait()
print("test 3")

let ct = getCombinedType(value: nil)
assert(ct.uot.sval == "hello")
assert(ct.guid == "a-guid")
assert(ct.url == URL(string: "http://example.com/"))
// print("AAAAAAAAAAAAAAAAAAAAAAA 1")
// fflush(stdout)

print("AAAAAAAAAAAAAAAAAAAAAAA 3")
fflush(stdout)
// import imported_types_lib
// import Foundation

let ct2 = getCombinedType(value: ct)
assert(ct == ct2)
// print("AAAAAAAAAAAAAAAAAAAAAAA 2")
// fflush(stdout)

assert(getObjectsType(value: nil).maybeInterface == nil)
assert(getObjectsType(value: nil).maybeTrait == nil)
assert(getUniffiOneTrait(t: nil) == nil)
// let ct = getCombinedType(value: nil)
// assert(ct.uot.sval == "hello")
// assert(ct.guid == "a-guid")
// assert(ct.url == URL(string: "http://example.com/"))

print("AAAAAAAAAAAAAAAAAAAAAAA 4")
fflush(stdout)
// print("AAAAAAAAAAAAAAAAAAAAAAA 3")
// fflush(stdout)

let url = URL(string: "http://example.com/")!;
assert(getUrl(url: url) == url)
assert(getMaybeUrl(url: url)! == url)
assert(getMaybeUrl(url: nil) == nil)
assert(getUrls(urls: [url]) == [url])
assert(getMaybeUrls(urls: [url, nil]) == [url, nil])
// let ct2 = getCombinedType(value: ct)
// assert(ct == ct2)

print("AAAAAAAAAAAAAAAAAAAAAAA 5")
fflush(stdout)
// assert(getObjectsType(value: nil).maybeInterface == nil)
// assert(getObjectsType(value: nil).maybeTrait == nil)
// assert(getUniffiOneTrait(t: nil) == nil)

assert(getUniffiOneType(t: UniffiOneType(sval: "hello")).sval == "hello")
assert(getMaybeUniffiOneType(t: UniffiOneType(sval: "hello"))!.sval == "hello")
assert(getMaybeUniffiOneType(t: nil) == nil)
assert(getUniffiOneTypes(ts: [UniffiOneType(sval: "hello")]) == [UniffiOneType(sval: "hello")])
assert(getMaybeUniffiOneTypes(ts: [UniffiOneType(sval: "hello"), nil]) == [UniffiOneType(sval: "hello"), nil])
// print("AAAAAAAAAAAAAAAAAAAAAAA 4")
// fflush(stdout)

print("AAAAAAAAAAAAAAAAAAAAAAA 6")
fflush(stdout)
// let url = URL(string: "http://example.com/")!;
// assert(getUrl(url: url) == url)
// assert(getMaybeUrl(url: url)! == url)
// assert(getMaybeUrl(url: nil) == nil)
// assert(getUrls(urls: [url]) == [url])
// assert(getMaybeUrls(urls: [url, nil]) == [url, nil])

let semaphore = DispatchSemaphore(value: 0)
print("AAAAAAAAAAAAAAAAAAAAAAA 6.1")
print("AAAAAAAAAAAAAAAAAAAAAAA 6.2")
Task {
print("BBBBBBBBBBBBBBBBBBBB 1")
// This async function comes from the `uniffi-one` crate
let uniffiOneEnum = await getUniffiOneAsync()
print("BBBBBBBBBBBBBBBBBBBB 2")
assert(uniffiOneEnum == UniffiOneEnum.one)
print("BBBBBBBBBBBBBBBBBBBB 3")

// This async function comes from the `proc-macro-lib` crate
let uniffiOneType = await getUniffiOneTypeAsync(t: UniffiOneType(sval: "hello"))
print("BBBBBBBBBBBBBBBBBBBB 4")
assert(uniffiOneType.sval == "hello")
print("BBBBBBBBBBBBBBBBBBBB 5")
// print("AAAAAAAAAAAAAAAAAAAAAAA 5")
// fflush(stdout)

semaphore.signal()
// assert(getUniffiOneType(t: UniffiOneType(sval: "hello")).sval == "hello")
// assert(getMaybeUniffiOneType(t: UniffiOneType(sval: "hello"))!.sval == "hello")
// assert(getMaybeUniffiOneType(t: nil) == nil)
// assert(getUniffiOneTypes(ts: [UniffiOneType(sval: "hello")]) == [UniffiOneType(sval: "hello")])
// assert(getMaybeUniffiOneTypes(ts: [UniffiOneType(sval: "hello"), nil]) == [UniffiOneType(sval: "hello"), nil])

print("BBBBBBBBBBBBBBBBBBBB 6")
}
print("AAAAAAAAAAAAAAAAAAAAAAA 6.3")
semaphore.wait()
print("AAAAAAAAAAAAAAAAAAAAAAA 6.4")
// print("AAAAAAAAAAAAAAAAAAAAAAA 6")
// fflush(stdout)

print("AAAAAAAAAAAAAAAAAAAAAAA 7")
fflush(stdout)
// let semaphore = DispatchSemaphore(value: 0)
// print("AAAAAAAAAAAAAAAAAAAAAAA 6.1")
// print("AAAAAAAAAAAAAAAAAAAAAAA 6.2")
// Task {
// print("BBBBBBBBBBBBBBBBBBBB 1")
// // This async function comes from the `uniffi-one` crate
// let uniffiOneEnum = await getUniffiOneAsync()
// print("BBBBBBBBBBBBBBBBBBBB 2")
// assert(uniffiOneEnum == UniffiOneEnum.one)
// print("BBBBBBBBBBBBBBBBBBBB 3")

// // This async function comes from the `proc-macro-lib` crate
// let uniffiOneType = await getUniffiOneTypeAsync(t: UniffiOneType(sval: "hello"))
// print("BBBBBBBBBBBBBBBBBBBB 4")
// assert(uniffiOneType.sval == "hello")
// print("BBBBBBBBBBBBBBBBBBBB 5")

// semaphore.signal()

// print("BBBBBBBBBBBBBBBBBBBB 6")
// }
// print("AAAAAAAAAAAAAAAAAAAAAAA 6.3")
// semaphore.wait()
// print("AAAAAAAAAAAAAAAAAAAAAAA 6.4")

// print("AAAAAAAAAAAAAAAAAAAAAAA 7")
// fflush(stdout)

assert(getUniffiOneProcMacroType(t: UniffiOneProcMacroType(sval: "hello from proc-macro world")).sval == "hello from proc-macro world")
assert(getMyProcMacroType(t: UniffiOneProcMacroType(sval: "proc-macros all the way down")).sval == "proc-macros all the way down")
// assert(getUniffiOneProcMacroType(t: UniffiOneProcMacroType(sval: "hello from proc-macro world")).sval == "hello from proc-macro world")
// assert(getMyProcMacroType(t: UniffiOneProcMacroType(sval: "proc-macros all the way down")).sval == "proc-macros all the way down")

print("AAAAAAAAAAAAAAAAAAAAAAA 8")
fflush(stdout)
// print("AAAAAAAAAAAAAAAAAAAAAAA 8")
// fflush(stdout)

assert(getUniffiOneEnum(e: UniffiOneEnum.one) == UniffiOneEnum.one)
assert(getMaybeUniffiOneEnum(e: UniffiOneEnum.one)! == UniffiOneEnum.one)
assert(getMaybeUniffiOneEnum(e: nil) == nil)
assert(getUniffiOneEnums(es: [UniffiOneEnum.one]) == [UniffiOneEnum.one])
assert(getMaybeUniffiOneEnums(es: [UniffiOneEnum.one, nil]) == [UniffiOneEnum.one, nil])
// assert(getUniffiOneEnum(e: UniffiOneEnum.one) == UniffiOneEnum.one)
// assert(getMaybeUniffiOneEnum(e: UniffiOneEnum.one)! == UniffiOneEnum.one)
// assert(getMaybeUniffiOneEnum(e: nil) == nil)
// assert(getUniffiOneEnums(es: [UniffiOneEnum.one]) == [UniffiOneEnum.one])
// assert(getMaybeUniffiOneEnums(es: [UniffiOneEnum.one, nil]) == [UniffiOneEnum.one, nil])

print("AAAAAAAAAAAAAAAAAAAAAAA 9")
fflush(stdout)
// print("AAAAAAAAAAAAAAAAAAAAAAA 9")
// fflush(stdout)

let g = getGuidProcmacro(g: nil)
assert(g == getGuidProcmacro(g: g))
// let g = getGuidProcmacro(g: nil)
// assert(g == getGuidProcmacro(g: g))

print("AAAAAAAAAAAAAAAAAAAAAAA 10")
fflush(stdout)
// print("AAAAAAAAAAAAAAAAAAAAAAA 10")
// fflush(stdout)

// Thread.sleep(forTimeInterval: 1)
// // Thread.sleep(forTimeInterval: 1)

// print("AAAAAAAAAAAAAAAAAAAAAAA 11")
// fflush(stdout)
// // print("AAAAAAAAAAAAAAAAAAAAAAA 11")
// // fflush(stdout)

0 comments on commit cdd2324

Please sign in to comment.