autobuild 1.7.10 → 1.7.11.rc1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Autobuild
2
- VERSION = "1.7.10" unless defined? Autobuild::VERSION
2
+ VERSION = "1.7.11.rc1" unless defined? Autobuild::VERSION
3
3
  end
4
4
 
5
5
 
@@ -0,0 +1,83 @@
1
+ require 'minitest/spec'
2
+ require 'autobuild'
3
+ require 'fakefs/safe'
4
+ require 'flexmock'
5
+
6
+ describe Autobuild do
7
+
8
+ describe "tool" do
9
+ after do
10
+ Autobuild.programs.delete('test')
11
+ end
12
+
13
+ it "should return the tool name by default" do
14
+ assert_equal 'a_test_name', Autobuild.tool('a_test_name')
15
+ end
16
+ it "should return the default tool name as a string" do
17
+ assert_equal 'a_test_name', Autobuild.tool(:a_test_name)
18
+ end
19
+ it "should be indifferent whether a tool is overriden using symbols or strings" do
20
+ Autobuild.programs['test'] = 'a_test_name'
21
+ assert_equal 'a_test_name', Autobuild.tool('test')
22
+ assert_equal 'a_test_name', Autobuild.tool(:test)
23
+ Autobuild.programs[:test] = 'a_test_name'
24
+ assert_equal 'a_test_name', Autobuild.tool('test')
25
+ assert_equal 'a_test_name', Autobuild.tool(:test)
26
+ end
27
+ end
28
+
29
+ describe "tool_in_path" do
30
+ include FlexMock::ArgumentTypes
31
+ include FlexMock::MockContainer
32
+
33
+ before do
34
+ FakeFS.activate!
35
+ flexmock(Autobuild).should_receive(:tool).with('bla').and_return('a_test_name').by_default
36
+ flexmock(ENV).should_receive('[]').with('PATH').and_return('/a/path')
37
+ flexmock(ENV).should_receive('[]').with(any).pass_thru
38
+ FileUtils.mkdir_p('/a/path')
39
+ end
40
+ after do
41
+ FakeFS.deactivate!
42
+ FakeFS::FileSystem.clear
43
+ Autobuild.programs_in_path.delete('bla')
44
+ end
45
+
46
+ it "should raise ArgumentError if the tool is not present in path" do
47
+ assert_raises(ArgumentError) { Autobuild.tool_in_path('bla') }
48
+ end
49
+ it "should raise ArgumentError if the tool is present in path but is not a file" do
50
+ FileUtils.mkdir_p('/a/path/a_test_name')
51
+ assert_raises(ArgumentError) { Autobuild.tool_in_path('bla') }
52
+ end
53
+ it "should raise ArgumentError if the tool is present in path but is not executable" do
54
+ FileUtils.touch('/a/path/a_test_name')
55
+ FileUtils.chmod(0, '/a/path/a_test_name')
56
+ assert_raises(ArgumentError) { Autobuild.tool_in_path('bla') }
57
+ end
58
+ it "should return the full path to the resolved tool ArgumentError if the tool is present in path but is not executable" do
59
+ FileUtils.touch('/a/path/a_test_name')
60
+ FileUtils.chmod(0755, '/a/path/a_test_name')
61
+ assert_equal '/a/path/a_test_name', Autobuild.tool_in_path('bla')
62
+ end
63
+ it "should update the cache to the resolved value" do
64
+ FileUtils.touch('/a/path/a_test_name')
65
+ FileUtils.chmod(0755, '/a/path/a_test_name')
66
+ Autobuild.tool_in_path('bla')
67
+ assert_equal ['/a/path/a_test_name', 'a_test_name', ENV['PATH']], Autobuild.programs_in_path['bla'], "cached value mismatch"
68
+ end
69
+ it "should not re-hit the filesystem if the cache is up to date" do
70
+ Autobuild.programs_in_path['bla'] = ['bla', 'a_test_name', ENV['PATH']]
71
+ assert_equal 'bla', Autobuild.tool_in_path('bla')
72
+ end
73
+ it "should work fine if the tool is set to a full path" do
74
+ flexmock(Autobuild).should_receive(:tool).with('bla').and_return('/another/path/a_test_name')
75
+ FileUtils.mkdir_p('/another/path')
76
+ FileUtils.touch('/another/path/a_test_name')
77
+ FileUtils.chmod(0755, '/another/path/a_test_name')
78
+ assert_equal '/another/path/a_test_name', Autobuild.tool_in_path('bla')
79
+ end
80
+ end
81
+ end
82
+
83
+
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autobuild
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.10
5
- prerelease:
4
+ version: 1.7.11.rc1
5
+ prerelease: 7
6
6
  platform: ruby
7
7
  authors:
8
8
  - Sylvain Joyeux
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-09 00:00:00.000000000 Z
12
+ date: 2014-05-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -82,7 +82,7 @@ dependencies:
82
82
  requirements:
83
83
  - - ~>
84
84
  - !ruby/object:Gem::Version
85
- version: '3.7'
85
+ version: '3.12'
86
86
  type: :development
87
87
  prerelease: false
88
88
  version_requirements: !ruby/object:Gem::Requirement
@@ -90,7 +90,7 @@ dependencies:
90
90
  requirements:
91
91
  - - ~>
92
92
  - !ruby/object:Gem::Version
93
- version: '3.7'
93
+ version: '3.12'
94
94
  description: Collection of classes to handle build systems (CMake, autotools, ...)
95
95
  and import mechanisms (tarballs, CVS, SVN, git, ...). It also offers a Rake integration
96
96
  to import and build such software packages. It is the backbone of the autoproj (http://rock-robotics.org/autoproj)
@@ -133,12 +133,15 @@ files:
133
133
  - lib/autobuild/packages/import.rb
134
134
  - lib/autobuild/packages/orogen.rb
135
135
  - lib/autobuild/packages/pkgconfig.rb
136
+ - lib/autobuild/packages/ruby.rb
137
+ - lib/autobuild/utility.rb
136
138
  - lib/autobuild/parallel.rb
137
139
  - lib/autobuild/pkgconfig.rb
138
140
  - lib/autobuild/reporting.rb
139
141
  - lib/autobuild/subcommand.rb
140
142
  - lib/autobuild/timestamps.rb
141
143
  - lib/autobuild/version.rb
144
+ - lib/autobuild/rake_task_extension.rb
142
145
  - samples/openrobots.autobuild
143
146
  - test/data/cvsroot.tar
144
147
  - test/data/svnroot.tar
@@ -149,6 +152,7 @@ files:
149
152
  - test/test_reporting.rb
150
153
  - test/test_subcommand.rb
151
154
  - test/tools.rb
155
+ - test/test_config.rb
152
156
  - .gemtest
153
157
  homepage: http://rock-robotics.org/stable/documentation/autoproj
154
158
  licenses:
@@ -168,18 +172,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
168
172
  required_rubygems_version: !ruby/object:Gem::Requirement
169
173
  none: false
170
174
  requirements:
171
- - - ! '>='
175
+ - - ! '>'
172
176
  - !ruby/object:Gem::Version
173
- version: '0'
177
+ version: 1.3.1
174
178
  requirements: []
175
- rubyforge_project: autobuild
179
+ rubyforge_project:
176
180
  rubygems_version: 1.8.23
177
181
  signing_key:
178
182
  specification_version: 3
179
183
  summary: Library to handle build systems and import mechanisms
180
184
  test_files:
181
- - test/test_import_cvs.rb
182
- - test/test_reporting.rb
185
+ - test/test_import_tar.rb
186
+ - test/test_config.rb
183
187
  - test/test_subcommand.rb
188
+ - test/test_reporting.rb
184
189
  - test/test_import_svn.rb
185
- - test/test_import_tar.rb
190
+ - test/test_import_cvs.rb