Skip to content

Commit e3ba814

Browse files
author
Ferran Pujol Camins
committed
Add basic performance test
The performance tests run in an optimized build
1 parent 4f70b9a commit e3ba814

File tree

4 files changed

+414
-0
lines changed

4 files changed

+414
-0
lines changed

Package.swift

+3
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,8 @@ let package = Package(
1717
.testTarget(
1818
name: "SwiftGraphTests",
1919
dependencies: ["SwiftGraph"]),
20+
.testTarget(
21+
name: "SwiftGraphPerformanceTests",
22+
dependencies: ["SwiftGraph"]),
2023
]
2124
)

SwiftGraph.xcodeproj/project.pbxproj

+264
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
B54FDA712172A34D00057C51 /* ConstructorsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B54FDA702172A34D00057C51 /* ConstructorsTests.swift */; };
4343
B5D229BC207BF30100151820 /* UniqueElementsGraph.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D229BB207BF30100151820 /* UniqueElementsGraph.swift */; };
4444
B5D229BF207BF3A800151820 /* UniqueElementsGraphTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D229BD207BF36900151820 /* UniqueElementsGraphTests.swift */; };
45+
B5EACB1D2172315E00E527BD /* SwiftGraph.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7985B8FB1E5A4FB800C100E7 /* SwiftGraph.framework */; };
46+
B5EACB292172336900E527BD /* SearchPerformanceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5DD6DA42171EEE1007EFF44 /* SearchPerformanceTests.swift */; };
4547
/* End PBXBuildFile section */
4648

4749
/* Begin PBXContainerItemProxy section */
@@ -59,6 +61,13 @@
5961
remoteGlobalIDString = 7985B8FA1E5A4FB800C100E7;
6062
remoteInfo = SwiftGraphFramework;
6163
};
64+
B5EACB0C2172315E00E527BD /* PBXContainerItemProxy */ = {
65+
isa = PBXContainerItemProxy;
66+
containerPortal = 55E61FFA1A194C7F000A5F7B /* Project object */;
67+
proxyType = 1;
68+
remoteGlobalIDString = 7985B8FA1E5A4FB800C100E7;
69+
remoteInfo = SwiftGraphFramework;
70+
};
6271
/* End PBXContainerItemProxy section */
6372

6473
/* Begin PBXCopyFilesBuildPhase section */
@@ -114,6 +123,8 @@
114123
B54FDA702172A34D00057C51 /* ConstructorsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConstructorsTests.swift; sourceTree = "<group>"; };
115124
B5D229BB207BF30100151820 /* UniqueElementsGraph.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UniqueElementsGraph.swift; path = Sources/SwiftGraph/UniqueElementsGraph.swift; sourceTree = SOURCE_ROOT; };
116125
B5D229BD207BF36900151820 /* UniqueElementsGraphTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UniqueElementsGraphTests.swift; sourceTree = "<group>"; };
126+
B5DD6DA42171EEE1007EFF44 /* SearchPerformanceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchPerformanceTests.swift; sourceTree = "<group>"; };
127+
B5EACB222172315E00E527BD /* SwiftGraphPerformanceTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwiftGraphPerformanceTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
117128
/* End PBXFileReference section */
118129

119130
/* Begin PBXFrameworksBuildPhase section */
@@ -140,6 +151,14 @@
140151
);
141152
runOnlyForDeploymentPostprocessing = 0;
142153
};
154+
B5EACB1C2172315E00E527BD /* Frameworks */ = {
155+
isa = PBXFrameworksBuildPhase;
156+
buildActionMask = 2147483647;
157+
files = (
158+
B5EACB1D2172315E00E527BD /* SwiftGraph.framework in Frameworks */,
159+
);
160+
runOnlyForDeploymentPostprocessing = 0;
161+
};
143162
/* End PBXFrameworksBuildPhase section */
144163

145164
/* Begin PBXGroup section */
@@ -186,6 +205,7 @@
186205
children = (
187206
7985B8FC1E5A4FB800C100E7 /* SwiftGraph */,
188207
7985B9091E5A4FB900C100E7 /* SwiftGraphTests */,
208+
B5EACB09217230ED00E527BD /* SwiftGraphPerformanceTests */,
189209
55E620041A194C80000A5F7B /* SwiftGraphSampleApp */,
190210
55E620031A194C80000A5F7B /* Products */,
191211
);
@@ -197,6 +217,7 @@
197217
55E620021A194C80000A5F7B /* SwiftGraphSampleApp.app */,
198218
7985B8FB1E5A4FB800C100E7 /* SwiftGraph.framework */,
199219
7985B9031E5A4FB900C100E7 /* SwiftGraphTests.xctest */,
220+
B5EACB222172315E00E527BD /* SwiftGraphPerformanceTests.xctest */,
200221
);
201222
name = Products;
202223
sourceTree = "<group>";
@@ -279,6 +300,23 @@
279300
name = Operations;
280301
sourceTree = "<group>";
281302
};
303+
B5DD6DA62171EF7E007EFF44 /* TestUtils */ = {
304+
isa = PBXGroup;
305+
children = (
306+
B5DD6DA72171F0DA007EFF44 /* GraphGeneration.swift */,
307+
);
308+
path = TestUtils;
309+
sourceTree = "<group>";
310+
};
311+
B5EACB09217230ED00E527BD /* SwiftGraphPerformanceTests */ = {
312+
isa = PBXGroup;
313+
children = (
314+
B5DD6DA42171EEE1007EFF44 /* SearchPerformanceTests.swift */,
315+
);
316+
name = SwiftGraphPerformanceTests;
317+
path = Tests/SwiftGraphPerformanceTests;
318+
sourceTree = "<group>";
319+
};
282320
/* End PBXGroup section */
283321

284322
/* Begin PBXHeadersBuildPhase section */
@@ -348,6 +386,24 @@
348386
productReference = 7985B9031E5A4FB900C100E7 /* SwiftGraphTests.xctest */;
349387
productType = "com.apple.product-type.bundle.unit-test";
350388
};
389+
B5EACB0A2172315E00E527BD /* SwiftGraphPerformanceTests */ = {
390+
isa = PBXNativeTarget;
391+
buildConfigurationList = B5EACB1F2172315E00E527BD /* Build configuration list for PBXNativeTarget "SwiftGraphPerformanceTests" */;
392+
buildPhases = (
393+
B5EACB0D2172315E00E527BD /* Sources */,
394+
B5EACB1C2172315E00E527BD /* Frameworks */,
395+
B5EACB1E2172315E00E527BD /* Resources */,
396+
);
397+
buildRules = (
398+
);
399+
dependencies = (
400+
B5EACB0B2172315E00E527BD /* PBXTargetDependency */,
401+
);
402+
name = SwiftGraphPerformanceTests;
403+
productName = SwiftGraphFrameworkTests;
404+
productReference = B5EACB222172315E00E527BD /* SwiftGraphPerformanceTests.xctest */;
405+
productType = "com.apple.product-type.bundle.unit-test";
406+
};
351407
/* End PBXNativeTarget section */
352408

353409
/* Begin PBXProject section */
@@ -390,6 +446,7 @@
390446
targets = (
391447
7985B8FA1E5A4FB800C100E7 /* SwiftGraph */,
392448
7985B9021E5A4FB900C100E7 /* SwiftGraphTests */,
449+
B5EACB0A2172315E00E527BD /* SwiftGraphPerformanceTests */,
393450
55E620011A194C80000A5F7B /* SwiftGraphSampleApp */,
394451
);
395452
};
@@ -419,6 +476,13 @@
419476
);
420477
runOnlyForDeploymentPostprocessing = 0;
421478
};
479+
B5EACB1E2172315E00E527BD /* Resources */ = {
480+
isa = PBXResourcesBuildPhase;
481+
buildActionMask = 2147483647;
482+
files = (
483+
);
484+
runOnlyForDeploymentPostprocessing = 0;
485+
};
422486
/* End PBXResourcesBuildPhase section */
423487

424488
/* Begin PBXSourcesBuildPhase section */
@@ -472,6 +536,16 @@
472536
);
473537
runOnlyForDeploymentPostprocessing = 0;
474538
};
539+
B5EACB0D2172315E00E527BD /* Sources */ = {
540+
isa = PBXSourcesBuildPhase;
541+
buildActionMask = 2147483647;
542+
files = (
543+
B5EACB2B217233E300E527BD /* DFS.swift in Sources */,
544+
B5EACB2A217233DB00E527BD /* GraphGeneration.swift in Sources */,
545+
B5EACB292172336900E527BD /* SearchPerformanceTests.swift in Sources */,
546+
);
547+
runOnlyForDeploymentPostprocessing = 0;
548+
};
475549
/* End PBXSourcesBuildPhase section */
476550

477551
/* Begin PBXTargetDependency section */
@@ -485,6 +559,11 @@
485559
target = 7985B8FA1E5A4FB800C100E7 /* SwiftGraph */;
486560
targetProxy = 7985B90E1E5A4FB900C100E7 /* PBXContainerItemProxy */;
487561
};
562+
B5EACB0B2172315E00E527BD /* PBXTargetDependency */ = {
563+
isa = PBXTargetDependency;
564+
target = 7985B8FA1E5A4FB800C100E7 /* SwiftGraph */;
565+
targetProxy = B5EACB0C2172315E00E527BD /* PBXContainerItemProxy */;
566+
};
488567
/* End PBXTargetDependency section */
489568

490569
/* Begin PBXVariantGroup section */
@@ -730,13 +809,185 @@
730809
};
731810
name = Release;
732811
};
812+
B5EACB202172315E00E527BD /* Debug */ = {
813+
isa = XCBuildConfiguration;
814+
buildSettings = {
815+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
816+
CLANG_ANALYZER_NONNULL = YES;
817+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
818+
COMBINE_HIDPI_IMAGES = YES;
819+
DEBUG_INFORMATION_FORMAT = dwarf;
820+
INFOPLIST_FILE = Tests/Info.plist;
821+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks @executable_path/../Frameworks @loader_path/../Frameworks";
822+
PRODUCT_BUNDLE_IDENTIFIER = com.oaksnow.SwiftGraphFrameworkTests;
823+
PRODUCT_NAME = "$(TARGET_NAME)";
824+
SUPPORTED_PLATFORMS = "macosx watchsimulator watchos appletvsimulator appletvos iphonesimulator iphoneos";
825+
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
826+
SWIFT_VERSION = 4.2;
827+
};
828+
name = Debug;
829+
};
830+
B5EACB212172315E00E527BD /* Release */ = {
831+
isa = XCBuildConfiguration;
832+
buildSettings = {
833+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
834+
CLANG_ANALYZER_NONNULL = YES;
835+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
836+
COMBINE_HIDPI_IMAGES = YES;
837+
COPY_PHASE_STRIP = NO;
838+
INFOPLIST_FILE = Tests/Info.plist;
839+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks @executable_path/../Frameworks @loader_path/../Frameworks";
840+
PRODUCT_BUNDLE_IDENTIFIER = com.oaksnow.SwiftGraphFrameworkTests;
841+
PRODUCT_NAME = "$(TARGET_NAME)";
842+
SUPPORTED_PLATFORMS = "macosx watchsimulator watchos appletvsimulator appletvos iphonesimulator iphoneos";
843+
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
844+
SWIFT_VERSION = 4.2;
845+
};
846+
name = Release;
847+
};
848+
B5EACB242172316D00E527BD /* Performance Tests */ = {
849+
isa = XCBuildConfiguration;
850+
buildSettings = {
851+
ALWAYS_SEARCH_USER_PATHS = NO;
852+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
853+
CLANG_CXX_LIBRARY = "libc++";
854+
CLANG_ENABLE_CODE_COVERAGE = YES;
855+
CLANG_ENABLE_MODULES = YES;
856+
CLANG_ENABLE_OBJC_ARC = YES;
857+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
858+
CLANG_WARN_BOOL_CONVERSION = YES;
859+
CLANG_WARN_COMMA = YES;
860+
CLANG_WARN_CONSTANT_CONVERSION = YES;
861+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
862+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
863+
CLANG_WARN_EMPTY_BODY = YES;
864+
CLANG_WARN_ENUM_CONVERSION = YES;
865+
CLANG_WARN_INFINITE_RECURSION = YES;
866+
CLANG_WARN_INT_CONVERSION = YES;
867+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
868+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
869+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
870+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
871+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
872+
CLANG_WARN_STRICT_PROTOTYPES = YES;
873+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
874+
CLANG_WARN_UNREACHABLE_CODE = YES;
875+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
876+
COPY_PHASE_STRIP = NO;
877+
ENABLE_NS_ASSERTIONS = NO;
878+
ENABLE_STRICT_OBJC_MSGSEND = YES;
879+
ENABLE_TESTABILITY = YES;
880+
GCC_C_LANGUAGE_STANDARD = gnu99;
881+
GCC_DYNAMIC_NO_PIC = NO;
882+
GCC_NO_COMMON_BLOCKS = YES;
883+
GCC_OPTIMIZATION_LEVEL = s;
884+
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
885+
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
886+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
887+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
888+
GCC_WARN_UNDECLARED_SELECTOR = YES;
889+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
890+
GCC_WARN_UNUSED_FUNCTION = YES;
891+
GCC_WARN_UNUSED_VARIABLE = YES;
892+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
893+
MACOSX_DEPLOYMENT_TARGET = 10.10;
894+
MTL_ENABLE_DEBUG_INFO = NO;
895+
ONLY_ACTIVE_ARCH = YES;
896+
SWIFT_OPTIMIZATION_LEVEL = "-O";
897+
SWIFT_VERSION = 4.0;
898+
TVOS_DEPLOYMENT_TARGET = 9.0;
899+
WATCHOS_DEPLOYMENT_TARGET = 2.0;
900+
};
901+
name = "Performance Tests";
902+
};
903+
B5EACB252172316D00E527BD /* Performance Tests */ = {
904+
isa = XCBuildConfiguration;
905+
buildSettings = {
906+
APPLICATION_EXTENSION_API_ONLY = YES;
907+
CLANG_ANALYZER_NONNULL = YES;
908+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
909+
COMBINE_HIDPI_IMAGES = YES;
910+
CURRENT_PROJECT_VERSION = 1;
911+
DEBUG_INFORMATION_FORMAT = dwarf;
912+
DEFINES_MODULE = YES;
913+
DYLIB_COMPATIBILITY_VERSION = 1;
914+
DYLIB_CURRENT_VERSION = 1;
915+
DYLIB_INSTALL_NAME_BASE = "@rpath";
916+
FRAMEWORK_VERSION = A;
917+
INFOPLIST_FILE = SwiftGraph/Info.plist;
918+
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
919+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks @executable_path/../Frameworks @loader_path/../Frameworks";
920+
PRODUCT_BUNDLE_IDENTIFIER = com.oaksnow.SwiftGraphFramework;
921+
PRODUCT_NAME = "$(TARGET_NAME)";
922+
SKIP_INSTALL = YES;
923+
SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator";
924+
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
925+
SWIFT_VERSION = 4.2;
926+
VERSIONING_SYSTEM = "apple-generic";
927+
VERSION_INFO_PREFIX = "";
928+
};
929+
name = "Performance Tests";
930+
};
931+
B5EACB262172316D00E527BD /* Performance Tests */ = {
932+
isa = XCBuildConfiguration;
933+
buildSettings = {
934+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
935+
CLANG_ANALYZER_NONNULL = YES;
936+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
937+
COMBINE_HIDPI_IMAGES = YES;
938+
DEBUG_INFORMATION_FORMAT = dwarf;
939+
INFOPLIST_FILE = Tests/Info.plist;
940+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks @executable_path/../Frameworks @loader_path/../Frameworks";
941+
PRODUCT_BUNDLE_IDENTIFIER = com.oaksnow.SwiftGraphFrameworkTests;
942+
PRODUCT_NAME = "$(TARGET_NAME)";
943+
SUPPORTED_PLATFORMS = "macosx watchsimulator watchos appletvsimulator appletvos iphonesimulator iphoneos";
944+
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
945+
SWIFT_VERSION = 4.2;
946+
};
947+
name = "Performance Tests";
948+
};
949+
B5EACB272172316D00E527BD /* Performance Tests */ = {
950+
isa = XCBuildConfiguration;
951+
buildSettings = {
952+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
953+
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
954+
COMBINE_HIDPI_IMAGES = YES;
955+
INFOPLIST_FILE = SwiftGraphSampleApp/Info.plist;
956+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
957+
MACOSX_DEPLOYMENT_TARGET = 10.10;
958+
PRODUCT_BUNDLE_IDENTIFIER = "com.oaksnow.$(PRODUCT_NAME:rfc1034identifier)";
959+
PRODUCT_NAME = "$(TARGET_NAME)";
960+
SDKROOT = macosx;
961+
SWIFT_VERSION = 4.2;
962+
};
963+
name = "Performance Tests";
964+
};
965+
B5EACB282172316D00E527BD /* Performance Tests */ = {
966+
isa = XCBuildConfiguration;
967+
buildSettings = {
968+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
969+
CLANG_ANALYZER_NONNULL = YES;
970+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
971+
COMBINE_HIDPI_IMAGES = YES;
972+
DEBUG_INFORMATION_FORMAT = dwarf;
973+
INFOPLIST_FILE = Tests/Info.plist;
974+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks @executable_path/../Frameworks @loader_path/../Frameworks";
975+
PRODUCT_BUNDLE_IDENTIFIER = com.oaksnow.SwiftGraphFrameworkTests;
976+
PRODUCT_NAME = "$(TARGET_NAME)";
977+
SUPPORTED_PLATFORMS = "macosx watchsimulator watchos appletvsimulator appletvos iphonesimulator iphoneos";
978+
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
979+
SWIFT_VERSION = 4.2;
980+
};
981+
name = "Performance Tests";
982+
};
733983
/* End XCBuildConfiguration section */
734984

735985
/* Begin XCConfigurationList section */
736986
55E61FFD1A194C7F000A5F7B /* Build configuration list for PBXProject "SwiftGraph" */ = {
737987
isa = XCConfigurationList;
738988
buildConfigurations = (
739989
55E6201A1A194C80000A5F7B /* Debug */,
990+
B5EACB242172316D00E527BD /* Performance Tests */,
740991
55E6201B1A194C80000A5F7B /* Release */,
741992
);
742993
defaultConfigurationIsVisible = 0;
@@ -746,6 +997,7 @@
746997
isa = XCConfigurationList;
747998
buildConfigurations = (
748999
55E6201D1A194C80000A5F7B /* Debug */,
1000+
B5EACB272172316D00E527BD /* Performance Tests */,
7491001
55E6201E1A194C80000A5F7B /* Release */,
7501002
);
7511003
defaultConfigurationIsVisible = 0;
@@ -755,6 +1007,7 @@
7551007
isa = XCConfigurationList;
7561008
buildConfigurations = (
7571009
7985B9121E5A4FB900C100E7 /* Debug */,
1010+
B5EACB252172316D00E527BD /* Performance Tests */,
7581011
7985B9131E5A4FB900C100E7 /* Release */,
7591012
);
7601013
defaultConfigurationIsVisible = 0;
@@ -764,11 +1017,22 @@
7641017
isa = XCConfigurationList;
7651018
buildConfigurations = (
7661019
7985B9141E5A4FB900C100E7 /* Debug */,
1020+
B5EACB262172316D00E527BD /* Performance Tests */,
7671021
7985B9151E5A4FB900C100E7 /* Release */,
7681022
);
7691023
defaultConfigurationIsVisible = 0;
7701024
defaultConfigurationName = Release;
7711025
};
1026+
B5EACB1F2172315E00E527BD /* Build configuration list for PBXNativeTarget "SwiftGraphPerformanceTests" */ = {
1027+
isa = XCConfigurationList;
1028+
buildConfigurations = (
1029+
B5EACB202172315E00E527BD /* Debug */,
1030+
B5EACB282172316D00E527BD /* Performance Tests */,
1031+
B5EACB212172315E00E527BD /* Release */,
1032+
);
1033+
defaultConfigurationIsVisible = 0;
1034+
defaultConfigurationName = Release;
1035+
};
7721036
/* End XCConfigurationList section */
7731037
};
7741038
rootObject = 55E61FFA1A194C7F000A5F7B /* Project object */;

0 commit comments

Comments
 (0)