Skip to content

Commit 63ad508

Browse files
committed
XCFramework Unit Tests
1 parent 23512f1 commit 63ad508

File tree

166 files changed

+480
-317
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+480
-317
lines changed

Exhaustive/Package/Tests/secp256k1Tests/XCTestManifests.swift

-1
This file was deleted.

Exhaustive/Package/Tests/secp256k1Tests/secp256k1Tests.swift

-1
This file was deleted.

Package.swift

+5-4
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ let package = Package(
77
products: [
88
// WARNING: These APIs should not be considered stable and may change at any time.
99
.library(name: "libsecp256k1", targets: ["libsecp256k1"]),
10+
.library(name: "libsecp256k1_zkp", targets: ["libsecp256k1_zkp"]),
1011
.library(name: "P256K", targets: ["P256K"]),
11-
.library(name: "zkp", targets: ["zkp"])
12+
.library(name: "ZKP", targets: ["ZKP"])
1213
],
1314
dependencies: [
1415
// Dependencies used for package development
@@ -19,13 +20,13 @@ let package = Package(
1920
],
2021
targets: [
2122
.target(name: "P256K", dependencies: ["libsecp256k1"]),
22-
.target(name: "zkp", dependencies: ["zkp_bindings"]),
23+
.target(name: "ZKP", dependencies: ["libsecp256k1_zkp"]),
2324
.target(
2425
name: "libsecp256k1",
2526
cSettings: PackageDescription.CSetting.baseSettings
2627
),
2728
.target(
28-
name: "zkp_bindings",
29+
name: "libsecp256k1_zkp",
2930
cSettings: PackageDescription.CSetting.baseSettings + [
3031
.define("ENABLE_MODULE_BPPP"),
3132
.define("ENABLE_MODULE_ECDSA_ADAPTOR"),
@@ -40,7 +41,7 @@ let package = Package(
4041
.headerSearchPath("../../Submodules/secp256k1-zkp/src")
4142
]
4243
),
43-
.testTarget(name: "zkpTests", dependencies: ["zkp"])
44+
.testTarget(name: "ZKPTests", dependencies: ["ZKP"])
4445
],
4546
swiftLanguageModes: [.v5],
4647
cLanguageStandard: .c89
File renamed without changes.
File renamed without changes.

Projects/Project.swift

+32-39
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
import ProjectDescription
22

3+
let deploymentTargets = ProjectDescription.DeploymentTargets.multiplatform(
4+
iOS: "18.0",
5+
macOS: "15.0",
6+
watchOS: "11.0",
7+
tvOS: "18.0",
8+
visionOS: "2.0"
9+
)
10+
311
let project = Project(
412
name: "XCFramework",
513
packages: [
@@ -17,14 +25,7 @@ let project = Project(
1725
destinations: [.iPhone, .iPad, .mac, .appleWatch, .appleTv, .appleVision],
1826
product: .staticFramework,
1927
bundleId: "dev.21.P256K",
20-
deploymentTargets:
21-
.multiplatform(
22-
iOS: "18.0",
23-
macOS: "15.0",
24-
watchOS: "11.0",
25-
tvOS: "18.0",
26-
visionOS: "2.0"
27-
),
28+
deploymentTargets: deploymentTargets,
2829
sources: ["Sources/P256K/**"],
2930
resources: [],
3031
dependencies: [
@@ -38,48 +39,40 @@ let project = Project(
3839
)
3940
),
4041
.target(
41-
name: "XCFrameworkApp",
42+
name: "P256KTests",
4243
destinations: [.iPhone, .iPad, .mac, .appleWatch, .appleTv, .appleVision],
44+
product: .unitTests,
45+
bundleId: "dev.21.P256KTests",
46+
deploymentTargets: deploymentTargets,
47+
sources: ["Sources/P256KTests/**"],
48+
dependencies: [.target(name: "P256K")],
49+
settings: .settings(
50+
configurations: [
51+
.debug(name: "Debug", xcconfig: "Resources/P256KTests/Debug.xcconfig"),
52+
.release(name: "Release", xcconfig: "Resources/P256KTests/Release.xcconfig")
53+
]
54+
)
55+
),
56+
.target(
57+
name: "XCFrameworkApp",
58+
destinations: [.iPhone, .iPad, .mac, .appleTv, .appleVision],
4359
product: .app,
4460
bundleId: "dev.21.XCFrameworkApp",
45-
infoPlist: .extendingDefault(
46-
with: [
47-
"UILaunchScreen": [
48-
"UIColorName": "",
49-
"UIImageName": "",
50-
],
51-
]
52-
),
5361
sources: ["Sources/XCFrameworkApp/**"],
54-
resources: ["Resources/XCFrameworkApp/**"],
62+
resources: [
63+
"Resources/XCFrameworkApp/Assets.xcassets/**",
64+
"Resources/XCFrameworkApp/Preview Content/**"
65+
],
66+
entitlements: "Resources/XCFrameworkApp/XCFrameworkApp.entitlements",
5567
dependencies: [
5668
.target(name: "P256K")
5769
],
5870
settings: .settings(
5971
configurations: [
60-
.debug(name: "Debug", xcconfig: "Resources/P256K/Debug.xcconfig"),
61-
.release(name: "Release", xcconfig: "Resources/P256K/Release.xcconfig")
72+
.debug(name: "Debug", xcconfig: "Resources/XCFrameworkApp/Debug.xcconfig"),
73+
.release(name: "Release", xcconfig: "Resources/XCFrameworkApp/Release.xcconfig")
6274
]
6375
)
6476
)
65-
// .target(
66-
// name: "XCFrameworkTests",
67-
// destinations: .iOS,
68-
// product: .unitTests,
69-
// bundleId: "dev.21.XCFrameworkTests",
70-
// infoPlist: nil,
71-
// sources: ["Sources/XCFrameworkTests/**"],
72-
// resources: ["Resources/XCFrameworkTests/**"],
73-
// dependencies: [.target(name: "secp256k1")],
74-
// settings: .settings(
75-
// base: [
76-
// "SDKROOT": "auto"
77-
// ],
78-
// configurations: [
79-
// .debug(name: "Debug", xcconfig: "Resources/XCFrameworkTests/Debug.xcconfig"),
80-
// .release(name: "Release", xcconfig: "Resources/XCFrameworkTests/Release.xcconfig")
81-
// ]
82-
// )
83-
// ),
8477
]
8578
)
File renamed without changes.

Projects/Resources/P256K/Debug.xcconfig

+1-15
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,4 @@ ENABLE_TESTABILITY = YES
6666
//
6767
// If enabled, perform validation checks on the product as part of the build process.
6868

69-
VALIDATE_PRODUCT = NO
70-
71-
72-
//********************************************//
73-
//* Swift Compiler - General *//
74-
//********************************************//
75-
76-
77-
// Install Generated Header
78-
//
79-
// For frameworks, install the C++/Objective-C generated header describing bridged
80-
// Swift types into the PUBLIC_HEADERS_FOLDER_PATH so they may be accessed from
81-
// Objective-C or C++ code using the framework. Defaults to YES.
82-
83-
SWIFT_INSTALL_OBJC_HEADER = YES
69+
VALIDATE_PRODUCT = NO

Projects/Resources/P256K/Release.xcconfig

-14
Original file line numberDiff line numberDiff line change
@@ -131,17 +131,3 @@ ENABLE_NS_ASSERTIONS = NO
131131
// Space-separated list of preprocessor macros of the form foo or foo=bar.
132132

133133
GCC_PREPROCESSOR_DEFINITIONS =
134-
135-
136-
//********************************************//
137-
//* Swift Compiler - General *//
138-
//********************************************//
139-
140-
141-
// Install Generated Header
142-
//
143-
// For frameworks, install the C++/Objective-C generated header describing bridged
144-
// Swift types into the PUBLIC_HEADERS_FOLDER_PATH so they may be accessed from
145-
// Objective-C or C++ code using the framework. Defaults to YES.
146-
147-
SWIFT_INSTALL_OBJC_HEADER = YES

Projects/Resources/P256K/Shared.xcconfig

+14
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,20 @@ MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = gnu99 gnu++20
243243
MODULE_VERIFIER_SUPPORTED_LANGUAGES = objective-c objective-c++
244244

245245

246+
//********************************************//
247+
//* Swift Compiler - General *//
248+
//********************************************//
249+
250+
251+
// Install Generated Header
252+
//
253+
// For frameworks, install the C++/Objective-C generated header describing bridged
254+
// Swift types into the PUBLIC_HEADERS_FOLDER_PATH so they may be accessed from
255+
// Objective-C or C++ code using the framework. Defaults to YES.
256+
257+
SWIFT_INSTALL_OBJC_HEADER = YES
258+
259+
246260
//********************************************//
247261
//* Static Analysis - Issues - Security *//
248262
//********************************************//
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//
2+
// Debug.xcconfig
3+
//
4+
// Generated by BuildSettingExtractor on 2/3/25
5+
// https://buildsettingextractor.com
6+
//
7+
8+
#include "Shared.xcconfig"
9+
10+
//********************************************//
11+
//* Currently no build settings in this file *//
12+
//********************************************//
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//
2+
// Release.xcconfig
3+
//
4+
// Generated by BuildSettingExtractor on 2/3/25
5+
// https://buildsettingextractor.com
6+
//
7+
8+
#include "Shared.xcconfig"
9+
10+
//********************************************//
11+
//* Currently no build settings in this file *//
12+
//********************************************//
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
//
2+
// Shared.xcconfig
3+
//
4+
// Generated by BuildSettingExtractor on 2/3/25
5+
// https://buildsettingextractor.com
6+
//
7+
8+
// Code Signing Style
9+
//
10+
// This setting specifies the method used to acquire and locate signing assets. Choose
11+
// `Automatic` to let Xcode automatically create and update profiles, app IDs, and
12+
// certificates. Choose `Manual` to create and update these yourself on the developer
13+
// website.
14+
15+
CODE_SIGN_STYLE = Automatic
16+
17+
18+
19+
// Current Project Version
20+
//
21+
// This setting defines the current version of the project. The value must be a integer
22+
// or floating point number, such as `57` or `365.8`.
23+
//
24+
// When `GENERATE_INFOPLIST_FILE` is enabled, sets the value of the
25+
// [CFBundleVersion](https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleversion)
26+
// key in the `Info.plist` file to the value of this build setting.
27+
28+
CURRENT_PROJECT_VERSION = 1
29+
30+
31+
32+
// Generate Info.plist File
33+
//
34+
// If enabled, automatically generate an Info.plist file with content from build
35+
// settings, and from content in the file pointed to by `INFOPLIST_FILE`, if defined.
36+
37+
GENERATE_INFOPLIST_FILE = YES
38+
39+
40+
41+
// Marketing Version
42+
//
43+
// This setting defines the user-visible version of the project.
44+
//
45+
// When `GENERATE_INFOPLIST_FILE` is enabled, sets the value of the
46+
// [CFBundleShortVersionString](https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleshortversionstring)
47+
// key in the `Info.plist` file to the value of this build setting.
48+
49+
MARKETING_VERSION = 1.0
50+
51+
52+
53+
// Product Bundle Identifier
54+
//
55+
// A string that uniquely identifies the bundle. The string should be in reverse DNS
56+
// format using only alphanumeric characters (`A-Z`, `a-z`, `0-9`), the dot (`.`), and
57+
// the hyphen (`-`).
58+
//
59+
// When `GENERATE_INFOPLIST_FILE` is enabled, sets the value of the
60+
// [CFBundleIdentifier](https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleidentifier)
61+
// key in the `Info.plist` file to the value of this build setting.
62+
63+
PRODUCT_BUNDLE_IDENTIFIER = dev.21.P256KTests
64+
65+
66+
67+
// Product Name
68+
//
69+
// This is the basename of the product generated by the target.
70+
//
71+
// When `GENERATE_INFOPLIST_FILE` is enabled, sets the value of the
72+
// [CFBundleName](https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundlename)
73+
// key in the `Info.plist` file to the value of this build setting.
74+
75+
PRODUCT_NAME = $(TARGET_NAME)
76+
77+
78+
79+
// Use Compiler to Extract Swift Strings
80+
//
81+
// When enabled, the Swift compiler will be used to extract Swift string literal and
82+
// interpolation `LocalizedStringKey` and `LocalizationKey` types during localization
83+
// export.
84+
85+
SWIFT_EMIT_LOC_STRINGS = NO
86+
87+
88+
89+
// Swift Language Version
90+
//
91+
// The language version used to compile the target's Swift code.
92+
93+
SWIFT_VERSION = 5.0
94+
95+
96+
97+
// Targeted Device Families
98+
//
99+
// Comma-separated list of integers corresponding to device families supported by this
100+
// target.
101+
//
102+
// The build system uses this information to set the correct value for the
103+
// `UIDeviceFamily` key it adds to the target's `Info.plist` file. Values inapplicable to
104+
// the current platform will be removed automatically. This also drives the
105+
// `--target-device` flag to actool, which determines the idioms selected during catalog
106+
// compilation.
107+
//
108+
// Possible values include:
109+
// * *1*: iPhone, iPod touch
110+
// * *2*: iPad, Mac Catalyst using "Scaled to Match iPad" Interface
111+
// * *3*: Apple TV
112+
// * *4*: Apple Watch
113+
// * *6*: Mac Catalyst using "Optimize for Mac" Interface
114+
// * *7*: Apple Vision
115+
116+
TARGETED_DEVICE_FAMILY = 1,2

Projects/Resources/XCFrameworkApp/Shared.xcconfig

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ CURRENT_PROJECT_VERSION = 1
6060
// Files and directories used only for development. Archive and install builds will
6161
// exclude this content.
6262

63-
DEVELOPMENT_ASSET_PATHS = "XCFrameworkApp/Preview Content"
63+
DEVELOPMENT_ASSET_PATHS = "Resources/XCFrameworkApp/Preview Content"
6464

6565

6666

@@ -269,7 +269,7 @@ SWIFT_VERSION = 5.0
269269
// * *6*: Mac Catalyst using "Optimize for Mac" Interface
270270
// * *7*: Apple Vision
271271

272-
TARGETED_DEVICE_FAMILY = 1,2,7
272+
TARGETED_DEVICE_FAMILY = 1,2,3,6,7
273273

274274

275275

Projects/Sources/P256K/Exports.swift

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../Tests/ZKPTests/P256KTests.swift

Projects/Sources/XCFrameworkTests/XCFrameworkTests.swift

-17
This file was deleted.

Sources/P256K/Exports.swift

-1
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)