This repository has been archived by the owner on Aug 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
/
Rakefile
62 lines (53 loc) · 1.78 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
task :default => "test"
desc "Run all tests"
task :test => %w(test:ppane test:passenger_pane)
namespace :ppane do
desc "Install the Passenger Preference Pane"
task :install => :build do
prefpane = File.join(ENV['BUILT_PRODUCTS_DIR'], 'Passenger.prefPane')
sh "open #{prefpane}"
end
end
namespace :gem do
desc "Build the gem"
task :build do
sh "gem build ppane.gemspec"
end
desc "Install the gem"
task :install => :build do
if filename = FileList['*.gem'].sort_by { |name| name }.last
sh "gem install #{filename}"
end
end
end
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 "Build framework for testing"
task :build do
result = `/Developer/usr/bin/xcodebuild -project Passenger.xcodeproj -target PassengerTest`
puts result unless result.include?('** BUILD SUCCEEDED **')
end
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; for test in *_test.nu; do /usr/local/bin/nush $test; done"
else
puts "[!] Please install Nu to run the functional tests (see doc/DEVELOPMENT)"
end
end
end
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'])
sh "rm -Rf #{File.join(test_directory, framework_name)}"
sh "cp -r #{framework} #{test_directory}"
end
end