Browse Source

Start creating tests for graphics code.

Sam Jaffe 6 years ago
parent
commit
868338e44b

+ 22 - 0
graphics/graphics-test/Info.plist

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>$(DEVELOPMENT_LANGUAGE)</string>
+	<key>CFBundleExecutable</key>
+	<string>$(EXECUTABLE_NAME)</string>
+	<key>CFBundleIdentifier</key>
+	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>$(PRODUCT_NAME)</string>
+	<key>CFBundlePackageType</key>
+	<string>BNDL</string>
+	<key>CFBundleShortVersionString</key>
+	<string>1.0</string>
+	<key>CFBundleVersion</key>
+	<string>1</string>
+</dict>
+</plist>

+ 130 - 0
graphics/graphics.xcodeproj/project.pbxproj

@@ -23,6 +23,7 @@
 		CD62FD222292C76B00376440 /* renderer_impl.hpp in Headers */ = {isa = PBXBuildFile; fileRef = CD62FD202292C76B00376440 /* renderer_impl.hpp */; };
 		CD62FD232292C76B00376440 /* renderer_impl.cxx in Sources */ = {isa = PBXBuildFile; fileRef = CD62FD212292C76B00376440 /* renderer_impl.cxx */; };
 		CDA34D9A22517A3D008036A7 /* libmath.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = CDA34D9922517A3D008036A7 /* libmath.dylib */; };
+		CDED9C1922A2D6CE00AE5CE5 /* libgraphics.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = CD3AC6E21D2C0364002B4BB0 /* libgraphics.dylib */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
@@ -54,6 +55,13 @@
 			remoteGlobalIDString = 05818F901A685AEA0072A469;
 			remoteInfo = GoogleMockTests;
 		};
+		CDED9C1A22A2D6CE00AE5CE5 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = CD3AC6DA1D2C0364002B4BB0 /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = CD3AC6E11D2C0364002B4BB0;
+			remoteInfo = graphics;
+		};
 /* End PBXContainerItemProxy section */
 
 /* Begin PBXFileReference section */
@@ -77,6 +85,8 @@
 		CD62FD212292C76B00376440 /* renderer_impl.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = renderer_impl.cxx; sourceTree = "<group>"; };
 		CDA34D86225171AA008036A7 /* game */ = {isa = PBXFileReference; lastKnownFileType = folder; name = game; path = include/game; sourceTree = "<group>"; };
 		CDA34D9922517A3D008036A7 /* libmath.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; path = libmath.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
+		CDED9C1422A2D6CD00AE5CE5 /* graphics-test.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "graphics-test.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
+		CDED9C1822A2D6CE00AE5CE5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -90,6 +100,14 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
+		CDED9C1122A2D6CD00AE5CE5 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				CDED9C1922A2D6CE00AE5CE5 /* libgraphics.dylib in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
@@ -109,6 +127,7 @@
 				CD62FCD722904AD100376440 /* GoogleMock.xcodeproj */,
 				CDA34D86225171AA008036A7 /* game */,
 				CD3AC6E41D2C0364002B4BB0 /* src */,
+				CDED9C1522A2D6CE00AE5CE5 /* graphics-test */,
 				CD3AC6E31D2C0364002B4BB0 /* Products */,
 				CDA34D9822517A3D008036A7 /* Frameworks */,
 			);
@@ -118,6 +137,7 @@
 			isa = PBXGroup;
 			children = (
 				CD3AC6E21D2C0364002B4BB0 /* libgraphics.dylib */,
+				CDED9C1422A2D6CD00AE5CE5 /* graphics-test.xctest */,
 			);
 			name = Products;
 			sourceTree = "<group>";
@@ -178,6 +198,14 @@
 			name = Frameworks;
 			sourceTree = "<group>";
 		};
+		CDED9C1522A2D6CE00AE5CE5 /* graphics-test */ = {
+			isa = PBXGroup;
+			children = (
+				CDED9C1822A2D6CE00AE5CE5 /* Info.plist */,
+			);
+			path = "graphics-test";
+			sourceTree = "<group>";
+		};
 /* End PBXGroup section */
 
 /* Begin PBXHeadersBuildPhase section */
@@ -211,6 +239,24 @@
 			productReference = CD3AC6E21D2C0364002B4BB0 /* libgraphics.dylib */;
 			productType = "com.apple.product-type.library.dynamic";
 		};
+		CDED9C1322A2D6CD00AE5CE5 /* graphics-test */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = CDED9C2222A2D6CE00AE5CE5 /* Build configuration list for PBXNativeTarget "graphics-test" */;
+			buildPhases = (
+				CDED9C1022A2D6CD00AE5CE5 /* Sources */,
+				CDED9C1122A2D6CD00AE5CE5 /* Frameworks */,
+				CDED9C1222A2D6CD00AE5CE5 /* Resources */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+				CDED9C1B22A2D6CE00AE5CE5 /* PBXTargetDependency */,
+			);
+			name = "graphics-test";
+			productName = "graphics-test";
+			productReference = CDED9C1422A2D6CD00AE5CE5 /* graphics-test.xctest */;
+			productType = "com.apple.product-type.bundle.unit-test";
+		};
 /* End PBXNativeTarget section */
 
 /* Begin PBXProject section */
@@ -223,6 +269,10 @@
 					CD3AC6E11D2C0364002B4BB0 = {
 						CreatedOnToolsVersion = 7.2.1;
 					};
+					CDED9C1322A2D6CD00AE5CE5 = {
+						CreatedOnToolsVersion = 10.1;
+						ProvisioningStyle = Automatic;
+					};
 				};
 			};
 			buildConfigurationList = CD3AC6DD1D2C0364002B4BB0 /* Build configuration list for PBXProject "graphics" */;
@@ -244,6 +294,7 @@
 			projectRoot = "";
 			targets = (
 				CD3AC6E11D2C0364002B4BB0 /* graphics */,
+				CDED9C1322A2D6CD00AE5CE5 /* graphics-test */,
 			);
 		};
 /* End PBXProject section */
@@ -279,6 +330,16 @@
 		};
 /* End PBXReferenceProxy section */
 
+/* Begin PBXResourcesBuildPhase section */
+		CDED9C1222A2D6CD00AE5CE5 /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXResourcesBuildPhase section */
+
 /* Begin PBXShellScriptBuildPhase section */
 		CDA34DA222517B5E008036A7 /* ShellScript */ = {
 			isa = PBXShellScriptBuildPhase;
@@ -318,8 +379,23 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
+		CDED9C1022A2D6CD00AE5CE5 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 /* End PBXSourcesBuildPhase section */
 
+/* Begin PBXTargetDependency section */
+		CDED9C1B22A2D6CE00AE5CE5 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = CD3AC6E11D2C0364002B4BB0 /* graphics */;
+			targetProxy = CDED9C1A22A2D6CE00AE5CE5 /* PBXContainerItemProxy */;
+		};
+/* End PBXTargetDependency section */
+
 /* Begin XCBuildConfiguration section */
 		CD3AC6EB1D2C0364002B4BB0 /* Debug */ = {
 			isa = XCBuildConfiguration;
@@ -446,6 +522,51 @@
 			};
 			name = Release;
 		};
+		CDED9C1C22A2D6CE00AE5CE5 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				CLANG_ANALYZER_NONNULL = YES;
+				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+				CLANG_ENABLE_OBJC_WEAK = YES;
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+				CODE_SIGN_STYLE = Automatic;
+				COMBINE_HIDPI_IMAGES = YES;
+				GCC_C_LANGUAGE_STANDARD = gnu11;
+				INFOPLIST_FILE = "graphics-test/Info.plist";
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
+				MACOSX_DEPLOYMENT_TARGET = 10.13;
+				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+				MTL_FAST_MATH = YES;
+				PRODUCT_BUNDLE_IDENTIFIER = "leumasjaffe.graphics-test";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+			};
+			name = Debug;
+		};
+		CDED9C1D22A2D6CE00AE5CE5 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				CLANG_ANALYZER_NONNULL = YES;
+				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+				CLANG_ENABLE_OBJC_WEAK = YES;
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+				CODE_SIGN_STYLE = Automatic;
+				COMBINE_HIDPI_IMAGES = YES;
+				GCC_C_LANGUAGE_STANDARD = gnu11;
+				INFOPLIST_FILE = "graphics-test/Info.plist";
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
+				MACOSX_DEPLOYMENT_TARGET = 10.13;
+				MTL_FAST_MATH = YES;
+				PRODUCT_BUNDLE_IDENTIFIER = "leumasjaffe.graphics-test";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+			};
+			name = Release;
+		};
 /* End XCBuildConfiguration section */
 
 /* Begin XCConfigurationList section */
@@ -467,6 +588,15 @@
 			defaultConfigurationIsVisible = 0;
 			defaultConfigurationName = Release;
 		};
+		CDED9C2222A2D6CE00AE5CE5 /* Build configuration list for PBXNativeTarget "graphics-test" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				CDED9C1C22A2D6CE00AE5CE5 /* Debug */,
+				CDED9C1D22A2D6CE00AE5CE5 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
 /* End XCConfigurationList section */
 	};
 	rootObject = CD3AC6DA1D2C0364002B4BB0 /* Project object */;

+ 67 - 0
graphics/graphics.xcodeproj/xcshareddata/xcschemes/graphics-test.xcscheme

@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+   LastUpgradeVersion = "1010"
+   version = "1.3">
+   <BuildAction
+      parallelizeBuildables = "YES"
+      buildImplicitDependencies = "YES">
+   </BuildAction>
+   <TestAction
+      buildConfiguration = "Debug"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      codeCoverageEnabled = "YES"
+      onlyGenerateCoverageForSpecifiedTargets = "YES"
+      shouldUseLaunchSchemeArgsEnv = "YES">
+      <CodeCoverageTargets>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "CD3AC6E11D2C0364002B4BB0"
+            BuildableName = "libgraphics.dylib"
+            BlueprintName = "graphics"
+            ReferencedContainer = "container:graphics.xcodeproj">
+         </BuildableReference>
+      </CodeCoverageTargets>
+      <Testables>
+         <TestableReference
+            skipped = "NO">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "CDED9C1322A2D6CD00AE5CE5"
+               BuildableName = "graphics-test.xctest"
+               BlueprintName = "graphics-test"
+               ReferencedContainer = "container:graphics.xcodeproj">
+            </BuildableReference>
+         </TestableReference>
+      </Testables>
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </TestAction>
+   <LaunchAction
+      buildConfiguration = "Debug"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      launchStyle = "0"
+      useCustomWorkingDirectory = "NO"
+      ignoresPersistentStateOnLaunch = "NO"
+      debugDocumentVersioning = "YES"
+      debugServiceExtension = "internal"
+      allowLocationSimulation = "YES">
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </LaunchAction>
+   <ProfileAction
+      buildConfiguration = "Release"
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      savedToolIdentifier = ""
+      useCustomWorkingDirectory = "NO"
+      debugDocumentVersioning = "YES">
+   </ProfileAction>
+   <AnalyzeAction
+      buildConfiguration = "Debug">
+   </AnalyzeAction>
+   <ArchiveAction
+      buildConfiguration = "Release"
+      revealArchiveInOrganizer = "YES">
+   </ArchiveAction>
+</Scheme>