Cleaning up gtest.xcode. Removing old tests, using gtest-all.cc, adding a static libgtest.a and a static libgtest_main.a, fixing the sample code to work with changes.
This commit is contained in:
		@@ -21,7 +21,7 @@ Mika Raento <mikie@iki.fi>
 | 
				
			|||||||
Patrick Hanna <phanna@google.com>
 | 
					Patrick Hanna <phanna@google.com>
 | 
				
			||||||
Patrick Riley <pfr@google.com>
 | 
					Patrick Riley <pfr@google.com>
 | 
				
			||||||
Peter Kaminski <piotrk@google.com>
 | 
					Peter Kaminski <piotrk@google.com>
 | 
				
			||||||
Preston Jackson <preston.jackson@gmail.com>
 | 
					Preston Jackson <preston.a.jackson@gmail.com>
 | 
				
			||||||
Rainer Klaffenboeck <rainer.klaffenboeck@dynatrace.com>
 | 
					Rainer Klaffenboeck <rainer.klaffenboeck@dynatrace.com>
 | 
				
			||||||
Russ Cox <rsc@google.com>
 | 
					Russ Cox <rsc@google.com>
 | 
				
			||||||
Russ Rufer <russ@pentad.com>
 | 
					Russ Rufer <russ@pentad.com>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,8 +0,0 @@
 | 
				
			|||||||
//
 | 
					 | 
				
			||||||
//  InternalPythonTestTarget.xcconfig
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//  These are Test target settings for the gtest framework and examples. It
 | 
					 | 
				
			||||||
//  is set in the "Based On:" dropdown in the "Target" info dialog.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
PRODUCT_NAME = $(TARGET_NAME)_
 | 
					 | 
				
			||||||
HEADER_SEARCH_PATHS = ../ ../include
 | 
					 | 
				
			||||||
@@ -1,8 +0,0 @@
 | 
				
			|||||||
//
 | 
					 | 
				
			||||||
//  InternalTestTarget.xcconfig
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//  These are Test target settings for the gtest framework and examples. It
 | 
					 | 
				
			||||||
//  is set in the "Based On:" dropdown in the "Target" info dialog.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
PRODUCT_NAME = $(TARGET_NAME)
 | 
					 | 
				
			||||||
HEADER_SEARCH_PATHS = ../ ../include
 | 
					 | 
				
			||||||
							
								
								
									
										15
									
								
								xcode/Config/StaticLibraryTarget.xcconfig
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								xcode/Config/StaticLibraryTarget.xcconfig
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
				
			|||||||
 | 
					//
 | 
				
			||||||
 | 
					//  StaticLibraryTarget.xcconfig
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					//  These are static library target settings for libgtest.a. It
 | 
				
			||||||
 | 
					//  is set in the "Based On:" dropdown in the "Target" info dialog.
 | 
				
			||||||
 | 
					//  This file is based on the Xcode Configuration files in:
 | 
				
			||||||
 | 
					//  http://code.google.com/p/google-toolbox-for-mac/
 | 
				
			||||||
 | 
					// 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Static libs can be included in bundles so make them position independent
 | 
				
			||||||
 | 
					GCC_DYNAMIC_NO_PIC = NO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Static libs should not have their internal globals or external symbols
 | 
				
			||||||
 | 
					// stripped.
 | 
				
			||||||
 | 
					STRIP_STYLE = debugging
 | 
				
			||||||
@@ -12,6 +12,9 @@
 | 
				
			|||||||
		3B7EB1280E5AEE4600C7F239 /* widget_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3B7EB1270E5AEE4600C7F239 /* widget_test.cc */; };
 | 
							3B7EB1280E5AEE4600C7F239 /* widget_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3B7EB1270E5AEE4600C7F239 /* widget_test.cc */; };
 | 
				
			||||||
		3B7EB1480E5AF3B400C7F239 /* Widget.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D07F2C80486CC7A007CD1D0 /* Widget.framework */; };
 | 
							3B7EB1480E5AF3B400C7F239 /* Widget.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D07F2C80486CC7A007CD1D0 /* Widget.framework */; };
 | 
				
			||||||
		3B7F0C8D0E567CC5009CA236 /* gtest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BA867DC0E561B7C00326077 /* gtest.framework */; };
 | 
							3B7F0C8D0E567CC5009CA236 /* gtest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BA867DC0E561B7C00326077 /* gtest.framework */; };
 | 
				
			||||||
 | 
							40C849E8101A426E0083642A /* libgtest_main.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 40C849E7101A426E0083642A /* libgtest_main.a */; };
 | 
				
			||||||
 | 
							40C849EF101A42C80083642A /* gtest.framework in Copy Test Framework */ = {isa = PBXBuildFile; fileRef = 3BA867DC0E561B7C00326077 /* gtest.framework */; };
 | 
				
			||||||
 | 
							40C849F2101A42CC0083642A /* libgtest_main.a in Copy Test Framework */ = {isa = PBXBuildFile; fileRef = 40C849E7101A426E0083642A /* libgtest_main.a */; };
 | 
				
			||||||
/* End PBXBuildFile section */
 | 
					/* End PBXBuildFile section */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Begin PBXContainerItemProxy section */
 | 
					/* Begin PBXContainerItemProxy section */
 | 
				
			||||||
@@ -24,12 +27,28 @@
 | 
				
			|||||||
		};
 | 
							};
 | 
				
			||||||
/* End PBXContainerItemProxy section */
 | 
					/* End PBXContainerItemProxy section */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* Begin PBXCopyFilesBuildPhase section */
 | 
				
			||||||
 | 
							40C849F5101A42EA0083642A /* Copy Test Framework */ = {
 | 
				
			||||||
 | 
								isa = PBXCopyFilesBuildPhase;
 | 
				
			||||||
 | 
								buildActionMask = 2147483647;
 | 
				
			||||||
 | 
								dstPath = "";
 | 
				
			||||||
 | 
								dstSubfolderSpec = 16;
 | 
				
			||||||
 | 
								files = (
 | 
				
			||||||
 | 
									40C849F2101A42CC0083642A /* libgtest_main.a in Copy Test Framework */,
 | 
				
			||||||
 | 
									40C849EF101A42C80083642A /* gtest.framework in Copy Test Framework */,
 | 
				
			||||||
 | 
								);
 | 
				
			||||||
 | 
								name = "Copy Test Framework";
 | 
				
			||||||
 | 
								runOnlyForDeploymentPostprocessing = 0;
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
					/* End PBXCopyFilesBuildPhase section */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Begin PBXFileReference section */
 | 
					/* Begin PBXFileReference section */
 | 
				
			||||||
		3B07BDEA0E3F3F9E00647869 /* WidgetFrameworkTest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = WidgetFrameworkTest; sourceTree = BUILT_PRODUCTS_DIR; };
 | 
							3B07BDEA0E3F3F9E00647869 /* WidgetFrameworkTest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = WidgetFrameworkTest; sourceTree = BUILT_PRODUCTS_DIR; };
 | 
				
			||||||
		3B7EB1230E5AEE3500C7F239 /* widget.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = widget.cc; sourceTree = "<group>"; };
 | 
							3B7EB1230E5AEE3500C7F239 /* widget.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = widget.cc; sourceTree = "<group>"; };
 | 
				
			||||||
		3B7EB1240E5AEE3500C7F239 /* widget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = widget.h; sourceTree = "<group>"; };
 | 
							3B7EB1240E5AEE3500C7F239 /* widget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = widget.h; sourceTree = "<group>"; };
 | 
				
			||||||
		3B7EB1270E5AEE4600C7F239 /* widget_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = widget_test.cc; sourceTree = "<group>"; };
 | 
							3B7EB1270E5AEE4600C7F239 /* widget_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = widget_test.cc; sourceTree = "<group>"; };
 | 
				
			||||||
		3BA867DC0E561B7C00326077 /* gtest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = gtest.framework; path = ../../build/Debug/gtest.framework; sourceTree = "<group>"; };
 | 
							3BA867DC0E561B7C00326077 /* gtest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = gtest.framework; path = ../../build/Debug/gtest.framework; sourceTree = "<group>"; };
 | 
				
			||||||
 | 
							40C849E7101A426E0083642A /* libgtest_main.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libgtest_main.a; path = ../../build/Debug/gtest.framework/Versions/A/Resources/libgtest_main.a; sourceTree = SOURCE_ROOT; };
 | 
				
			||||||
		8D07F2C70486CC7A007CD1D0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
 | 
							8D07F2C70486CC7A007CD1D0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
 | 
				
			||||||
		8D07F2C80486CC7A007CD1D0 /* Widget.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Widget.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 | 
							8D07F2C80486CC7A007CD1D0 /* Widget.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Widget.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 | 
				
			||||||
/* End PBXFileReference section */
 | 
					/* End PBXFileReference section */
 | 
				
			||||||
@@ -41,6 +60,7 @@
 | 
				
			|||||||
			files = (
 | 
								files = (
 | 
				
			||||||
				3B7EB1480E5AF3B400C7F239 /* Widget.framework in Frameworks */,
 | 
									3B7EB1480E5AF3B400C7F239 /* Widget.framework in Frameworks */,
 | 
				
			||||||
				3B7F0C8D0E567CC5009CA236 /* gtest.framework in Frameworks */,
 | 
									3B7F0C8D0E567CC5009CA236 /* gtest.framework in Frameworks */,
 | 
				
			||||||
 | 
									40C849E8101A426E0083642A /* libgtest_main.a in Frameworks */,
 | 
				
			||||||
			);
 | 
								);
 | 
				
			||||||
			runOnlyForDeploymentPostprocessing = 0;
 | 
								runOnlyForDeploymentPostprocessing = 0;
 | 
				
			||||||
		};
 | 
							};
 | 
				
			||||||
@@ -79,6 +99,7 @@
 | 
				
			|||||||
			isa = PBXGroup;
 | 
								isa = PBXGroup;
 | 
				
			||||||
			children = (
 | 
								children = (
 | 
				
			||||||
				3BA867DC0E561B7C00326077 /* gtest.framework */,
 | 
									3BA867DC0E561B7C00326077 /* gtest.framework */,
 | 
				
			||||||
 | 
									40C849E7101A426E0083642A /* libgtest_main.a */,
 | 
				
			||||||
			);
 | 
								);
 | 
				
			||||||
			name = "External Frameworks and Libraries";
 | 
								name = "External Frameworks and Libraries";
 | 
				
			||||||
			sourceTree = "<group>";
 | 
								sourceTree = "<group>";
 | 
				
			||||||
@@ -128,6 +149,7 @@
 | 
				
			|||||||
			buildPhases = (
 | 
								buildPhases = (
 | 
				
			||||||
				3B07BDE70E3F3F9E00647869 /* Sources */,
 | 
									3B07BDE70E3F3F9E00647869 /* Sources */,
 | 
				
			||||||
				3B07BDE80E3F3F9E00647869 /* Frameworks */,
 | 
									3B07BDE80E3F3F9E00647869 /* Frameworks */,
 | 
				
			||||||
 | 
									40C849F5101A42EA0083642A /* Copy Test Framework */,
 | 
				
			||||||
			);
 | 
								);
 | 
				
			||||||
			buildRules = (
 | 
								buildRules = (
 | 
				
			||||||
			);
 | 
								);
 | 
				
			||||||
@@ -235,6 +257,10 @@
 | 
				
			|||||||
					"\"$(SRCROOT)/../../build/Debug\"",
 | 
										"\"$(SRCROOT)/../../build/Debug\"",
 | 
				
			||||||
				);
 | 
									);
 | 
				
			||||||
				INSTALL_PATH = /usr/local/bin;
 | 
									INSTALL_PATH = /usr/local/bin;
 | 
				
			||||||
 | 
									LIBRARY_SEARCH_PATHS = (
 | 
				
			||||||
 | 
										"$(inherited)",
 | 
				
			||||||
 | 
										"\"$(SRCROOT)/../../build/Debug/gtest.framework/Versions/A/Resources\"",
 | 
				
			||||||
 | 
									);
 | 
				
			||||||
				PRODUCT_NAME = WidgetFrameworkTest;
 | 
									PRODUCT_NAME = WidgetFrameworkTest;
 | 
				
			||||||
			};
 | 
								};
 | 
				
			||||||
			name = Debug;
 | 
								name = Debug;
 | 
				
			||||||
@@ -248,6 +274,10 @@
 | 
				
			|||||||
					"\"$(SRCROOT)/../../build/Debug\"",
 | 
										"\"$(SRCROOT)/../../build/Debug\"",
 | 
				
			||||||
				);
 | 
									);
 | 
				
			||||||
				INSTALL_PATH = /usr/local/bin;
 | 
									INSTALL_PATH = /usr/local/bin;
 | 
				
			||||||
 | 
									LIBRARY_SEARCH_PATHS = (
 | 
				
			||||||
 | 
										"$(inherited)",
 | 
				
			||||||
 | 
										"\"$(SRCROOT)/../../build/Debug/gtest.framework/Versions/A/Resources\"",
 | 
				
			||||||
 | 
									);
 | 
				
			||||||
				PRODUCT_NAME = WidgetFrameworkTest;
 | 
									PRODUCT_NAME = WidgetFrameworkTest;
 | 
				
			||||||
			};
 | 
								};
 | 
				
			||||||
			name = Release;
 | 
								name = Release;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,49 +1,16 @@
 | 
				
			|||||||
#!/bin/bash
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Executes the samples and tests for the Google Test Framework
 | 
					# Executes the samples and tests for the Google Test Framework.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Help the dynamic linker find the path to the framework 
 | 
					# Help the dynamic linker find the path to the libraries.
 | 
				
			||||||
export DYLD_FRAMEWORK_PATH=$BUILT_PRODUCTS_DIR
 | 
					export DYLD_FRAMEWORK_PATH=$BUILT_PRODUCTS_DIR
 | 
				
			||||||
 | 
					export DYLD_LIBRARY_PATH=$BUILT_PRODUCTS_DIR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Create an array of test executables
 | 
					# Create some executables.
 | 
				
			||||||
test_executables=("$BUILT_PRODUCTS_DIR/sample1_unittest"
 | 
					test_executables=("$BUILT_PRODUCTS_DIR/gtest_unittest-framework"
 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/sample2_unittest"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/sample3_unittest"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/sample4_unittest"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/sample5_unittest"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/sample6_unittest"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/sample7_unittest"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/sample8_unittest"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest-death-test_test"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest_environment_test"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest-filepath_test"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest-linked_ptr_test"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest_main_unittest"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest-message_test"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest_no_test_unittest"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest-options_test"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest-param-test_test"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest-port_test"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest_pred_impl_unittest"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest_prod_test"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest_repeat_test"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest_sole_header_test"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest_stress_test"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest_test_part_test"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest-typed-test_test"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest_unittest"
 | 
					                  "$BUILT_PRODUCTS_DIR/gtest_unittest"
 | 
				
			||||||
 | 
					                  "$BUILT_PRODUCTS_DIR/sample1_unittest-framework"
 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest_break_on_failure_unittest.py"
 | 
					                  "$BUILT_PRODUCTS_DIR/sample1_unittest-static")
 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest_color_test.py"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest_env_var_test.py"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest_filter_unittest.py"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest_list_tests_unittest.py"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest_output_test.py"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest_xml_outfiles_test.py"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest_xml_output_unittest.py"
 | 
					 | 
				
			||||||
                  "$BUILT_PRODUCTS_DIR/gtest_uninitialized_test.py"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Now execute each one in turn keeping track of how many succeeded and failed. 
 | 
					# Now execute each one in turn keeping track of how many succeeded and failed. 
 | 
				
			||||||
succeeded=0
 | 
					succeeded=0
 | 
				
			||||||
@@ -60,7 +27,7 @@ for test in ${test_executables[*]}; do
 | 
				
			|||||||
  fi
 | 
					  fi
 | 
				
			||||||
done
 | 
					done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Report the successes and failures to the console
 | 
					# Report the successes and failures to the console.
 | 
				
			||||||
echo "Tests complete with $succeeded successes and $failed failures."
 | 
					echo "Tests complete with $succeeded successes and $failed failures."
 | 
				
			||||||
if [ $failed -ne 0 ]; then
 | 
					if [ $failed -ne 0 ]; then
 | 
				
			||||||
  echo "The following tests failed:"
 | 
					  echo "The following tests failed:"
 | 
				
			||||||
 
 | 
				
			|||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Reference in New Issue
	
	Block a user