[macruby-changes] [2723] MacRuby/trunk/misc/xcode-templates/Project Templates/Application/ MacRuby Application

source_changes at macosforge.org source_changes at macosforge.org
Mon Oct 5 10:42:36 PDT 2009


Revision: 2723
          http://trac.macosforge.org/projects/ruby/changeset/2723
Author:   eloy.de.enige at gmail.com
Date:     2009-10-05 10:42:34 -0700 (Mon, 05 Oct 2009)
Log Message:
-----------
Added a basic test unit setup to the default project template.

* Embed MacRuby target is included by default to ease deployment for first time
  users.
* Tests directory has been added for tests.
* stub_test.rb has been added with a starting test::unit case.
* Unit Tests target has been added to run the tests.
* Tests/run_suite.rb has been added to load up all tests from the Tests
  directory.

Signed-off-by: Eloy Duran <eloy.de.enige at gmail.com>

Modified Paths:
--------------
    MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Application/MacRubyApp.xcodeproj/TemplateInfo.plist
    MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Application/MacRubyApp.xcodeproj/project.pbxproj

Added Paths:
-----------
    MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Application/Tests/
    MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Application/Tests/run_suite.rb
    MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Application/Tests/stub_test.rb

Modified: MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Application/MacRubyApp.xcodeproj/TemplateInfo.plist
===================================================================
--- MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Application/MacRubyApp.xcodeproj/TemplateInfo.plist	2009-10-05 08:14:35 UTC (rev 2722)
+++ MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Application/MacRubyApp.xcodeproj/TemplateInfo.plist	2009-10-05 17:42:34 UTC (rev 2723)
@@ -1,15 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
-        <key>Description</key>
-        <string>This project builds a Cocoa-based application written in Ruby, with MacRuby.</string>
-        <key>FilesToMacroExpand</key>
-        <array>
-                <string>English.lproj/InfoPlist.strings</string>
-                <string>main.m</string>
-                <string>rb_main.rb</string>
-                <string>Info.plist</string>
-        </array>
+	<key>Description</key>
+	<string>This project builds a Cocoa-based application written in Ruby, with MacRuby.</string>
+	<key>FilesToMacroExpand</key>
+	<array>
+		<string>Tests/run_suite.rb</string>
+		<string>English.lproj/InfoPlist.strings</string>
+		<string>main.m</string>
+		<string>rb_main.rb</string>
+		<string>Info.plist</string>
+	</array>
 </dict>
 </plist>

Modified: MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Application/MacRubyApp.xcodeproj/project.pbxproj
===================================================================
--- MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Application/MacRubyApp.xcodeproj/project.pbxproj	2009-10-05 08:14:35 UTC (rev 2722)
+++ MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Application/MacRubyApp.xcodeproj/project.pbxproj	2009-10-05 17:42:34 UTC (rev 2723)
@@ -6,6 +6,32 @@
 	objectVersion = 44;
 	objects = {
 
+/* Begin PBXAggregateTarget section */
+		172754BD107597F200D0347B /* Unit Tests */ = {
+			isa = PBXAggregateTarget;
+			buildConfigurationList = 172754C7107597F400D0347B /* Build configuration list for PBXAggregateTarget "Unit Tests" */;
+			buildPhases = (
+				172754BC107597F200D0347B /* ShellScript */,
+			);
+			dependencies = (
+			);
+			name = "Unit Tests";
+			productName = "Unit Tests";
+		};
+		1727560D10759EEA00D0347B /* Embed MacRuby */ = {
+			isa = PBXAggregateTarget;
+			buildConfigurationList = 1727562610759F0900D0347B /* Build configuration list for PBXAggregateTarget "Embed MacRuby" */;
+			buildPhases = (
+				1727560C10759EEA00D0347B /* ShellScript */,
+			);
+			dependencies = (
+				1727561110759EEE00D0347B /* PBXTargetDependency */,
+			);
+			name = "Embed MacRuby";
+			productName = "Embed MacRuby";
+		};
+/* End PBXAggregateTarget section */
+
 /* Begin PBXBuildFile section */
 		4DE339F70D74FCDD00ADB6EE /* rb_main.rb in Resources */ = {isa = PBXBuildFile; fileRef = 4DE339F60D74FCDD00ADB6EE /* rb_main.rb */; };
 		4DE3BE140D8651D900ECA448 /* MacRuby.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DE3BE130D8651D900ECA448 /* MacRuby.framework */; };
@@ -15,10 +41,34 @@
 		8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
 /* End PBXBuildFile section */
 
+/* Begin PBXContainerItemProxy section */
+		1727561010759EEE00D0347B /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = 8D1107260486CEB800E47090;
+			remoteInfo = "«PROJECTNAME»";
+		};
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+		172754B4107597CF00D0347B /* CopyFiles */ = {
+			isa = PBXCopyFilesBuildPhase;
+			buildActionMask = 2147483647;
+			dstPath = "";
+			dstSubfolderSpec = 10;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXCopyFilesBuildPhase section */
+
 /* Begin PBXFileReference section */
 		089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
 		1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
 		13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
+		172754D5107598EA00D0347B /* stub_test.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = stub_test.rb; sourceTree = "<group>"; };
+		17D55CD81076A1A2008207BD /* run_suite.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = run_suite.rb; sourceTree = "<group>"; };
 		29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
 		29B97319FDCFA39411CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = "<group>"; };
 		29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
@@ -68,6 +118,15 @@
 			name = "Other Frameworks";
 			sourceTree = "<group>";
 		};
+		172754AE1075979200D0347B /* Tests */ = {
+			isa = PBXGroup;
+			children = (
+				172754D5107598EA00D0347B /* stub_test.rb */,
+				17D55CD81076A1A2008207BD /* run_suite.rb */,
+			);
+			path = Tests;
+			sourceTree = "<group>";
+		};
 		19C28FACFE9D520D11CA2CBB /* Products */ = {
 			isa = PBXGroup;
 			children = (
@@ -79,6 +138,7 @@
 		29B97314FDCFA39411CA2CEA /* «PROJECTNAMEASXML» */ = {
 			isa = PBXGroup;
 			children = (
+				172754AE1075979200D0347B /* Tests */,
 				080E96DDFE201D6D7F000001 /* Classes */,
 				29B97315FDCFA39411CA2CEA /* Other Sources */,
 				29B97317FDCFA39411CA2CEA /* Resources */,
@@ -126,6 +186,7 @@
 				8D1107290486CEB800E47090 /* Resources */,
 				8D11072C0486CEB800E47090 /* Sources */,
 				8D11072E0486CEB800E47090 /* Frameworks */,
+				172754B4107597CF00D0347B /* CopyFiles */,
 			);
 			buildRules = (
 			);
@@ -150,6 +211,8 @@
 			projectRoot = "";
 			targets = (
 				8D1107260486CEB800E47090 /* «PROJECTNAME» */,
+				172754BD107597F200D0347B /* Unit Tests */,
+				1727560D10759EEA00D0347B /* Embed MacRuby */,
 			);
 		};
 /* End PBXProject section */
@@ -167,6 +230,35 @@
 		};
 /* End PBXResourcesBuildPhase section */
 
+/* Begin PBXShellScriptBuildPhase section */
+		172754BC107597F200D0347B /* ShellScript */ = {
+			isa = PBXShellScriptBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			inputPaths = (
+			);
+			outputPaths = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+			shellPath = /bin/sh;
+			shellScript = "/usr/local/bin/macruby Tests/run_suite.rb";
+		};
+		1727560C10759EEA00D0347B /* ShellScript */ = {
+			isa = PBXShellScriptBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			inputPaths = (
+			);
+			outputPaths = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+			shellPath = /bin/sh;
+			shellScript = "PATH=\"$PATH:/usr/local/bin\" /usr/bin/env macruby -r hotcocoa/application_builder -e \"HotCocoa::ApplicationBuilder.deploy(ARGV[0])\" \"$TARGET_BUILD_DIR/$PROJECT_NAME.app\"";
+		};
+/* End PBXShellScriptBuildPhase section */
+
 /* Begin PBXSourcesBuildPhase section */
 		8D11072C0486CEB800E47090 /* Sources */ = {
 			isa = PBXSourcesBuildPhase;
@@ -178,6 +270,14 @@
 		};
 /* End PBXSourcesBuildPhase section */
 
+/* Begin PBXTargetDependency section */
+		1727561110759EEE00D0347B /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = 8D1107260486CEB800E47090 /* «PROJECTNAME» */;
+			targetProxy = 1727561010759EEE00D0347B /* PBXContainerItemProxy */;
+		};
+/* End PBXTargetDependency section */
+
 /* Begin PBXVariantGroup section */
 		089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
 			isa = PBXVariantGroup;
@@ -198,10 +298,56 @@
 /* End PBXVariantGroup section */
 
 /* Begin XCBuildConfiguration section */
+		172754BE107597F200D0347B /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				PRODUCT_NAME = "Unit Tests";
+			};
+			name = Debug;
+		};
+		172754BF107597F200D0347B /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = YES;
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+				GCC_ENABLE_FIX_AND_CONTINUE = NO;
+				PRODUCT_NAME = "Unit Tests";
+				ZERO_LINK = NO;
+			};
+			name = Release;
+		};
+		1727560E10759EEA00D0347B /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				PRODUCT_NAME = "Embed MacRuby";
+			};
+			name = Debug;
+		};
+		1727560F10759EEA00D0347B /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = YES;
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+				GCC_ENABLE_FIX_AND_CONTINUE = NO;
+				PRODUCT_NAME = "Embed MacRuby";
+				ZERO_LINK = NO;
+			};
+			name = Release;
+		};
 		C01FCF4B08A954540054247B /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COPY_PHASE_STRIP = NO;
+				FRAMEWORK_SEARCH_PATHS = (
+					"$(inherited)",
+					"\"$(SRCROOT)/build/Debug\"",
+				);
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_ENABLE_FIX_AND_CONTINUE = YES;
 				GCC_MODEL_TUNING = G5;
@@ -219,6 +365,10 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+				FRAMEWORK_SEARCH_PATHS = (
+					"$(inherited)",
+					"\"$(SRCROOT)/build/Debug\"",
+				);
 				GCC_MODEL_TUNING = G5;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				INFOPLIST_FILE = Info.plist;
@@ -255,6 +405,24 @@
 /* End XCBuildConfiguration section */
 
 /* Begin XCConfigurationList section */
+		172754C7107597F400D0347B /* Build configuration list for PBXAggregateTarget "Unit Tests" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				172754BE107597F200D0347B /* Debug */,
+				172754BF107597F200D0347B /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		1727562610759F0900D0347B /* Build configuration list for PBXAggregateTarget "Embed MacRuby" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				1727560E10759EEA00D0347B /* Debug */,
+				1727560F10759EEA00D0347B /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
 		C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "«PROJECTNAME»" */ = {
 			isa = XCConfigurationList;
 			buildConfigurations = (

Added: MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Application/Tests/run_suite.rb
===================================================================
--- MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Application/Tests/run_suite.rb	                        (rev 0)
+++ MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Application/Tests/run_suite.rb	2009-10-05 17:42:34 UTC (rev 2723)
@@ -0,0 +1,2 @@
+
+Dir.glob(File.expand_path('../**/*_test.rb', __FILE__)).each { |test| require test }
\ No newline at end of file

Added: MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Application/Tests/stub_test.rb
===================================================================
--- MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Application/Tests/stub_test.rb	                        (rev 0)
+++ MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Application/Tests/stub_test.rb	2009-10-05 17:42:34 UTC (rev 2723)
@@ -0,0 +1,17 @@
+require 'test/unit'
+
+#require 'ruby_file_to_test'
+
+class SimpleTest < Test::Unit::TestCase
+	def setup
+		puts 'setup called'
+	end	
+	
+	def teardown
+		puts 'teardown called'
+	end
+	
+	def test_fail
+		assert(false, 'Assertion was false.')
+	end
+end
\ No newline at end of file
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20091005/27ec62b5/attachment-0001.html>


More information about the macruby-changes mailing list