Skip to content

Commit 5e3140e

Browse files
authored
Merge pull request #170 from microsoft/dabrow/ios-functests
Add functests to iOS CI validation
2 parents 2981c85 + 5cdcab8 commit 5e3140e

File tree

12 files changed

+685
-24
lines changed

12 files changed

+685
-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"
File renamed without changes.

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>

tests/functests/functests-ios.xcodeproj/project.pbxproj

Lines changed: 486 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1100"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "430102CA235E640000836D50"
18+
BuildableName = "libfunctests-ios.a"
19+
BlueprintName = "functests-ios"
20+
ReferencedContainer = "container:functests-ios.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = ""
28+
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
</TestAction>
33+
<LaunchAction
34+
buildConfiguration = "Debug"
35+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37+
launchStyle = "0"
38+
useCustomWorkingDirectory = "NO"
39+
ignoresPersistentStateOnLaunch = "NO"
40+
debugDocumentVersioning = "YES"
41+
debugServiceExtension = "internal"
42+
allowLocationSimulation = "YES">
43+
</LaunchAction>
44+
<ProfileAction
45+
buildConfiguration = "Release"
46+
shouldUseLaunchSchemeArgsEnv = "YES"
47+
savedToolIdentifier = ""
48+
useCustomWorkingDirectory = "NO"
49+
debugDocumentVersioning = "YES">
50+
<MacroExpansion>
51+
<BuildableReference
52+
BuildableIdentifier = "primary"
53+
BlueprintIdentifier = "430102CA235E640000836D50"
54+
BuildableName = "libfunctests-ios.a"
55+
BlueprintName = "functests-ios"
56+
ReferencedContainer = "container:functests-ios.xcodeproj">
57+
</BuildableReference>
58+
</MacroExpansion>
59+
</ProfileAction>
60+
<AnalyzeAction
61+
buildConfiguration = "Debug">
62+
</AnalyzeAction>
63+
<ArchiveAction
64+
buildConfiguration = "Release"
65+
revealArchiveInOrganizer = "YES">
66+
</ArchiveAction>
67+
</Scheme>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1100"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
</BuildAction>
9+
<TestAction
10+
buildConfiguration = "Release"
11+
selectedDebuggerIdentifier = ""
12+
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
13+
shouldUseLaunchSchemeArgsEnv = "YES">
14+
<Testables>
15+
<TestableReference
16+
skipped = "NO">
17+
<BuildableReference
18+
BuildableIdentifier = "primary"
19+
BlueprintIdentifier = "430102F8235E67C900836D50"
20+
BuildableName = "Tests.xctest"
21+
BlueprintName = "Tests"
22+
ReferencedContainer = "container:functests-ios.xcodeproj">
23+
</BuildableReference>
24+
</TestableReference>
25+
</Testables>
26+
</TestAction>
27+
<LaunchAction
28+
buildConfiguration = "Debug"
29+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
30+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
31+
launchStyle = "0"
32+
useCustomWorkingDirectory = "NO"
33+
ignoresPersistentStateOnLaunch = "NO"
34+
debugDocumentVersioning = "YES"
35+
debugServiceExtension = "internal"
36+
allowLocationSimulation = "YES">
37+
</LaunchAction>
38+
<ProfileAction
39+
buildConfiguration = "Release"
40+
shouldUseLaunchSchemeArgsEnv = "YES"
41+
savedToolIdentifier = ""
42+
useCustomWorkingDirectory = "NO"
43+
debugDocumentVersioning = "YES">
44+
</ProfileAction>
45+
<AnalyzeAction
46+
buildConfiguration = "Debug">
47+
</AnalyzeAction>
48+
<ArchiveAction
49+
buildConfiguration = "Release"
50+
revealArchiveInOrganizer = "YES">
51+
</ArchiveAction>
52+
</Scheme>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
<key>iOSFuncTests.xcscheme_^#shared#^_</key>
13+
<dict>
14+
<key>orderHint</key>
15+
<integer>1</integer>
16+
</dict>
17+
</dict>
18+
<key>SuppressBuildableAutocreation</key>
19+
<dict>
20+
<key>430102DA235E650900836D50</key>
21+
<dict>
22+
<key>primary</key>
23+
<true/>
24+
</dict>
25+
<key>430102F8235E67C900836D50</key>
26+
<dict>
27+
<key>primary</key>
28+
<true/>
29+
</dict>
30+
</dict>
31+
</dict>
32+
</plist>

tests/unittests/unittests-ios.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
430102E5235E660F00836D50 /* iOSWrapper.mm in Sources */ = {isa = PBXBuildFile; fileRef = 430102E4235E660F00836D50 /* iOSWrapper.mm */; };
1011
431EFE50233EBE54002FCC18 /* HttpClientTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 431EFE2A233EBE53002FCC18 /* HttpClientTests.cpp */; };
1112
431EFE51233EBE54002FCC18 /* LoggerTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 431EFE2B233EBE53002FCC18 /* LoggerTests.cpp */; };
1213
431EFE52233EBE54002FCC18 /* HttpDeflateCompressionTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 431EFE2C233EBE53002FCC18 /* HttpDeflateCompressionTests.cpp */; };
@@ -40,7 +41,6 @@
4041
431EFE73233EBE54002FCC18 /* PackagerTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 431EFE4D233EBE54002FCC18 /* PackagerTests.cpp */; };
4142
431EFE74233EBE54002FCC18 /* MetaStatsTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 431EFE4E233EBE54002FCC18 /* MetaStatsTests.cpp */; };
4243
431EFE75233EBE54002FCC18 /* HttpResponseDecoderTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 431EFE4F233EBE54002FCC18 /* HttpResponseDecoderTests.cpp */; };
43-
431EFE7E233EC413002FCC18 /* Tests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 431EFE7D233EC413002FCC18 /* Tests.mm */; };
4444
431EFE94233EC560002FCC18 /* libgmock.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 431EFE93233EC560002FCC18 /* libgmock.a */; };
4545
431EFE95233EC590002FCC18 /* BackoffTests_ExponentialWithJitter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 431EFE30233EBE53002FCC18 /* BackoffTests_ExponentialWithJitter.cpp */; };
4646
431EFE96233EC590002FCC18 /* BondSplicerTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 431EFE36233EBE53002FCC18 /* BondSplicerTests.cpp */; };
@@ -109,6 +109,7 @@
109109
/* End PBXCopyFilesBuildPhase section */
110110

111111
/* Begin PBXFileReference section */
112+
430102E4235E660F00836D50 /* iOSWrapper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = iOSWrapper.mm; path = ../../common/iOSWrapper.mm; sourceTree = "<group>"; };
112113
431EFE1E233EBDF2002FCC18 /* libunittests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libunittests.a; sourceTree = BUILT_PRODUCTS_DIR; };
113114
431EFE2A233EBE53002FCC18 /* HttpClientTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HttpClientTests.cpp; sourceTree = "<group>"; };
114115
431EFE2B233EBE53002FCC18 /* LoggerTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LoggerTests.cpp; sourceTree = "<group>"; };
@@ -144,7 +145,6 @@
144145
431EFE4E233EBE54002FCC18 /* MetaStatsTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MetaStatsTests.cpp; sourceTree = "<group>"; };
145146
431EFE4F233EBE54002FCC18 /* HttpResponseDecoderTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HttpResponseDecoderTests.cpp; sourceTree = "<group>"; };
146147
431EFE7B233EC413002FCC18 /* Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
147-
431EFE7D233EC413002FCC18 /* Tests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = Tests.mm; sourceTree = "<group>"; };
148148
431EFE7F233EC413002FCC18 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
149149
431EFE93233EC560002FCC18 /* libgmock.a */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.objfile"; name = libgmock.a; path = ../../../googletest/build/googlemock/libgmock.a; sourceTree = "<group>"; };
150150
431EFEBD233EC5C9002FCC18 /* libmat.a */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.objfile"; name = libmat.a; path = ../../../out/lib/libmat.a; sourceTree = "<group>"; };
@@ -238,11 +238,11 @@
238238
431EFE7C233EC413002FCC18 /* Tests */ = {
239239
isa = PBXGroup;
240240
children = (
241+
430102E4235E660F00836D50 /* iOSWrapper.mm */,
241242
431EFED0233ECB0F002FCC18 /* libUnitTests.a */,
242243
431EFEC6233EC6DE002FCC18 /* libgtest.a */,
243244
431EFEBD233EC5C9002FCC18 /* libmat.a */,
244245
431EFE93233EC560002FCC18 /* libgmock.a */,
245-
431EFE7D233EC413002FCC18 /* Tests.mm */,
246246
431EFE7F233EC413002FCC18 /* Info.plist */,
247247
);
248248
path = Tests;
@@ -394,6 +394,7 @@
394394
431EFE95233EC590002FCC18 /* BackoffTests_ExponentialWithJitter.cpp in Sources */,
395395
431EFEBA233EC590002FCC18 /* UtilsTests.cpp in Sources */,
396396
431EFEB2233EC590002FCC18 /* OfflineStorageTests_SQLite.cpp in Sources */,
397+
430102E5235E660F00836D50 /* iOSWrapper.mm in Sources */,
397398
431EFE99233EC590002FCC18 /* ContextFieldsProviderTests.cpp in Sources */,
398399
431EFEAE233EC590002FCC18 /* LogSessionDataTests.cpp in Sources */,
399400
431EFE9A233EC590002FCC18 /* ControlPlaneProviderTests.cpp in Sources */,
@@ -404,7 +405,6 @@
404405
431EFEAD233EC590002FCC18 /* LogManagerImplTests.cpp in Sources */,
405406
431EFEB9233EC590002FCC18 /* TransmissionPolicyManagerTests.cpp in Sources */,
406407
431EFEA1233EC590002FCC18 /* EventPropertiesStorageTests.cpp in Sources */,
407-
431EFE7E233EC413002FCC18 /* Tests.mm in Sources */,
408408
431EFE9F233EC590002FCC18 /* DiskLocalStorageTests.cpp in Sources */,
409409
431EFEA7233EC590002FCC18 /* HttpDeflateCompressionTests.cpp in Sources */,
410410
431EFEB3233EC590002FCC18 /* OfflineStorageTests.cpp in Sources */,

0 commit comments

Comments
 (0)