Skip to content

Commit 6797bac

Browse files
author
David Brown
committed
Add functests to CI validation
1 parent a40ed1b commit 6797bac

File tree

14 files changed

+988
-24
lines changed

14 files changed

+988
-24
lines changed

build-ios.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ cd out
2828

2929
CMAKE_PACKAGE_TYPE=tgz
3030

31-
cmake -DBUILD_IOS=YES -DBUILD_SIMULATOR=YES -DBUILD_UNIT_TESTS=YES -DBUILD_FUNC_TESTS=NO -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_PACKAGE_TYPE=$CMAKE_PACKAGE_TYPE ..
31+
cmake -DBUILD_IOS=YES -DBUILD_SIMULATOR=YES -DBUILD_UNIT_TESTS=YES -DBUILD_FUNC_TESTS=YES -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_PACKAGE_TYPE=$CMAKE_PACKAGE_TYPE ..
3232
make
3333

3434
make package

build-tests-ios.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ set -e
88

99
cd tests/unittests
1010
xcodebuild test -scheme iOSUnitTests -destination "platform=iOS Simulator,name=$SIMULATOR"
11+
12+
cd ../functests
13+
xcodebuild test -scheme iOSFuncTests -destination "platform=iOS Simulator,name=$SIMULATOR"
Lines changed: 289 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,289 @@
1+
// !$*UTF8*$!
2+
{
3+
archiveVersion = 1;
4+
classes = {
5+
};
6+
objectVersion = 50;
7+
objects = {
8+
9+
/* Begin PBXBuildFile section */
10+
430102D0235E640000836D50 /* functests_ios.m in Sources */ = {isa = PBXBuildFile; fileRef = 430102CF235E640000836D50 /* functests_ios.m */; };
11+
430102D1235E640000836D50 /* functests_ios.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 430102CE235E640000836D50 /* functests_ios.h */; };
12+
/* End PBXBuildFile section */
13+
14+
/* Begin PBXCopyFilesBuildPhase section */
15+
430102C9235E640000836D50 /* CopyFiles */ = {
16+
isa = PBXCopyFilesBuildPhase;
17+
buildActionMask = 2147483647;
18+
dstPath = "include/$(PRODUCT_NAME)";
19+
dstSubfolderSpec = 16;
20+
files = (
21+
430102D1235E640000836D50 /* functests_ios.h in CopyFiles */,
22+
);
23+
runOnlyForDeploymentPostprocessing = 0;
24+
};
25+
/* End PBXCopyFilesBuildPhase section */
26+
27+
/* Begin PBXFileReference section */
28+
430102CB235E640000836D50 /* libfunctests-ios.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libfunctests-ios.a"; sourceTree = BUILT_PRODUCTS_DIR; };
29+
430102CE235E640000836D50 /* functests_ios.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = functests_ios.h; sourceTree = "<group>"; };
30+
430102CF235E640000836D50 /* functests_ios.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = functests_ios.m; sourceTree = "<group>"; };
31+
/* End PBXFileReference section */
32+
33+
/* Begin PBXFrameworksBuildPhase section */
34+
430102C8235E640000836D50 /* Frameworks */ = {
35+
isa = PBXFrameworksBuildPhase;
36+
buildActionMask = 2147483647;
37+
files = (
38+
);
39+
runOnlyForDeploymentPostprocessing = 0;
40+
};
41+
/* End PBXFrameworksBuildPhase section */
42+
43+
/* Begin PBXGroup section */
44+
430102C2235E640000836D50 = {
45+
isa = PBXGroup;
46+
children = (
47+
430102CD235E640000836D50 /* functests-ios */,
48+
430102CC235E640000836D50 /* Products */,
49+
);
50+
sourceTree = "<group>";
51+
};
52+
430102CC235E640000836D50 /* Products */ = {
53+
isa = PBXGroup;
54+
children = (
55+
430102CB235E640000836D50 /* libfunctests-ios.a */,
56+
);
57+
name = Products;
58+
sourceTree = "<group>";
59+
};
60+
430102CD235E640000836D50 /* functests-ios */ = {
61+
isa = PBXGroup;
62+
children = (
63+
430102CE235E640000836D50 /* functests_ios.h */,
64+
430102CF235E640000836D50 /* functests_ios.m */,
65+
);
66+
path = "functests-ios";
67+
sourceTree = "<group>";
68+
};
69+
/* End PBXGroup section */
70+
71+
/* Begin PBXNativeTarget section */
72+
430102CA235E640000836D50 /* functests-ios */ = {
73+
isa = PBXNativeTarget;
74+
buildConfigurationList = 430102D4235E640000836D50 /* Build configuration list for PBXNativeTarget "functests-ios" */;
75+
buildPhases = (
76+
430102C7235E640000836D50 /* Sources */,
77+
430102C8235E640000836D50 /* Frameworks */,
78+
430102C9235E640000836D50 /* CopyFiles */,
79+
);
80+
buildRules = (
81+
);
82+
dependencies = (
83+
);
84+
name = "functests-ios";
85+
productName = "functests-ios";
86+
productReference = 430102CB235E640000836D50 /* libfunctests-ios.a */;
87+
productType = "com.apple.product-type.library.static";
88+
};
89+
/* End PBXNativeTarget section */
90+
91+
/* Begin PBXProject section */
92+
430102C3235E640000836D50 /* Project object */ = {
93+
isa = PBXProject;
94+
attributes = {
95+
LastUpgradeCheck = 1100;
96+
ORGANIZATIONNAME = "David Brown";
97+
TargetAttributes = {
98+
430102CA235E640000836D50 = {
99+
CreatedOnToolsVersion = 11.0;
100+
};
101+
};
102+
};
103+
buildConfigurationList = 430102C6235E640000836D50 /* Build configuration list for PBXProject "functests-ios" */;
104+
compatibilityVersion = "Xcode 9.3";
105+
developmentRegion = en;
106+
hasScannedForEncodings = 0;
107+
knownRegions = (
108+
en,
109+
Base,
110+
);
111+
mainGroup = 430102C2235E640000836D50;
112+
productRefGroup = 430102CC235E640000836D50 /* Products */;
113+
projectDirPath = "";
114+
projectRoot = "";
115+
targets = (
116+
430102CA235E640000836D50 /* functests-ios */,
117+
);
118+
};
119+
/* End PBXProject section */
120+
121+
/* Begin PBXSourcesBuildPhase section */
122+
430102C7235E640000836D50 /* Sources */ = {
123+
isa = PBXSourcesBuildPhase;
124+
buildActionMask = 2147483647;
125+
files = (
126+
430102D0235E640000836D50 /* functests_ios.m in Sources */,
127+
);
128+
runOnlyForDeploymentPostprocessing = 0;
129+
};
130+
/* End PBXSourcesBuildPhase section */
131+
132+
/* Begin XCBuildConfiguration section */
133+
430102D2235E640000836D50 /* Debug */ = {
134+
isa = XCBuildConfiguration;
135+
buildSettings = {
136+
ALWAYS_SEARCH_USER_PATHS = NO;
137+
CLANG_ANALYZER_NONNULL = YES;
138+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
139+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
140+
CLANG_CXX_LIBRARY = "libc++";
141+
CLANG_ENABLE_MODULES = YES;
142+
CLANG_ENABLE_OBJC_ARC = YES;
143+
CLANG_ENABLE_OBJC_WEAK = YES;
144+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
145+
CLANG_WARN_BOOL_CONVERSION = YES;
146+
CLANG_WARN_COMMA = YES;
147+
CLANG_WARN_CONSTANT_CONVERSION = YES;
148+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
149+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
150+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
151+
CLANG_WARN_EMPTY_BODY = YES;
152+
CLANG_WARN_ENUM_CONVERSION = YES;
153+
CLANG_WARN_INFINITE_RECURSION = YES;
154+
CLANG_WARN_INT_CONVERSION = YES;
155+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
156+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
157+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
158+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
159+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
160+
CLANG_WARN_STRICT_PROTOTYPES = YES;
161+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
162+
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
163+
CLANG_WARN_UNREACHABLE_CODE = YES;
164+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
165+
COPY_PHASE_STRIP = NO;
166+
DEBUG_INFORMATION_FORMAT = dwarf;
167+
ENABLE_STRICT_OBJC_MSGSEND = YES;
168+
ENABLE_TESTABILITY = YES;
169+
GCC_C_LANGUAGE_STANDARD = gnu11;
170+
GCC_DYNAMIC_NO_PIC = NO;
171+
GCC_NO_COMMON_BLOCKS = YES;
172+
GCC_OPTIMIZATION_LEVEL = 0;
173+
GCC_PREPROCESSOR_DEFINITIONS = (
174+
"DEBUG=1",
175+
"$(inherited)",
176+
);
177+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
178+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
179+
GCC_WARN_UNDECLARED_SELECTOR = YES;
180+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
181+
GCC_WARN_UNUSED_FUNCTION = YES;
182+
GCC_WARN_UNUSED_VARIABLE = YES;
183+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
184+
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
185+
MTL_FAST_MATH = YES;
186+
ONLY_ACTIVE_ARCH = YES;
187+
SDKROOT = iphoneos;
188+
};
189+
name = Debug;
190+
};
191+
430102D3235E640000836D50 /* Release */ = {
192+
isa = XCBuildConfiguration;
193+
buildSettings = {
194+
ALWAYS_SEARCH_USER_PATHS = NO;
195+
CLANG_ANALYZER_NONNULL = YES;
196+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
197+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
198+
CLANG_CXX_LIBRARY = "libc++";
199+
CLANG_ENABLE_MODULES = YES;
200+
CLANG_ENABLE_OBJC_ARC = YES;
201+
CLANG_ENABLE_OBJC_WEAK = YES;
202+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
203+
CLANG_WARN_BOOL_CONVERSION = YES;
204+
CLANG_WARN_COMMA = YES;
205+
CLANG_WARN_CONSTANT_CONVERSION = YES;
206+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
207+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
208+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
209+
CLANG_WARN_EMPTY_BODY = YES;
210+
CLANG_WARN_ENUM_CONVERSION = YES;
211+
CLANG_WARN_INFINITE_RECURSION = YES;
212+
CLANG_WARN_INT_CONVERSION = YES;
213+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
214+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
215+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
216+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
217+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
218+
CLANG_WARN_STRICT_PROTOTYPES = YES;
219+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
220+
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
221+
CLANG_WARN_UNREACHABLE_CODE = YES;
222+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
223+
COPY_PHASE_STRIP = NO;
224+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
225+
ENABLE_NS_ASSERTIONS = NO;
226+
ENABLE_STRICT_OBJC_MSGSEND = YES;
227+
GCC_C_LANGUAGE_STANDARD = gnu11;
228+
GCC_NO_COMMON_BLOCKS = YES;
229+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
230+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
231+
GCC_WARN_UNDECLARED_SELECTOR = YES;
232+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
233+
GCC_WARN_UNUSED_FUNCTION = YES;
234+
GCC_WARN_UNUSED_VARIABLE = YES;
235+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
236+
MTL_ENABLE_DEBUG_INFO = NO;
237+
MTL_FAST_MATH = YES;
238+
SDKROOT = iphoneos;
239+
VALIDATE_PRODUCT = YES;
240+
};
241+
name = Release;
242+
};
243+
430102D5235E640000836D50 /* Debug */ = {
244+
isa = XCBuildConfiguration;
245+
buildSettings = {
246+
CODE_SIGN_STYLE = Automatic;
247+
OTHER_LDFLAGS = "-ObjC";
248+
PRODUCT_NAME = "$(TARGET_NAME)";
249+
SKIP_INSTALL = YES;
250+
TARGETED_DEVICE_FAMILY = "1,2";
251+
};
252+
name = Debug;
253+
};
254+
430102D6235E640000836D50 /* Release */ = {
255+
isa = XCBuildConfiguration;
256+
buildSettings = {
257+
CODE_SIGN_STYLE = Automatic;
258+
OTHER_LDFLAGS = "-ObjC";
259+
PRODUCT_NAME = "$(TARGET_NAME)";
260+
SKIP_INSTALL = YES;
261+
TARGETED_DEVICE_FAMILY = "1,2";
262+
};
263+
name = Release;
264+
};
265+
/* End XCBuildConfiguration section */
266+
267+
/* Begin XCConfigurationList section */
268+
430102C6235E640000836D50 /* Build configuration list for PBXProject "functests-ios" */ = {
269+
isa = XCConfigurationList;
270+
buildConfigurations = (
271+
430102D2235E640000836D50 /* Debug */,
272+
430102D3235E640000836D50 /* Release */,
273+
);
274+
defaultConfigurationIsVisible = 0;
275+
defaultConfigurationName = Release;
276+
};
277+
430102D4235E640000836D50 /* Build configuration list for PBXNativeTarget "functests-ios" */ = {
278+
isa = XCConfigurationList;
279+
buildConfigurations = (
280+
430102D5235E640000836D50 /* Debug */,
281+
430102D6235E640000836D50 /* Release */,
282+
);
283+
defaultConfigurationIsVisible = 0;
284+
defaultConfigurationName = Release;
285+
};
286+
/* End XCConfigurationList section */
287+
};
288+
rootObject = 430102C3235E640000836D50 /* Project object */;
289+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>SchemeUserState</key>
6+
<dict>
7+
<key>functests-ios.xcscheme_^#shared#^_</key>
8+
<dict>
9+
<key>orderHint</key>
10+
<integer>0</integer>
11+
</dict>
12+
</dict>
13+
</dict>
14+
</plist>

tests/functests/CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ set(SRCS
1414
source_group(" " REGULAR_EXPRESSION "")
1515
source_group("common" REGULAR_EXPRESSION "/tests/common/")
1616

17-
add_executable(FuncTests ${SRCS} ${TESTS_COMMON_SRCS})
17+
if(BUILD_IOS)
18+
add_library(FuncTests ${SRCS} ${TESTS_COMMON_SRCS})
19+
else()
20+
add_executable(FuncTests ${SRCS} ${TESTS_COMMON_SRCS})
21+
endif()
1822

1923
if(PAL_IMPLEMENTATION STREQUAL "WIN32")
2024
# Link against prebuilt libraries on Windows
@@ -51,7 +55,10 @@ else()
5155
set (PLATFORM_LIBS "")
5256
# Add flags for obtaining system UUID via IOKit
5357
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
54-
set (PLATFORM_LIBS "-framework CoreFoundation -framework IOKit")
58+
set (PLATFORM_LIBS "-framework CoreFoundation -framework IOKit -framework SystemConfiguration -framework Foundation")
59+
if(BUILD_IOS)
60+
set (PLATFORM_LIBS "${PLATFORM_LIBS} -framework UIKit")
61+
endif()
5562
endif()
5663

5764
# Raspberry Pi 4 with gcc-8 on ARMv7l requires -latomic

tests/functests/Tests/Info.plist

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleVersion</key>
20+
<string>1</string>
21+
</dict>
22+
</plist>

0 commit comments

Comments
 (0)