mirror of
https://github.com/google/flatbuffers.git
synced 2025-04-08 09:12:14 +08:00
Moves all of the swift test code into tests/swift (#7509)
Fixes failing tests by regenerating test cases
This commit is contained in:
parent
f124e41ae6
commit
a67e35aff9
4
.github/labeler.yml
vendored
4
.github/labeler.yml
vendored
@ -15,9 +15,7 @@ c#:
|
|||||||
swift:
|
swift:
|
||||||
- '**/*.swift'
|
- '**/*.swift'
|
||||||
- swift/**/*
|
- swift/**/*
|
||||||
- tests/FlatBuffers.GRPC.Swift/**/*
|
- tests/swift/**
|
||||||
- tests/FlatBuffers.Benchmarks.swift/**/*
|
|
||||||
- tests/FlatBuffers.Test.Swift/**/*
|
|
||||||
- src/idl_gen_swift.cpp
|
- src/idl_gen_swift.cpp
|
||||||
|
|
||||||
javascript:
|
javascript:
|
||||||
|
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@ -422,7 +422,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: test
|
- name: test
|
||||||
working-directory: tests/FlatBuffers.Test.Swift
|
working-directory: tests/swift/tests
|
||||||
run: sh SwiftTest.sh
|
run: sh SwiftTest.sh
|
||||||
|
|
||||||
build-swift-wasm:
|
build-swift-wasm:
|
||||||
@ -435,7 +435,7 @@ jobs:
|
|||||||
- name: Setup Wasmer
|
- name: Setup Wasmer
|
||||||
uses: wasmerio/setup-wasmer@v1
|
uses: wasmerio/setup-wasmer@v1
|
||||||
- name: Test
|
- name: Test
|
||||||
working-directory: tests/FlatBuffers.Test.Swift.Wasm
|
working-directory: tests/swift/Wasm.tests
|
||||||
run: carton test
|
run: carton test
|
||||||
|
|
||||||
build-ts:
|
build-ts:
|
||||||
|
@ -22,10 +22,10 @@ GitHub page](https://github.com/google/flatbuffers/tree/master/swift).
|
|||||||
|
|
||||||
## Testing the FlatBuffers Swift library
|
## Testing the FlatBuffers Swift library
|
||||||
|
|
||||||
The code to test the Swift library can be found at `flatbuffers/Flatbuffers.Test.Swift`.
|
The code to test the Swift library can be found at `flatbuffers/tests/swift/tests`.
|
||||||
The test code itself is located in [Flatbuffers.Test.Swift](https://github.com/google/flatbuffers/blob/master/tests/FlatBuffers.Test.Swift).
|
The test code itself is located in [flatbuffers/tests/swift/tests](https://github.com/google/flatbuffers/blob/master/tests/swift/tests).
|
||||||
|
|
||||||
To run the tests, use the [SwiftTest.sh](https://github.com/google/flatbuffers/blob/master/tests/FlatBuffers.Test.Swift/SwiftTest.sh) shell script.
|
To run the tests, use the [SwiftTest.sh](https://github.com/google/flatbuffers/blob/master/tests/swift/tests/SwiftTest.sh) shell script.
|
||||||
|
|
||||||
*Note: The shell script requires [Swift](https://swift.org) to
|
*Note: The shell script requires [Swift](https://swift.org) to
|
||||||
be installed.*
|
be installed.*
|
||||||
|
@ -64,7 +64,7 @@ assert flatc_path.exists(), "Cannot find the flatc compiler " + str(flatc_path)
|
|||||||
|
|
||||||
# Specify the other paths that will be referenced
|
# Specify the other paths that will be referenced
|
||||||
tests_path = Path(root_path, "tests")
|
tests_path = Path(root_path, "tests")
|
||||||
swift_code_gen = Path(root_path, "tests/FlatBuffers.Test.Swift/CodeGenerationTests")
|
swift_code_gen = Path(root_path, "tests/swift/tests/CodeGenerationTests")
|
||||||
samples_path = Path(root_path, "samples")
|
samples_path = Path(root_path, "samples")
|
||||||
reflection_path = Path(root_path, "reflection")
|
reflection_path = Path(root_path, "reflection")
|
||||||
|
|
||||||
@ -395,7 +395,7 @@ dictionary_lookup_schema = "dictionary_lookup.fbs"
|
|||||||
flatc(["--java", "--kotlin"], schema=dictionary_lookup_schema)
|
flatc(["--java", "--kotlin"], schema=dictionary_lookup_schema)
|
||||||
|
|
||||||
# Swift Tests
|
# Swift Tests
|
||||||
swift_prefix = "FlatBuffers.Test.Swift/Tests/FlatBuffers.Test.SwiftTests"
|
swift_prefix = "swift/tests/Tests/FlatBuffers.Test.SwiftTests"
|
||||||
flatc(
|
flatc(
|
||||||
SWIFT_OPTS + BASE_OPTS + ["--grpc"],
|
SWIFT_OPTS + BASE_OPTS + ["--grpc"],
|
||||||
schema="monster_test.fbs",
|
schema="monster_test.fbs",
|
||||||
|
@ -4,5 +4,5 @@ ADD . .
|
|||||||
RUN cp flatc_debian_stretch flatc
|
RUN cp flatc_debian_stretch flatc
|
||||||
WORKDIR /code/tests
|
WORKDIR /code/tests
|
||||||
RUN swift --version
|
RUN swift --version
|
||||||
WORKDIR /code/tests/FlatBuffers.Test.Swift
|
WORKDIR /code/tests/swift/tests/
|
||||||
RUN sh SwiftTest.sh
|
RUN sh SwiftTest.sh
|
||||||
|
@ -23,7 +23,7 @@ let package = Package(
|
|||||||
.macOS(.v10_14),
|
.macOS(.v10_14),
|
||||||
],
|
],
|
||||||
dependencies: [
|
dependencies: [
|
||||||
.package(path: "../../swift/"),
|
.package(path: "../../../swift"),
|
||||||
],
|
],
|
||||||
targets: [
|
targets: [
|
||||||
.target(
|
.target(
|
@ -18,17 +18,17 @@
|
|||||||
import PackageDescription
|
import PackageDescription
|
||||||
|
|
||||||
let package = Package(
|
let package = Package(
|
||||||
name: "FlatBuffers.Benchmarks.swift",
|
name: "benchmarks",
|
||||||
platforms: [
|
platforms: [
|
||||||
.macOS(.v10_14),
|
.macOS(.v10_14),
|
||||||
],
|
],
|
||||||
dependencies: [
|
dependencies: [
|
||||||
.package(path: "../../swift"),
|
.package(path: "../../../swift"),
|
||||||
.package(url: "https://github.com/google/swift-benchmark", from: "0.1.0"),
|
.package(url: "https://github.com/google/swift-benchmark", from: "0.1.0"),
|
||||||
],
|
],
|
||||||
targets: [
|
targets: [
|
||||||
.target(
|
.target(
|
||||||
name: "FlatBuffers.Benchmarks.swift",
|
name: "benchmarks",
|
||||||
dependencies: ["FlatBuffers",
|
dependencies: ["FlatBuffers",
|
||||||
.product(name: "Benchmark", package: "swift-benchmark")]),
|
.product(name: "Benchmark", package: "swift-benchmark")]),
|
||||||
])
|
])
|
@ -24,7 +24,7 @@ let package = Package(
|
|||||||
.macOS(.v10_14),
|
.macOS(.v10_14),
|
||||||
],
|
],
|
||||||
dependencies: [
|
dependencies: [
|
||||||
.package(path: "../../swift/"),
|
.package(path: "../../../swift"),
|
||||||
.package(url: "https://github.com/grpc/grpc-swift.git", from: "1.4.1"),
|
.package(url: "https://github.com/grpc/grpc-swift.git", from: "1.4.1"),
|
||||||
],
|
],
|
||||||
targets: [
|
targets: [
|
@ -1,16 +1,18 @@
|
|||||||
|
current_dir=`pwd`
|
||||||
|
cd ..
|
||||||
swift_dir=`pwd`
|
swift_dir=`pwd`
|
||||||
cd ..
|
cd ..
|
||||||
test_dir=`pwd`
|
test_dir=`pwd`
|
||||||
alias fbc='${test_dir}/../flatc'
|
alias fbc='${test_dir}/../flatc'
|
||||||
shopt -s expand_aliases
|
shopt -s expand_aliases
|
||||||
|
|
||||||
cd ${swift_dir}/Tests/FlatBuffers.Test.SwiftTests
|
cd ${current_dir}/Tests/FlatBuffers.Test.SwiftTests
|
||||||
fbc --swift --gen-mutable --grpc --gen-json-emit --gen-object-api -I ${test_dir}/include_test ${test_dir}/monster_test.fbs ${test_dir}/union_vector/union_vector.fbs
|
fbc --swift --gen-mutable --grpc --gen-json-emit --gen-object-api -I ${test_dir}/include_test ${test_dir}/monster_test.fbs ${test_dir}/union_vector/union_vector.fbs
|
||||||
fbc --swift --gen-json-emit ${test_dir}/optional_scalars.fbs
|
fbc --swift --gen-json-emit ${test_dir}/optional_scalars.fbs
|
||||||
fbc --swift --gen-json-emit --gen-object-api ${test_dir}/more_defaults.fbs
|
fbc --swift --gen-json-emit --gen-object-api ${test_dir}/more_defaults.fbs
|
||||||
fbc --swift --gen-json-emit --gen-mutable --gen-object-api ${test_dir}/MutatingBool.fbs
|
fbc --swift --gen-json-emit --gen-mutable --gen-object-api ${test_dir}/MutatingBool.fbs
|
||||||
fbc --swift ${test_dir}/vector_has_test.fbs
|
fbc --swift --gen-json-emit ${test_dir}/vector_has_test.fbs
|
||||||
cd ${swift_dir}
|
cd ${current_dir}
|
||||||
|
|
||||||
# Goes into the code generation tests
|
# Goes into the code generation tests
|
||||||
cd CodeGenerationTests
|
cd CodeGenerationTests
|
||||||
@ -18,14 +20,14 @@ fbc --swift --gen-mutable --grpc --gen-json-emit --gen-object-api --swift-implem
|
|||||||
fbc --swift --gen-mutable --grpc --gen-json-emit --gen-object-api --no-includes test_no_include.fbs
|
fbc --swift --gen-mutable --grpc --gen-json-emit --gen-object-api --no-includes test_no_include.fbs
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
cd ${swift_dir}/Sources/SwiftFlatBuffers
|
cd ${current_dir}/Sources/SwiftFlatBuffers
|
||||||
# create better fuzzing test file
|
# create better fuzzing test file
|
||||||
fbc --swift --gen-json-emit fuzzer.fbs
|
fbc --swift --gen-json-emit fuzzer.fbs
|
||||||
cd ${swift_dir}
|
cd ${current_dir}
|
||||||
|
|
||||||
cd ${test_dir}/Flatbuffers.Test.Swift.WASM/Tests/FlatBuffers.Test.Swift.WASMTests
|
cd ${swift_dir}/Wasm.tests/Tests/FlatBuffers.Test.Swift.WasmTests
|
||||||
fbc --swift --gen-mutable --gen-json-emit --gen-object-api -I ${test_dir}/include_test ${test_dir}/monster_test.fbs
|
fbc --swift --gen-mutable --gen-json-emit --gen-object-api -I ${test_dir}/include_test ${test_dir}/monster_test.fbs
|
||||||
cd ${swift_dir}
|
cd ${current_dir}
|
||||||
|
|
||||||
swift build --build-tests
|
swift build --build-tests
|
||||||
swift test
|
swift test
|
Loading…
x
Reference in New Issue
Block a user