Permalink
Browse files

Compile framework for testing and add some basic specs for Application.

  • Loading branch information...
1 parent f13b28b commit f29c64e750d1d1e857cc57acdf0101aedcd77189 @Manfred Manfred committed Jan 11, 2011
View
243 Passenger.xcodeproj/project.pbxproj
@@ -19,6 +19,15 @@
6361755412B7C18F00E3412D /* lib in Resources */ = {isa = PBXBuildFile; fileRef = 6361755212B7C18F00E3412D /* lib */; };
6361755712B7C4B500E3412D /* CLI.h in Headers */ = {isa = PBXBuildFile; fileRef = 6361755512B7C4B500E3412D /* CLI.h */; };
6361755812B7C4B500E3412D /* CLI.m in Sources */ = {isa = PBXBuildFile; fileRef = 6361755612B7C4B500E3412D /* CLI.m */; };
+ 63EF8CFF12DC8FC00063C6CD /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63EF8CFE12DC8FC00063C6CD /* Cocoa.framework */; };
+ 63EF8D0412DC8FC10063C6CD /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 63EF8D0212DC8FC10063C6CD /* InfoPlist.strings */; };
+ 63EF8D0C12DC8FE10063C6CD /* CLI.m in Sources */ = {isa = PBXBuildFile; fileRef = 6361755612B7C4B500E3412D /* CLI.m */; };
+ 63EF8D0D12DC8FE30063C6CD /* PassengerPref.m in Sources */ = {isa = PBXBuildFile; fileRef = F506C03D013D9D7901CA16C8 /* PassengerPref.m */; };
+ 63EF8D0E12DC8FE40063C6CD /* Application.m in Sources */ = {isa = PBXBuildFile; fileRef = 63F589EA12BA6B5200D959E3 /* Application.m */; };
+ 63EF8D1212DC91070063C6CD /* PreferencePanes.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63EF8D1112DC91070063C6CD /* PreferencePanes.framework */; };
+ 63EF8D1412DC910F0063C6CD /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63EF8D1312DC910F0063C6CD /* Security.framework */; };
+ 63EF8D1612DC91140063C6CD /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63EF8D1512DC91140063C6CD /* Carbon.framework */; };
+ 63EF8D1C12DC99D50063C6CD /* YAML.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63EF8D1B12DC99D50063C6CD /* YAML.framework */; };
63F589E512BA627E00D959E3 /* YAML.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63F589E412BA627E00D959E3 /* YAML.framework */; };
63F589E712BA62CC00D959E3 /* YAML.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 63F589E612BA62CC00D959E3 /* YAML.framework */; };
63F589EB12BA6B5300D959E3 /* Application.h in Headers */ = {isa = PBXBuildFile; fileRef = 63F589E912BA6B5200D959E3 /* Application.h */; };
@@ -64,6 +73,16 @@
6361755212B7C18F00E3412D /* lib */ = {isa = PBXFileReference; lastKnownFileType = folder; path = lib; sourceTree = "<group>"; };
6361755512B7C4B500E3412D /* CLI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CLI.h; path = app/utils/CLI.h; sourceTree = "<group>"; };
6361755612B7C4B500E3412D /* CLI.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CLI.m; path = app/utils/CLI.m; sourceTree = "<group>"; };
+ 63EF8CFD12DC8FC00063C6CD /* PassengerTest.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PassengerTest.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ 63EF8CFE12DC8FC00063C6CD /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
+ 63EF8D0012DC8FC10063C6CD /* PassengerTest-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "PassengerTest-Info.plist"; sourceTree = "<group>"; };
+ 63EF8D0112DC8FC10063C6CD /* PassengerTest-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PassengerTest-Prefix.pch"; sourceTree = "<group>"; };
+ 63EF8D0312DC8FC10063C6CD /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 63EF8D0F12DC90900063C6CD /* YAML.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = YAML.framework; path = vendor/YAML.framework; sourceTree = "<group>"; };
+ 63EF8D1112DC91070063C6CD /* PreferencePanes.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PreferencePanes.framework; path = System/Library/Frameworks/PreferencePanes.framework; sourceTree = SDKROOT; };
+ 63EF8D1312DC910F0063C6CD /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
+ 63EF8D1512DC91140063C6CD /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; };
+ 63EF8D1B12DC99D50063C6CD /* YAML.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = YAML.framework; path = vendor/YAML.framework; sourceTree = "<group>"; };
63F589E412BA627E00D959E3 /* YAML.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = YAML.framework; path = vendor/YAML.framework; sourceTree = "<group>"; };
63F589E612BA62CC00D959E3 /* YAML.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = YAML.framework; path = vendor/YAML.framework; sourceTree = "<group>"; };
63F589E912BA6B5200D959E3 /* Application.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Application.h; path = app/models/Application.h; sourceTree = "<group>"; };
@@ -77,6 +96,18 @@
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
+ 63EF8CF912DC8FC00063C6CD /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 63EF8D1C12DC99D50063C6CD /* YAML.framework in Frameworks */,
+ 63EF8D1612DC91140063C6CD /* Carbon.framework in Frameworks */,
+ 63EF8D1412DC910F0063C6CD /* Security.framework in Frameworks */,
+ 63EF8D1212DC91070063C6CD /* PreferencePanes.framework in Frameworks */,
+ 63EF8CFF12DC8FC00063C6CD /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
8D202CF20486D31800D8A456 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -95,6 +126,7 @@
089C166AFE841209C02AAC07 /* Passenger */ = {
isa = PBXGroup;
children = (
+ 63EF8D0F12DC90900063C6CD /* YAML.framework */,
5189C6E60E111C3300B83EA5 /* LICENSE */,
63F589E612BA62CC00D959E3 /* YAML.framework */,
63F589E412BA627E00D959E3 /* YAML.framework */,
@@ -103,6 +135,7 @@
089C167CFE841241C02AAC07 /* Resources */,
089C1671FE841209C02AAC07 /* Frameworks and Libraries */,
19C28FB8FE9D52D311CA2CBB /* Products */,
+ 63EF8CF712DC8FC00063C6CD /* Frameworks */,
);
name = Passenger;
sourceTree = "<group>";
@@ -130,6 +163,8 @@
518C7F550E06745E003A3ED0 /* Security.framework */,
089C167DFE841241C02AAC07 /* InfoPlist.strings */,
76890D44109F7E9700097BC5 /* OpenInBrowserTemplate.tiff */,
+ 63EF8D0012DC8FC10063C6CD /* PassengerTest-Info.plist */,
+ 63EF8D0212DC8FC10063C6CD /* InfoPlist.strings */,
);
name = Resources;
sourceTree = "<group>";
@@ -170,6 +205,7 @@
isa = PBXGroup;
children = (
8D202CF80486D31800D8A456 /* Passenger.prefPane */,
+ 63EF8CFD12DC8FC00063C6CD /* PassengerTest.framework */,
);
name = Products;
sourceTree = "<group>";
@@ -178,10 +214,23 @@
isa = PBXGroup;
children = (
32DBCFA20370C41700C91783 /* Passenger_Prefix.pch */,
+ 63EF8D0112DC8FC10063C6CD /* PassengerTest-Prefix.pch */,
);
name = "Other Sources";
sourceTree = "<group>";
};
+ 63EF8CF712DC8FC00063C6CD /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 63EF8D1512DC91140063C6CD /* Carbon.framework */,
+ 63EF8D1312DC910F0063C6CD /* Security.framework */,
+ 63EF8D1112DC91070063C6CD /* PreferencePanes.framework */,
+ 63EF8CFE12DC8FC00063C6CD /* Cocoa.framework */,
+ 63EF8D1B12DC99D50063C6CD /* YAML.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
@@ -200,18 +249,35 @@
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
+ 63EF8CFC12DC8FC00063C6CD /* PassengerTest */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 63EF8D0712DC8FC10063C6CD /* Build configuration list for PBXNativeTarget "PassengerTest" */;
+ buildPhases = (
+ 63EF8CF812DC8FC00063C6CD /* Sources */,
+ 63EF8CF912DC8FC00063C6CD /* Frameworks */,
+ 63EF8CFB12DC8FC00063C6CD /* Resources */,
+ 63EF8D1712DC915C0063C6CD /* ShellScript */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = PassengerTest;
+ productName = PassengerTest;
+ productReference = 63EF8CFD12DC8FC00063C6CD /* PassengerTest.framework */;
+ productType = "com.apple.product-type.framework";
+ };
8D202CE80486D31800D8A456 /* Passenger */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1DBD214808BA80EA00186707 /* Build configuration list for PBXNativeTarget "Passenger" */;
buildPhases = (
8D202CE90486D31800D8A456 /* Headers */,
8D202CEC0486D31800D8A456 /* Resources */,
8D202CF00486D31800D8A456 /* Sources */,
+ 51DA08CA104BFFFE00C8C106 /* Copy Frameworks */,
8D202CF20486D31800D8A456 /* Frameworks */,
8D202CF50486D31800D8A456 /* Rez */,
- 51DA08CA104BFFFE00C8C106 /* Copy Frameworks */,
63F589E812BA635A00D959E3 /* ShellScript */,
- 63A221FF12C3DB0700BE4D68 /* ShellScript */,
);
buildRules = (
);
@@ -240,11 +306,20 @@
projectRoot = "";
targets = (
8D202CE80486D31800D8A456 /* Passenger */,
+ 63EF8CFC12DC8FC00063C6CD /* PassengerTest */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
+ 63EF8CFB12DC8FC00063C6CD /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 63EF8D0412DC8FC10063C6CD /* InfoPlist.strings in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
8D202CEC0486D31800D8A456 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -274,18 +349,18 @@
/* End PBXRezBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
- 63A221FF12C3DB0700BE4D68 /* ShellScript */ = {
+ 63EF8D1712DC915C0063C6CD /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
- buildActionMask = 8;
+ buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
- runOnlyForDeploymentPostprocessing = 1;
+ runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "rake ppane:install";
+ shellScript = "rake xcode:setup_test_framework";
};
63F589E812BA635A00D959E3 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
@@ -298,11 +373,21 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "rake ppane:fix_framework_location";
+ shellScript = "rake xcode:fix_framework_location";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
+ 63EF8CF812DC8FC00063C6CD /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 63EF8D0C12DC8FE10063C6CD /* CLI.m in Sources */,
+ 63EF8D0D12DC8FE30063C6CD /* PassengerPref.m in Sources */,
+ 63EF8D0E12DC8FE40063C6CD /* Application.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
8D202CF00486D31800D8A456 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -324,6 +409,14 @@
name = InfoPlist.strings;
sourceTree = "<group>";
};
+ 63EF8D0212DC8FC10063C6CD /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 63EF8D0312DC8FC10063C6CD /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
9648B5EE0D195C2F00DC73E2 /* Pref.xib */ = {
isa = PBXVariantGroup;
children = (
@@ -393,7 +486,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
- SDKROOT = macosx10.6;
+ SDKROOT = macosx;
VALID_ARCHS = x86_64;
};
name = Debug;
@@ -408,11 +501,130 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
- SDKROOT = macosx10.6;
+ SDKROOT = macosx;
VALID_ARCHS = x86_64;
};
name = Release;
};
+ 63EF8D0512DC8FC10063C6CD /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ };
+ name = Debug;
+ };
+ 63EF8D0612DC8FC10063C6CD /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ };
+ name = Release;
+ };
+ 63EF8D0812DC8FC10063C6CD /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_64_BIT_PRE_XCODE_3_1 = x86_64;
+ COPY_PHASE_STRIP = NO;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)/vendor\"",
+ );
+ FRAMEWORK_VERSION = A;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "PassengerTest-Prefix.pch";
+ GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
+ GCC_VERSION = "";
+ INFOPLIST_FILE = "PassengerTest-Info.plist";
+ INSTALL_PATH = "$(HOME)/Library/Frameworks";
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)/vendor/YAML.framework/Versions/A\"",
+ );
+ MACOSX_DEPLOYMENT_TARGET = 10.6;
+ ONLY_ACTIVE_ARCH = NO;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = macosx;
+ WRAPPER_EXTENSION = framework;
+ };
+ name = Debug;
+ };
+ 63EF8D0912DC8FC10063C6CD /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_64_BIT_PRE_XCODE_3_1 = x86_64;
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)/vendor\"",
+ );
+ FRAMEWORK_VERSION = A;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "PassengerTest-Prefix.pch";
+ GCC_VERSION = "";
+ INFOPLIST_FILE = "PassengerTest-Info.plist";
+ INSTALL_PATH = "$(HOME)/Library/Frameworks";
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)/vendor/YAML.framework/Versions/A\"",
+ );
+ MACOSX_DEPLOYMENT_TARGET = 10.6;
+ ONLY_ACTIVE_ARCH = NO;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SDKROOT = macosx;
+ WRAPPER_EXTENSION = framework;
+ };
+ name = Release;
+ };
+ 63EF8D0A12DC8FC10063C6CD /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)/vendor\"",
+ );
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)/vendor/YAML.framework/Versions/A\"",
+ );
+ PRODUCT_NAME = PassengerTest;
+ };
+ name = Debug;
+ };
+ 63EF8D0B12DC8FC10063C6CD /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ FRAMEWORK_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)/vendor\"",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "\"$(SRCROOT)/vendor/YAML.framework/Versions/A\"",
+ );
+ PRODUCT_NAME = PassengerTest;
+ };
+ name = Release;
+ };
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
@@ -430,6 +642,19 @@
buildConfigurations = (
1DBD214D08BA80EA00186707 /* Debug */,
1DBD214E08BA80EA00186707 /* Release */,
+ 63EF8D0512DC8FC10063C6CD /* Debug */,
+ 63EF8D0612DC8FC10063C6CD /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 63EF8D0712DC8FC10063C6CD /* Build configuration list for PBXNativeTarget "PassengerTest" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 63EF8D0812DC8FC10063C6CD /* Debug */,
+ 63EF8D0912DC8FC10063C6CD /* Release */,
+ 63EF8D0A12DC8FC10063C6CD /* Debug */,
+ 63EF8D0B12DC8FC10063C6CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
View
32 PassengerTest-Info.plist
@@ -0,0 +1,32 @@
+<?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>CFBundleIdentifier</key>
+ <string>com.fngtps.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>NSPrincipalClass</key>
+ <string></string>
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright © 2011 Fingertips. All rights reserved.</string>
+</dict>
+</plist>
+
View
7 PassengerTest-Prefix.pch
@@ -0,0 +1,7 @@
+//
+// Prefix header for all source files of the 'PassengerTest' target in the 'PassengerTest' project
+//
+
+#ifdef __OBJC__
+ #import <Cocoa/Cocoa.h>
+#endif
View
100 Rakefile
@@ -1,36 +1,11 @@
task :default => "test"
-require 'rake/testtask'
-namespace :test do
- Rake::TestTask.new('ppane') do |t|
- t.test_files = FileList['test/ppane/*_test.rb']
- t.verbose = true
- end
-
- desc "Run all functional tests for the Passenger Preference Pane"
- task :passenger_pane do
- if `which nush`.strip != ''
- sh "cd test/passenger_pane; nush *_test.nu"
- else
- puts "[!] Please install Nu to run the functional tests (see doc/DEVELOPMENT)"
- end
- end
-end
-
desc "Run all tests"
task :test => %w(test:ppane test:passenger_pane)
namespace :ppane do
- desc "Adjusts the install name of the bundled YAML.framework so it can be found by the pane (run from Xcode)"
- task :fix_framework_location do
- directory = ENV['BUILT_PRODUCTS_DIR']
- binary = File.join(directory, 'Passenger.prefPane/Contents/MacOS/Passenger')
- executable_path = `/usr/bin/otool -L #{binary}`.match(/^\t(.+YAML)/)[1]
- sh "/usr/bin/install_name_tool -change '#{executable_path}' '#{executable_path.gsub('executable_path', 'loader_path')}' '#{binary}'"
- end
-
- desc "Install the Passenger Preference Pane (run from Xcode)"
- task :install do
+ desc "Install the Passenger Preference Pane"
+ task :install => :build do
prefpane = File.join(ENV['BUILT_PRODUCTS_DIR'], 'Passenger.prefPane')
sh "open #{prefpane}"
end
@@ -50,49 +25,48 @@ namespace :gem do
end
end
-# --- Evaluate
-
-namespace :prefpane do
- BUILD = "build/Release/Passenger.prefPane"
- BIN = File.join(BUILD, 'Contents/MacOS/Passenger')
-
- desc 'Build the prefpane'
- task :build do
- sh "xcodebuild -configuration Release"
+require 'rake/testtask'
+namespace :test do
+ Rake::TestTask.new('ppane') do |t|
+ t.test_files = FileList['test/ppane/*_test.rb']
+ t.verbose = true
end
- # Make sure that the prefpane searches inside the bundle for the RubyCocoa framework.
- #
- # This task is invoked from the xcode project post build script.
- desc 'Adjusts the install name of the bundled RubyCocoa to point to the right place'
- task :change_ruycocoa_framework_location do
- current = `/usr/bin/otool -L #{BIN}`.match(/^\t(.+RubyCocoa).+$/)[1]
- sh "/usr/bin/install_name_tool -change '#{current}' '@loader_path/../Frameworks/RubyCocoa.framework/Versions/A/RubyCocoa' '#{BIN}'"
+ desc "Build framework for testing"
+ task :build do
+ result = `/Xcode4/usr/bin/xcodebuild -project Passenger.xcodeproj -target PassengerTest`
+ puts result unless result.include?('** BUILD SUCCEEDED **')
end
- desc 'Builds and opens the prefpane'
- task :run => :build do
- sh "open #{BUILD}"
+ desc "Run all functional tests for the Passenger Preference Pane"
+ task :passenger_pane => :build do
+ if File.exist?('/usr/local/bin/nush')
+ sh "cd test/passenger_pane; /usr/local/bin/nush *_test.nu"
+ else
+ puts "[!] Please install Nu to run the functional tests (see doc/DEVELOPMENT)"
+ end
end
end
-desc 'Cleans the build and release pkg'
-task :clean do
- sh 'rm -rf build/'
- sh 'rm -rf pkg'
-end
-
-desc 'Creates a release build and pkg'
-task :release => [:clean, 'prefpane:build'] do
- require 'osx/cocoa'
- version = OSX::NSDictionary.dictionaryWithContentsOfFile('Info.plist')['CFBundleVersion'].to_s
- name = "PassengerPane-#{version}"
- pkg_dir = "pkg/#{name}"
+namespace :xcode do
+ desc "Prepares the compiled framework for loading from Nu"
+ task :setup_test_framework do
+ test_directory = File.expand_path('../test/passenger_pane', __FILE__)
+ framework_name = ENV['FULL_PRODUCT_NAME']
+ framework = File.join(ENV['BUILT_PRODUCTS_DIR'], framework_name)
+ binary = File.join(ENV['BUILT_PRODUCTS_DIR'], ENV['EXECUTABLE_PATH'])
+ yaml_path = `/usr/bin/otool -L #{binary}`.match(/^\t(.+YAML)/)[1]
+ yaml_framework = File.expand_path('../vendor/YAML.framework/Versions/A/YAML', __FILE__)
+ sh "/usr/bin/install_name_tool -change '#{yaml_path}' '#{yaml_framework}' '#{binary}'"
+
+ sh "rm -Rf #{File.join(test_directory, framework_name)}"
+ sh "cp -r #{framework} #{test_directory}"
+ end
- sh "mkdir -p #{pkg_dir}"
- sh "cp -R build/Release/Passenger.prefPane #{pkg_dir}"
- %w{ LICENSE README.rdoc app/config/passenger_pane_config.rb.ports }.each do |file|
- sh "cp #{file} #{pkg_dir}"
+ desc "Fixes the YAML framework location"
+ task :fix_framework_location do
+ binary = File.join(ENV['BUILT_PRODUCTS_DIR'], ENV['EXECUTABLE_PATH'])
+ executable_path = `/usr/bin/otool -L #{binary}`.match(/^\t(.+YAML)/)[1]
+ sh "/usr/bin/install_name_tool -change '#{executable_path}' '#{executable_path.gsub('executable_path', 'loader_path')}' '#{binary}'"
end
- sh "cd pkg/ && tar -czvf #{name}.tgz #{name}/"
end
View
4 app/models/Application.m
@@ -48,10 +48,12 @@ - (id) initWithDirectory:(NSString *)aPath {
}
- (void) updateWithAttributes:(NSDictionary *)attributes {
+ NSString *environment = [attributes objectForKey:@"environment"];
self.host = [attributes objectForKey:@"host"];
self.aliases = [attributes objectForKey:@"aliases"];
self.path = [attributes objectForKey:@"path"];
- self.environment = [environments indexOfObject:[attributes objectForKey:@"environment"]];
+ if (environment)
+ self.environment = [environments indexOfObject:environment];
self.configFilename = [attributes objectForKey:@"config_filename"];
}
View
2 en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+/* Localized versions of Info.plist keys */
+
View
29 test/passenger_pane/application_test.nu
@@ -1 +1,28 @@
-(load "test_helper")
+(load "test_helper")
+
+(describe "Application" `(
+ (it "initializes with attributes" (do ()
+ (set attributes (NSMutableDictionary dictionary))
+ (attributes setValue:"test.host" forKey:"host")
+ (attributes setValue:"assets.test.host" forKey:"aliases")
+ (attributes setValue:"/path/to/test" forKey:"path")
+ (attributes setValue:"production" forKey:"environment")
+ (attributes setValue:"/path/to/test.conf" forKey:"config_filename")
+ (set application ((Application alloc) initWithAttributes:attributes))
+
+ (~ application host should be:"test.host")
+ (~ application aliases should be:"assets.test.host")
+ (~ application path should be:"/path/to/test")
+ (~ application environment should be:1)
+ (~ application configFilename should be:"/path/to/test.conf")
+ ))
+
+ (it "initializes with attributes, even when the environment is not passed" (do ()
+ (set attributes (NSMutableDictionary dictionary))
+ (attributes setValue:"test.host" forKey:"host")
+ (set application ((Application alloc) initWithAttributes:attributes))
+ (~ application host should be:"test.host")
+ ))
+))
+
+((Bacon sharedInstance) run)
View
3 test/passenger_pane/test_helper.nu
@@ -1,3 +1,4 @@
(load "Nu:nu")
(load "Nu:cocoa")
-(load "NuBacon/bacon")
+(load "NuBacon/bacon")
+(load "PassengerTest")

0 comments on commit f29c64e

Please sign in to comment.