https://github.com/ikesyo/swiftpmpackagetraitsexample1
https://github.com/swiftlang/swift-evolution/blob/main/proposals/0450-swiftpm-package-traits.md
https://github.com/ikesyo/swiftpmpackagetraitsexample1
Last synced: 6 months ago
JSON representation
https://github.com/swiftlang/swift-evolution/blob/main/proposals/0450-swiftpm-package-traits.md
- Host: GitHub
- URL: https://github.com/ikesyo/swiftpmpackagetraitsexample1
- Owner: ikesyo
- Created: 2025-01-05T04:54:58.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-11T01:44:32.000Z (over 1 year ago)
- Last Synced: 2026-02-06T13:48:23.394Z (6 months ago)
- Language: Swift
- Size: 4.88 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SwiftPMPackageTraitsExample1
https://github.com/swiftlang/swift-evolution/blob/main/proposals/0450-swiftpm-package-traits.md
Default (no traits):
```sh
$ swift test
Test Suite 'All tests' started at 2025-01-11 10:32:02.229.
Test Suite 'All tests' passed at 2025-01-11 10:32:02.230.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.001) seconds
◇ Test run started.
↳ Testing Library Version: 6.1 (a9f21aa1a8cd486)
↳ Target Platform: arm64-apple-macosx
◇ Test example() started.
✔ Test example() passed after 0.001 seconds.
✔ Test run with 1 test passed after 0.001 seconds.
```
Foo is enabled:
```sh
$ swift test --traits Foo
Test Suite 'All tests' started at 2025-01-11 10:32:24.621.
Test Suite 'All tests' passed at 2025-01-11 10:32:24.622.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.001) seconds
◇ Test run started.
↳ Testing Library Version: 6.1 (a9f21aa1a8cd486)
↳ Target Platform: arm64-apple-macosx
◇ Test example() started.
Foo is enabled: using Collections' OrderedSet
OrderedSet: ["Foo", "Bar", "Baz"]
✔ Test example() passed after 0.001 seconds.
✔ Test run with 1 test passed after 0.001 seconds.
```
Bar is enabled:
```sh
$ swift test --traits Bar
Test Suite 'All tests' started at 2025-01-11 10:32:41.077.
Test Suite 'All tests' passed at 2025-01-11 10:32:41.078.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.001) seconds
◇ Test run started.
↳ Testing Library Version: 6.1 (a9f21aa1a8cd486)
↳ Target Platform: arm64-apple-macosx
◇ Test example() started.
Bar is enabled: using Numerics' Complex
Complex: (1.0, 1.0)
✔ Test example() passed after 0.001 seconds.
✔ Test run with 1 test passed after 0.001 seconds.
```
FooBar is enabled:
```sh
$ swift test --traits FooBar
Test Suite 'All tests' started at 2025-01-11 10:32:54.602.
Test Suite 'All tests' passed at 2025-01-11 10:32:54.603.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.001) seconds
◇ Test run started.
↳ Testing Library Version: 6.1 (a9f21aa1a8cd486)
↳ Target Platform: arm64-apple-macosx
◇ Test example() started.
Foo is enabled: using Collections' OrderedSet
OrderedSet: ["Foo", "Bar", "Baz"]
Bar is enabled: using Numerics' Complex
Complex: (1.0, 1.0)
FooBar is enabled
✔ Test example() passed after 0.001 seconds.
✔ Test run with 1 test passed after 0.001 seconds.
```