This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-swift.git
The following commit(s) were added to refs/heads/main by this push:
new d24935c chore: Move ArrowTests to standard layout (#109)
d24935c is described below
commit d24935c5d9b1e77d2af1246a0152ac8b0593c266
Author: willtemperley <[email protected]>
AuthorDate: Mon Nov 24 15:06:26 2025 +0800
chore: Move ArrowTests to standard layout (#109)
## What's Changed
ArrowTests has been moved to the standard package layout. Generated test
file paths have been updated.
Contributes toward closing #78.
---
Arrow/Package.resolved | 24 --------
Arrow/Package.swift | 64 ----------------------
Package.swift | 1 -
{Arrow => Sources/Arrow}/README.md | 0
.../ArrowTests/ArrayBuilderTest.swift | 0
{Arrow/Tests => Tests}/ArrowTests/ArrayTests.swift | 0
{Arrow/Tests => Tests}/ArrowTests/CDataTests.swift | 0
.../Tests => Tests}/ArrowTests/CodableTests.swift | 0
{Arrow/Tests => Tests}/ArrowTests/IPCTests.swift | 14 ++---
.../ArrowTests/RecordBatchTests.swift | 0
{Arrow/Tests => Tests}/ArrowTests/TableTests.swift | 0
ci/scripts/build.sh | 4 +-
12 files changed, 9 insertions(+), 98 deletions(-)
diff --git a/Arrow/Package.resolved b/Arrow/Package.resolved
deleted file mode 100644
index dbcdf89..0000000
--- a/Arrow/Package.resolved
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "originHash" :
"bb106e6059beb5430c27a8a7793fc88059bb1649f16304ce263b85ee54abf96f",
- "pins" : [
- {
- "identity" : "flatbuffers",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/google/flatbuffers.git",
- "state" : {
- "revision" : "187240970746d00bbd26b0f5873ed54d2477f9f3",
- "version" : "25.9.23"
- }
- },
- {
- "identity" : "swift-atomics",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/apple/swift-atomics.git",
- "state" : {
- "revision" : "b601256eab081c0f92f059e12818ac1d4f178ff7",
- "version" : "1.3.0"
- }
- }
- ],
- "version" : 3
-}
diff --git a/Arrow/Package.swift b/Arrow/Package.swift
deleted file mode 100644
index 4102b31..0000000
--- a/Arrow/Package.swift
+++ /dev/null
@@ -1,64 +0,0 @@
-// swift-tools-version: 5.10
-// The swift-tools-version declares the minimum version of Swift required to
build this package.
-
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-import PackageDescription
-
-let package = Package(
- name: "Arrow",
- platforms: [
- .macOS(.v10_14)
- ],
- products: [
- .library(
- name: "Arrow",
- targets: ["Arrow"])
- ],
- dependencies: [
- .package(url: "https://github.com/google/flatbuffers.git", exact:
"25.9.23"),
- .package(url: "https://github.com/apple/swift-atomics.git", from:
"1.3.0")
- ],
- targets: [
- .target(
- name: "ArrowC",
- path: "Sources/ArrowC",
- swiftSettings: [
- // build: .unsafeFlags(["-warnings-as-errors"])
- ]
-
- ),
- .target(
- name: "Arrow",
- dependencies: ["ArrowC",
- .product(name: "FlatBuffers", package:
"flatbuffers"),
- .product(name: "Atomics", package: "swift-atomics")
- ],
- swiftSettings: [
- // build: .unsafeFlags(["-warnings-as-errors"])
- ]
- ),
- .testTarget(
- name: "ArrowTests",
- dependencies: ["Arrow", "ArrowC"],
- swiftSettings: [
- // build: .unsafeFlags(["-warnings-as-errors"])
- ]
- )
- ]
-)
diff --git a/Package.swift b/Package.swift
index a98af60..09269b2 100644
--- a/Package.swift
+++ b/Package.swift
@@ -68,7 +68,6 @@ let package = Package(
.testTarget(
name: "ArrowTests",
dependencies: ["Arrow", "ArrowC"],
- path: "Arrow/Tests",
swiftSettings: [
// build: .unsafeFlags(["-warnings-as-errors"])
]
diff --git a/Arrow/README.md b/Sources/Arrow/README.md
similarity index 100%
rename from Arrow/README.md
rename to Sources/Arrow/README.md
diff --git a/Arrow/Tests/ArrowTests/ArrayBuilderTest.swift
b/Tests/ArrowTests/ArrayBuilderTest.swift
similarity index 100%
rename from Arrow/Tests/ArrowTests/ArrayBuilderTest.swift
rename to Tests/ArrowTests/ArrayBuilderTest.swift
diff --git a/Arrow/Tests/ArrowTests/ArrayTests.swift
b/Tests/ArrowTests/ArrayTests.swift
similarity index 100%
rename from Arrow/Tests/ArrowTests/ArrayTests.swift
rename to Tests/ArrowTests/ArrayTests.swift
diff --git a/Arrow/Tests/ArrowTests/CDataTests.swift
b/Tests/ArrowTests/CDataTests.swift
similarity index 100%
rename from Arrow/Tests/ArrowTests/CDataTests.swift
rename to Tests/ArrowTests/CDataTests.swift
diff --git a/Arrow/Tests/ArrowTests/CodableTests.swift
b/Tests/ArrowTests/CodableTests.swift
similarity index 100%
rename from Arrow/Tests/ArrowTests/CodableTests.swift
rename to Tests/ArrowTests/CodableTests.swift
diff --git a/Arrow/Tests/ArrowTests/IPCTests.swift
b/Tests/ArrowTests/IPCTests.swift
similarity index 99%
rename from Arrow/Tests/ArrowTests/IPCTests.swift
rename to Tests/ArrowTests/IPCTests.swift
index ea44b77..8496d50 100644
--- a/Arrow/Tests/ArrowTests/IPCTests.swift
+++ b/Tests/ArrowTests/IPCTests.swift
@@ -266,7 +266,7 @@ final class IPCStreamReaderTests: XCTestCase {
final class IPCFileReaderTests: XCTestCase { // swiftlint:disable:this
type_body_length
func testFileReader_double() throws {
- let fileURL =
currentDirectory().appendingPathComponent("../../testdata_double.arrow")
+ let fileURL =
currentDirectory().appendingPathComponent("testdata_double.arrow")
let arrowReader = ArrowReader()
let result = arrowReader.fromFile(fileURL)
let recordBatches: [RecordBatch]
@@ -300,14 +300,14 @@ final class IPCFileReaderTests: XCTestCase { //
swiftlint:disable:this type_body
}
func testFileReader_bool() throws {
- let fileURL =
currentDirectory().appendingPathComponent("../../testdata_bool.arrow")
+ let fileURL =
currentDirectory().appendingPathComponent("testdata_bool.arrow")
let arrowReader = ArrowReader()
try checkBoolRecordBatch(arrowReader.fromFile(fileURL))
}
func testFileWriter_bool() throws {
// read existing file
- let fileURL =
currentDirectory().appendingPathComponent("../../testdata_bool.arrow")
+ let fileURL =
currentDirectory().appendingPathComponent("testdata_bool.arrow")
let arrowReader = ArrowReader()
let fileRBs = try checkBoolRecordBatch(arrowReader.fromFile(fileURL))
let arrowWriter = ArrowWriter()
@@ -321,7 +321,7 @@ final class IPCFileReaderTests: XCTestCase { //
swiftlint:disable:this type_body
throw error
}
// write file record batches to another file
- let outputUrl =
currentDirectory().appendingPathComponent("../../testfilewriter_bool.arrow")
+ let outputUrl =
currentDirectory().appendingPathComponent("testfilewriter_bool.arrow")
switch arrowWriter.toFile(outputUrl, info: writerInfo) {
case .success:
try checkBoolRecordBatch(arrowReader.fromFile(outputUrl))
@@ -331,14 +331,14 @@ final class IPCFileReaderTests: XCTestCase { //
swiftlint:disable:this type_body
}
func testFileReader_struct() throws {
- let fileURL =
currentDirectory().appendingPathComponent("../../testdata_struct.arrow")
+ let fileURL =
currentDirectory().appendingPathComponent("testdata_struct.arrow")
let arrowReader = ArrowReader()
try checkStructRecordBatch(arrowReader.fromFile(fileURL))
}
func testFileWriter_struct() throws {
// read existing file
- let fileURL =
currentDirectory().appendingPathComponent("../../testdata_struct.arrow")
+ let fileURL =
currentDirectory().appendingPathComponent("testdata_struct.arrow")
let arrowReader = ArrowReader()
let fileRBs = try checkStructRecordBatch(arrowReader.fromFile(fileURL))
let arrowWriter = ArrowWriter()
@@ -352,7 +352,7 @@ final class IPCFileReaderTests: XCTestCase { //
swiftlint:disable:this type_body
throw error
}
// write file record batches to another file
- let outputUrl =
currentDirectory().appendingPathComponent("../../testfilewriter_struct.arrow")
+ let outputUrl =
currentDirectory().appendingPathComponent("testfilewriter_struct.arrow")
switch arrowWriter.toFile(outputUrl, info: writerInfo) {
case .success:
try checkStructRecordBatch(arrowReader.fromFile(outputUrl))
diff --git a/Arrow/Tests/ArrowTests/RecordBatchTests.swift
b/Tests/ArrowTests/RecordBatchTests.swift
similarity index 100%
rename from Arrow/Tests/ArrowTests/RecordBatchTests.swift
rename to Tests/ArrowTests/RecordBatchTests.swift
diff --git a/Arrow/Tests/ArrowTests/TableTests.swift
b/Tests/ArrowTests/TableTests.swift
similarity index 100%
rename from Arrow/Tests/ArrowTests/TableTests.swift
rename to Tests/ArrowTests/TableTests.swift
diff --git a/ci/scripts/build.sh b/ci/scripts/build.sh
index 043642d..8f2692c 100755
--- a/ci/scripts/build.sh
+++ b/ci/scripts/build.sh
@@ -53,12 +53,12 @@ export GOPATH="${build_dir}"
pushd "${data_gen_dir}"
go get -d ./...
go run .
-cp *.arrow ../../Arrow
+cp *.arrow ../../Tests/ArrowTests
popd
github_actions_group_end
github_actions_group_begin "Use -warnings-as-errors"
-for package in . Arrow ArrowFlight; do
+for package in . ArrowFlight; do
pushd "${build_dir}/source/${package}"
sed 's/\/\/ build://g' Package.swift > Package.swift.build
mv Package.swift.build Package.swift