mirror of
https://github.com/apple/swift-system
synced 2026-11-22 04:30:46 +00:00
Test inferred rebased write buffers on current main
This commit is contained in:
commit
da235b4503
4 files changed
+41
-2
No files matched your search
@@ -0,0 +1,20 @@
|
||||
name: Create PR to merge release branch into the main branch
|
||||
# Changes should land on the earliest release branch they will need to ship on and then be automatically forwarded to main
|
||||
permissions:
|
||||
contents: read
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 9 * * *'
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
create_merge_pr:
|
||||
name: Create PR to merge release branch into main branch
|
||||
uses: swiftlang/github-workflows/.github/workflows/create_automerge_pr.yml@0.0.15
|
||||
with:
|
||||
base_branch: main
|
||||
head_branch: release/1.8.x
|
||||
pr_message: This PR was automatically opened by a GitHub action. Review the changes included in this PR and determine if they should be included on main. If yes, merge the PR. Otherwise revert changes that should not be included on this branch.
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
if: (github.event_name == 'schedule' && github.repository == 'apple/swift-system') || (github.event_name != 'schedule') # Ensure that we don't run this on a schedule in a fork
|
||||
@@ -5,7 +5,7 @@ permissions:
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, reopened, synchronize]
|
||||
types: [opened, reopened, synchronize, ready_for_review]
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
|
||||
@@ -120,7 +120,7 @@ Changes must land on the branch corresponding to the earliest release that they
|
||||
|
||||
`release/1.7.0` → `release/1.8.x` → `main`
|
||||
|
||||
For example, anything landing on `release/1.6.0` will eventually appear on `release/1.7.0`, then `release/1.8.x` and finally `main` as well. There is no need to file standalone PRs for each release line. (Change propagation currently requires manual work -- it is performed by project maintainers.)
|
||||
For example, anything landing on `release/1.7.0` will eventually appear on `release/1.8.x` and finally `main` as well. There is no need to file standalone PRs for each release line. (Merges into `main` are performed by the [automerger](.github/workflows/automerge_to_main.yml); propagation between release branches is performed by project maintainers.)
|
||||
|
||||
### Code of Conduct
|
||||
|
||||
|
||||
@@ -55,6 +55,25 @@ final class IORequestTests: XCTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
func testInferredRebasedWriteBuffer() {
|
||||
var bytes: [UInt8] = [1, 2, 3];
|
||||
bytes.withUnsafeMutableBytes { buffer in
|
||||
let written = 1
|
||||
let file = FileDescriptor(rawValue: 7)
|
||||
let request = IORing.Request.write(
|
||||
.init(rebasing: buffer[written...]), into: file, at: UInt64(written)
|
||||
).makeRawRequest(pathBuffers: PendingPathBuffers(reservedCapacity: 0))
|
||||
let registered = IORing.Request.write(
|
||||
.init(rebasing: buffer[written...]),
|
||||
into: IORing.RegisteredFile(resource: 7, index: 3), at: UInt64(written)
|
||||
).makeRawRequest(pathBuffers: PendingPathBuffers(reservedCapacity: 0))
|
||||
XCTAssertEqual(request.rawValue.len, 2)
|
||||
XCTAssertEqual(request.rawValue.off, 1)
|
||||
XCTAssertEqual(registered.rawValue.len, 2)
|
||||
XCTAssertEqual(registered.rawValue.off, 1)
|
||||
}
|
||||
}
|
||||
|
||||
func testMutableWriteFunctionReferences() {
|
||||
let write: (UnsafeMutableRawBufferPointer, FileDescriptor, UInt64, UInt64) -> IORing.Request =
|
||||
IORing.Request.write
|
||||
|
||||
Reference in new issue
Block a user