paper_house 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +46 -12
- data/LICENSE +674 -0
- data/README.md +18 -10
- data/Rakefile +7 -117
- data/features/executable_task.feature +6 -0
- data/features/step_definitions/paper_house_steps.rb +1 -1
- data/features/support/env.rb +3 -32
- data/lib/paper_house/auto_depends.rb +4 -23
- data/lib/paper_house/build_failed.rb +18 -0
- data/lib/paper_house/build_task.rb +10 -24
- data/lib/paper_house/cc_options.rb +1 -23
- data/lib/paper_house/dependency.rb +1 -23
- data/lib/paper_house/executable_task.rb +1 -27
- data/lib/paper_house/library_task.rb +1 -23
- data/lib/paper_house/linker_options.rb +1 -23
- data/lib/paper_house/platform.rb +11 -32
- data/lib/paper_house/ruby_extension_task.rb +1 -27
- data/lib/paper_house/safe_popen.rb +1 -23
- data/lib/paper_house/shared_library_task.rb +1 -27
- data/lib/paper_house/static_library_task.rb +2 -24
- data/lib/paper_house/version.rb +2 -24
- data/lib/paper_house.rb +1 -23
- data/paper_house.gemspec +11 -9
- data/spec/paper_house/executable_task_spec.rb +26 -53
- data/spec/paper_house/ruby_extension_task_spec.rb +26 -53
- data/spec/paper_house/shared_library_task_spec.rb +30 -57
- data/spec/paper_house/static_library_task_spec.rb +41 -68
- data/spec/paper_house/version_spec.rb +1 -23
- data/spec/spec_helper.rb +3 -31
- metadata +24 -67
- data/.gitignore +0 -19
- data/.rspec +0 -3
- data/.rubocop.yml +0 -1
- data/.ruby-version +0 -1
- data/.travis.yml +0 -18
- data/Gemfile +0 -35
- data/Guardfile +0 -22
- data/cucumber.yml +0 -3
- data/examples/executable/.gitignore +0 -4
- data/examples/executable/Rakefile +0 -5
- data/examples/executable/Rakefile.llvm +0 -5
- data/examples/executable/hello.c +0 -7
- data/examples/executable_subdirs/.gitignore +0 -4
- data/examples/executable_subdirs/Rakefile +0 -11
- data/examples/executable_subdirs/includes/hello.h +0 -1
- data/examples/executable_subdirs/sources/hello.c +0 -6
- data/examples/executable_subdirs/sources/main.c +0 -8
- data/examples/ruby_extension/.gitignore +0 -5
- data/examples/ruby_extension/Rakefile +0 -5
- data/examples/ruby_extension/Rakefile.llvm +0 -5
- data/examples/ruby_extension/hello.c +0 -6
- data/examples/shared_library/.gitignore +0 -8
- data/examples/shared_library/Rakefile +0 -23
- data/examples/shared_library/Rakefile.llvm +0 -25
- data/examples/shared_library/hello.c +0 -6
- data/examples/shared_library/hello.h +0 -1
- data/examples/shared_library/main.c +0 -7
- data/examples/shared_library_subdirs/.gitignore +0 -8
- data/examples/shared_library_subdirs/Rakefile +0 -28
- data/examples/shared_library_subdirs/includes/hello.h +0 -1
- data/examples/shared_library_subdirs/sources/hello.c +0 -6
- data/examples/shared_library_subdirs/sources/main.c +0 -8
- data/examples/static_library/.gitignore +0 -7
- data/examples/static_library/Rakefile +0 -14
- data/examples/static_library/Rakefile.llvm +0 -14
- data/examples/static_library/hello.c +0 -6
- data/examples/static_library/hello.h +0 -1
- data/examples/static_library/main.c +0 -7
- data/examples/static_library_subdirs/.gitignore +0 -7
- data/examples/static_library_subdirs/Rakefile +0 -19
- data/examples/static_library_subdirs/includes/hello.h +0 -1
- data/examples/static_library_subdirs/sources/hello.c +0 -6
- data/examples/static_library_subdirs/sources/main.c +0 -8
- data/rake_simplecov_hook.rb +0 -24
- data/rubocop-todo.yml +0 -6
@@ -1,20 +1,4 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
# Copyright (C) 2013 NEC Corporation
|
4
|
-
#
|
5
|
-
# This program is free software; you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License, version 3, as
|
7
|
-
# published by the Free Software Foundation.
|
8
|
-
#
|
9
|
-
# This program is distributed in the hope that it will be useful,
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
-
# GNU General Public License for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this program; if not, write to the Free Software Foundation, Inc.,
|
16
|
-
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
17
|
-
#
|
1
|
+
# encoding: utf-8
|
18
2
|
|
19
3
|
require 'paper_house/library_task'
|
20
4
|
require 'paper_house/linker_options'
|
@@ -53,10 +37,6 @@ module PaperHouse
|
|
53
37
|
|
54
38
|
private
|
55
39
|
|
56
|
-
def generate_target
|
57
|
-
sh(([cc] + cc_options).join(' '))
|
58
|
-
end
|
59
|
-
|
60
40
|
def cc_options
|
61
41
|
['-shared', wl_option, o_option, objects, ldflags, l_options].flatten
|
62
42
|
end
|
@@ -70,9 +50,3 @@ module PaperHouse
|
|
70
50
|
end
|
71
51
|
end
|
72
52
|
end
|
73
|
-
|
74
|
-
### Local variables:
|
75
|
-
### mode: Ruby
|
76
|
-
### coding: utf-8-unix
|
77
|
-
### indent-tabs-mode: nil
|
78
|
-
### End:
|
@@ -1,20 +1,4 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
# Copyright (C) 2013 NEC Corporation
|
4
|
-
#
|
5
|
-
# This program is free software; you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License, version 3, as
|
7
|
-
# published by the Free Software Foundation.
|
8
|
-
#
|
9
|
-
# This program is distributed in the hope that it will be useful,
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
-
# GNU General Public License for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this program; if not, write to the Free Software Foundation, Inc.,
|
16
|
-
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
17
|
-
#
|
1
|
+
# encoding: utf-8
|
18
2
|
|
19
3
|
require 'paper_house/library_task'
|
20
4
|
|
@@ -40,7 +24,7 @@ module PaperHouse
|
|
40
24
|
end
|
41
25
|
|
42
26
|
def ar
|
43
|
-
sh "ar -cq #{target_path} #{objects
|
27
|
+
sh "ar -cq #{target_path} #{objects}"
|
44
28
|
end
|
45
29
|
|
46
30
|
def ranlib
|
@@ -48,9 +32,3 @@ module PaperHouse
|
|
48
32
|
end
|
49
33
|
end
|
50
34
|
end
|
51
|
-
|
52
|
-
### Local variables:
|
53
|
-
### mode: Ruby
|
54
|
-
### coding: utf-8-unix
|
55
|
-
### indent-tabs-mode: nil
|
56
|
-
### End:
|
data/lib/paper_house/version.rb
CHANGED
@@ -1,29 +1,7 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
# Copyright (C) 2013 NEC Corporation
|
4
|
-
#
|
5
|
-
# This program is free software; you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License, version 3, as
|
7
|
-
# published by the Free Software Foundation.
|
8
|
-
#
|
9
|
-
# This program is distributed in the hope that it will be useful,
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
-
# GNU General Public License for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this program; if not, write to the Free Software Foundation, Inc.,
|
16
|
-
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
17
|
-
#
|
1
|
+
# encoding: utf-8
|
18
2
|
|
19
3
|
# Base module.
|
20
4
|
module PaperHouse
|
21
5
|
# gem version.
|
22
|
-
VERSION = '0.
|
6
|
+
VERSION = '0.6.0'
|
23
7
|
end
|
24
|
-
|
25
|
-
### Local variables:
|
26
|
-
### mode: Ruby
|
27
|
-
### coding: utf-8
|
28
|
-
### indent-tabs-mode: nil
|
29
|
-
### End:
|
data/lib/paper_house.rb
CHANGED
@@ -1,29 +1,7 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
# Copyright (C) 2013 NEC Corporation
|
4
|
-
#
|
5
|
-
# This program is free software; you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License, version 3, as
|
7
|
-
# published by the Free Software Foundation.
|
8
|
-
#
|
9
|
-
# This program is distributed in the hope that it will be useful,
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
-
# GNU General Public License for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this program; if not, write to the Free Software Foundation, Inc.,
|
16
|
-
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
17
|
-
#
|
1
|
+
# encoding: utf-8
|
18
2
|
|
19
3
|
require 'paper_house/executable_task'
|
20
4
|
require 'paper_house/ruby_extension_task'
|
21
5
|
require 'paper_house/shared_library_task'
|
22
6
|
require 'paper_house/static_library_task'
|
23
7
|
require 'paper_house/version'
|
24
|
-
|
25
|
-
### Local variables:
|
26
|
-
### mode: Ruby
|
27
|
-
### coding: utf-8-unix
|
28
|
-
### indent-tabs-mode: nil
|
29
|
-
### End:
|
data/paper_house.gemspec
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
lib = File.expand_path('../lib', __FILE__)
|
2
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
5
|
require 'paper_house/version'
|
@@ -14,19 +16,19 @@ Gem::Specification.new do |gem|
|
|
14
16
|
gem.email = ['yasuhito@gmail.com']
|
15
17
|
gem.homepage = 'http://github.com/trema/paper-house'
|
16
18
|
|
17
|
-
gem.files =
|
19
|
+
gem.files = %w(CONTRIBUTING.md LICENSE Rakefile paper_house.gemspec)
|
20
|
+
gem.files += Dir.glob('lib/**/*.rb')
|
21
|
+
gem.files += Dir.glob('bin/**/*')
|
22
|
+
gem.files += Dir.glob('spec/**/*')
|
23
|
+
gem.files += Dir.glob('features/**/*')
|
18
24
|
|
19
25
|
gem.require_paths = ['lib']
|
20
26
|
|
21
27
|
gem.extra_rdoc_files = ['README.md']
|
22
|
-
gem.test_files =
|
28
|
+
gem.test_files = Dir.glob('spec/**/*')
|
29
|
+
gem.test_files += Dir.glob('features/**/*')
|
23
30
|
|
31
|
+
gem.required_ruby_version = '>= 1.9.3'
|
24
32
|
gem.add_dependency 'POpen4', '~> 0.1.4'
|
25
|
-
gem.add_dependency 'rake', '~> 10.1
|
33
|
+
gem.add_dependency 'rake', '~> 10.2.1'
|
26
34
|
end
|
27
|
-
|
28
|
-
### Local variables:
|
29
|
-
### mode: Ruby
|
30
|
-
### coding: utf-8-unix
|
31
|
-
### indent-tabs-mode: nil
|
32
|
-
### End:
|
@@ -1,20 +1,4 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
# Copyright (C) 2013 NEC Corporation
|
4
|
-
#
|
5
|
-
# This program is free software; you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License, version 3, as
|
7
|
-
# published by the Free Software Foundation.
|
8
|
-
#
|
9
|
-
# This program is distributed in the hope that it will be useful,
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
-
# GNU General Public License for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this program; if not, write to the Free Software Foundation, Inc.,
|
16
|
-
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
17
|
-
#
|
1
|
+
# encoding: utf-8
|
18
2
|
|
19
3
|
require 'paper_house/executable_task'
|
20
4
|
|
@@ -46,49 +30,38 @@ describe Rake::Task do
|
|
46
30
|
end
|
47
31
|
end
|
48
32
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
module PaperHouse
|
53
|
-
describe ExecutableTask, '.new' do
|
54
|
-
context 'with name :test' do
|
55
|
-
subject { ExecutableTask.new :test }
|
33
|
+
describe PaperHouse::ExecutableTask, '.new' do
|
34
|
+
context 'with name :test' do
|
35
|
+
subject { PaperHouse::ExecutableTask.new :test }
|
56
36
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
37
|
+
its(:cc) { should eq 'gcc' }
|
38
|
+
its(:cflags) { should be_empty }
|
39
|
+
its(:executable_name) { should eq 'test' }
|
40
|
+
its(:includes) { should be_empty }
|
41
|
+
its(:ldflags) { should be_empty }
|
42
|
+
its(:library_dependencies) { should be_empty }
|
43
|
+
its(:name) { should eq 'test' }
|
44
|
+
its(:sources) { should eq '*.c' }
|
45
|
+
its(:target_directory) { should eq '.' }
|
46
|
+
end
|
67
47
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
end
|
48
|
+
context 'with :test and block' do
|
49
|
+
subject do
|
50
|
+
PaperHouse::ExecutableTask.new(:test) do | task |
|
51
|
+
task.executable_name = executable_name
|
73
52
|
end
|
53
|
+
end
|
74
54
|
|
75
|
-
|
76
|
-
|
55
|
+
context %(with #executable_name = 'new_name') do
|
56
|
+
let(:executable_name) { 'new_name' }
|
77
57
|
|
78
|
-
|
79
|
-
|
58
|
+
its(:executable_name) { should eq 'new_name' }
|
59
|
+
end
|
80
60
|
|
81
|
-
|
82
|
-
|
61
|
+
context 'with #executable_name = :new_name' do
|
62
|
+
let(:executable_name) { :new_name }
|
83
63
|
|
84
|
-
|
85
|
-
end
|
64
|
+
its(:executable_name) { should eq :new_name }
|
86
65
|
end
|
87
66
|
end
|
88
67
|
end
|
89
|
-
|
90
|
-
### Local variables:
|
91
|
-
### mode: Ruby
|
92
|
-
### coding: utf-8-unix
|
93
|
-
### indent-tabs-mode: nil
|
94
|
-
### End:
|
@@ -1,20 +1,4 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
# Copyright (C) 2013 NEC Corporation
|
4
|
-
#
|
5
|
-
# This program is free software; you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License, version 3, as
|
7
|
-
# published by the Free Software Foundation.
|
8
|
-
#
|
9
|
-
# This program is distributed in the hope that it will be useful,
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
-
# GNU General Public License for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this program; if not, write to the Free Software Foundation, Inc.,
|
16
|
-
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
17
|
-
#
|
1
|
+
# encoding: utf-8
|
18
2
|
|
19
3
|
require 'paper_house/ruby_extension_task'
|
20
4
|
|
@@ -46,51 +30,46 @@ describe Rake::Task do
|
|
46
30
|
end
|
47
31
|
end
|
48
32
|
|
49
|
-
|
50
|
-
|
51
|
-
#
|
52
|
-
module PaperHouse
|
53
|
-
describe RubyExtensionTask, '.new :test' do
|
54
|
-
before { Rake::Task.clear }
|
33
|
+
describe PaperHouse::RubyExtensionTask do
|
34
|
+
before { Rake::Task.clear }
|
55
35
|
|
56
|
-
|
57
|
-
|
36
|
+
describe '.find_named' do
|
37
|
+
subject { PaperHouse::RubyExtensionTask.find_named name }
|
58
38
|
|
59
|
-
|
60
|
-
|
39
|
+
context 'with :test' do
|
40
|
+
let(:name) { :test }
|
61
41
|
|
62
|
-
|
63
|
-
|
42
|
+
context 'when RubyExtensionTask named :test is defined' do
|
43
|
+
before { PaperHouse::RubyExtensionTask.new :test }
|
64
44
|
|
65
|
-
|
66
|
-
|
45
|
+
it { expect(subject).to be_a PaperHouse::RubyExtensionTask }
|
46
|
+
end
|
67
47
|
|
68
|
-
|
69
|
-
|
70
|
-
end
|
48
|
+
context 'when RubyExtensionTask named :test is not defined' do
|
49
|
+
it { expect(subject).to be_nil }
|
71
50
|
end
|
51
|
+
end
|
72
52
|
|
73
|
-
|
74
|
-
|
53
|
+
context %(with 'test') do
|
54
|
+
let(:name) { 'test' }
|
75
55
|
|
76
|
-
|
77
|
-
|
56
|
+
context %(when RubyExtensionTask named 'test' is defined) do
|
57
|
+
before { PaperHouse::RubyExtensionTask.new :test }
|
78
58
|
|
79
|
-
|
80
|
-
end
|
59
|
+
it { expect(subject).to be_a PaperHouse::RubyExtensionTask }
|
81
60
|
end
|
61
|
+
end
|
82
62
|
|
83
|
-
|
84
|
-
|
63
|
+
context 'with :no_such_task' do
|
64
|
+
let(:name) { :no_such_task }
|
85
65
|
|
86
|
-
|
87
|
-
end
|
66
|
+
it { expect(subject).to be_nil }
|
88
67
|
end
|
89
68
|
end
|
90
69
|
|
91
70
|
describe '.new' do
|
92
71
|
context 'with :test' do
|
93
|
-
subject { RubyExtensionTask.new :test }
|
72
|
+
subject { PaperHouse::RubyExtensionTask.new :test }
|
94
73
|
|
95
74
|
its(:cc) { should eq 'gcc' }
|
96
75
|
its(:cflags) { should be_empty }
|
@@ -102,12 +81,12 @@ module PaperHouse
|
|
102
81
|
|
103
82
|
context 'with :test and block' do
|
104
83
|
subject do
|
105
|
-
RubyExtensionTask.new(:test) do | task |
|
84
|
+
PaperHouse::RubyExtensionTask.new(:test) do | task |
|
106
85
|
task.library_name = library_name
|
107
86
|
end
|
108
87
|
end
|
109
88
|
|
110
|
-
context %
|
89
|
+
context %(with #library_name = 'new_name') do
|
111
90
|
let(:library_name) { 'new_name' }
|
112
91
|
|
113
92
|
its(:library_name) { should eq 'new_name' }
|
@@ -121,9 +100,3 @@ module PaperHouse
|
|
121
100
|
end
|
122
101
|
end
|
123
102
|
end
|
124
|
-
|
125
|
-
### Local variables:
|
126
|
-
### mode: Ruby
|
127
|
-
### coding: utf-8-unix
|
128
|
-
### indent-tabs-mode: nil
|
129
|
-
### End:
|
@@ -1,20 +1,4 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
# Copyright (C) 2013 NEC Corporation
|
4
|
-
#
|
5
|
-
# This program is free software; you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License, version 3, as
|
7
|
-
# published by the Free Software Foundation.
|
8
|
-
#
|
9
|
-
# This program is distributed in the hope that it will be useful,
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
-
# GNU General Public License for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this program; if not, write to the Free Software Foundation, Inc.,
|
16
|
-
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
17
|
-
#
|
1
|
+
# encoding: utf-8
|
18
2
|
|
19
3
|
require 'paper_house/shared_library_task'
|
20
4
|
|
@@ -46,51 +30,46 @@ describe Rake::Task do
|
|
46
30
|
end
|
47
31
|
end
|
48
32
|
|
49
|
-
|
50
|
-
|
51
|
-
#
|
52
|
-
module PaperHouse
|
53
|
-
describe SharedLibraryTask do
|
54
|
-
before { Rake::Task.clear }
|
33
|
+
describe PaperHouse::SharedLibraryTask do
|
34
|
+
before { Rake::Task.clear }
|
55
35
|
|
56
|
-
|
57
|
-
|
36
|
+
describe '.find_named' do
|
37
|
+
subject { PaperHouse::SharedLibraryTask.find_named name }
|
58
38
|
|
59
|
-
|
60
|
-
|
39
|
+
context 'with :libtest' do
|
40
|
+
let(:name) { :libtest }
|
61
41
|
|
62
|
-
|
63
|
-
|
42
|
+
context 'when SharedLibraryTask named :libtest is defined' do
|
43
|
+
before { PaperHouse::SharedLibraryTask.new :libtest, '0.1.0' }
|
64
44
|
|
65
|
-
|
66
|
-
|
45
|
+
it { expect(subject).to be_a PaperHouse::SharedLibraryTask }
|
46
|
+
end
|
67
47
|
|
68
|
-
|
69
|
-
|
70
|
-
end
|
48
|
+
context 'when SharedLibraryTask named :libtest is not defined' do
|
49
|
+
it { expect(subject).to be_nil }
|
71
50
|
end
|
51
|
+
end
|
72
52
|
|
73
|
-
|
74
|
-
|
53
|
+
context %(with 'libtest') do
|
54
|
+
let(:name) { 'libtest' }
|
75
55
|
|
76
|
-
|
77
|
-
|
56
|
+
context %(when SharedLibraryTask named 'libtest' is defined) do
|
57
|
+
before { PaperHouse::SharedLibraryTask.new :libtest, '0.1.0' }
|
78
58
|
|
79
|
-
|
80
|
-
end
|
59
|
+
it { expect(subject).to be_a PaperHouse::SharedLibraryTask }
|
81
60
|
end
|
61
|
+
end
|
82
62
|
|
83
|
-
|
84
|
-
|
63
|
+
context 'with :no_such_task' do
|
64
|
+
let(:name) { :no_such_task }
|
85
65
|
|
86
|
-
|
87
|
-
end
|
66
|
+
it { expect(subject).to be_nil }
|
88
67
|
end
|
89
68
|
end
|
90
69
|
|
91
70
|
describe '.new' do
|
92
|
-
context %
|
93
|
-
subject { SharedLibraryTask.new :libtest, '0.1.0' }
|
71
|
+
context %(with name :libtest and version '0.1.0') do
|
72
|
+
subject { PaperHouse::SharedLibraryTask.new :libtest, '0.1.0' }
|
94
73
|
|
95
74
|
its(:cc) { should eq 'gcc' }
|
96
75
|
its(:cflags) { should be_empty }
|
@@ -107,7 +86,7 @@ module PaperHouse
|
|
107
86
|
end
|
108
87
|
|
109
88
|
context 'with name :libtest and no version string' do
|
110
|
-
subject { SharedLibraryTask.new :libtest }
|
89
|
+
subject { PaperHouse::SharedLibraryTask.new :libtest }
|
111
90
|
|
112
91
|
it do
|
113
92
|
expect { subject }.to raise_error('version option is a mandatory.')
|
@@ -116,16 +95,16 @@ module PaperHouse
|
|
116
95
|
|
117
96
|
context 'with name :libtest and block' do
|
118
97
|
subject do
|
119
|
-
SharedLibraryTask.new(:libtest) do | task |
|
98
|
+
PaperHouse::SharedLibraryTask.new(:libtest) do | task |
|
120
99
|
task.library_name = library_name
|
121
100
|
task.version = version
|
122
101
|
end
|
123
102
|
end
|
124
103
|
|
125
|
-
context %
|
104
|
+
context %(with #version = '0.1.0') do
|
126
105
|
let(:version) { '0.1.0' }
|
127
106
|
|
128
|
-
context %
|
107
|
+
context %(with #library_name = 'libtest') do
|
129
108
|
let(:library_name) { 'libtest' }
|
130
109
|
|
131
110
|
its(:library_name) { should eq 'libtest' }
|
@@ -137,7 +116,7 @@ module PaperHouse
|
|
137
116
|
its(:library_name) { should eq 'libtest' }
|
138
117
|
end
|
139
118
|
|
140
|
-
context %
|
119
|
+
context %(with #library_name = 'test') do
|
141
120
|
let(:library_name) { 'test' }
|
142
121
|
|
143
122
|
its(:library_name) { should eq 'libtest' }
|
@@ -161,9 +140,3 @@ module PaperHouse
|
|
161
140
|
end
|
162
141
|
end
|
163
142
|
end
|
164
|
-
|
165
|
-
### Local variables:
|
166
|
-
### mode: Ruby
|
167
|
-
### coding: utf-8-unix
|
168
|
-
### indent-tabs-mode: nil
|
169
|
-
### End:
|
@@ -1,24 +1,8 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
# Copyright (C) 2013 NEC Corporation
|
4
|
-
#
|
5
|
-
# This program is free software; you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General Public License, version 3, as
|
7
|
-
# published by the Free Software Foundation.
|
8
|
-
#
|
9
|
-
# This program is distributed in the hope that it will be useful,
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
-
# GNU General Public License for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License along
|
15
|
-
# with this program; if not, write to the Free Software Foundation, Inc.,
|
16
|
-
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
17
|
-
#
|
1
|
+
# encoding: utf-8
|
18
2
|
|
19
3
|
require 'paper_house/static_library_task'
|
20
4
|
|
21
|
-
describe
|
5
|
+
describe Rake::Task do
|
22
6
|
before { Rake::Task.clear }
|
23
7
|
|
24
8
|
describe '.[]' do
|
@@ -46,70 +30,59 @@ describe 'Rake::Task' do
|
|
46
30
|
end
|
47
31
|
end
|
48
32
|
|
49
|
-
|
50
|
-
|
51
|
-
#
|
52
|
-
module PaperHouse
|
53
|
-
describe StaticLibraryTask do
|
54
|
-
before { Rake::Task.clear }
|
33
|
+
describe PaperHouse::StaticLibraryTask do
|
34
|
+
before { Rake::Task.clear }
|
55
35
|
|
56
|
-
|
57
|
-
|
36
|
+
describe '.find_named' do
|
37
|
+
subject { PaperHouse::StaticLibraryTask.find_named name }
|
58
38
|
|
59
|
-
|
60
|
-
|
39
|
+
context 'with :libtest' do
|
40
|
+
let(:name) { :libtest }
|
61
41
|
|
62
|
-
|
63
|
-
|
42
|
+
context 'when StaticLibraryTask named :libtest is defined' do
|
43
|
+
before { PaperHouse::StaticLibraryTask.new :libtest }
|
64
44
|
|
65
|
-
|
66
|
-
|
45
|
+
it { expect(subject).to be_a PaperHouse::StaticLibraryTask }
|
46
|
+
end
|
67
47
|
|
68
|
-
|
69
|
-
|
70
|
-
end
|
48
|
+
context 'when StaticLibraryTask named :libtest is not defined' do
|
49
|
+
it { expect(subject).to be_nil }
|
71
50
|
end
|
51
|
+
end
|
72
52
|
|
73
|
-
|
74
|
-
|
53
|
+
context %(with 'libtest') do
|
54
|
+
let(:name) { 'libtest' }
|
75
55
|
|
76
|
-
|
77
|
-
|
56
|
+
context 'when StaticLibraryTask named :libtest is defined' do
|
57
|
+
before { PaperHouse::StaticLibraryTask.new :libtest }
|
78
58
|
|
79
|
-
|
80
|
-
end
|
59
|
+
it { expect(subject).to be_a PaperHouse::StaticLibraryTask }
|
81
60
|
end
|
61
|
+
end
|
82
62
|
|
83
|
-
|
84
|
-
|
63
|
+
context 'with :no_such_task' do
|
64
|
+
let(:name) { :no_such_task }
|
85
65
|
|
86
|
-
|
87
|
-
end
|
66
|
+
it { expect(subject).to be_nil }
|
88
67
|
end
|
68
|
+
end
|
89
69
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
end
|
70
|
+
describe '.new' do
|
71
|
+
subject { PaperHouse::StaticLibraryTask.new task }
|
72
|
+
|
73
|
+
context 'with :libtest' do
|
74
|
+
let(:task) { :libtest }
|
75
|
+
|
76
|
+
its(:cc) { should eq 'gcc' }
|
77
|
+
its(:cflags) { should be_empty }
|
78
|
+
its(:includes) { should be_empty }
|
79
|
+
its(:name) { should eq 'libtest' }
|
80
|
+
its(:sources) { should eq '*.c' }
|
81
|
+
its(:target_directory) { should eq '.' }
|
82
|
+
its(:library_name) { should eq 'libtest' }
|
83
|
+
its(:lname) { should eq 'test' }
|
84
|
+
its(:target_file_name) { should eq 'libtest.a' }
|
85
|
+
its(:target_path) { should eq './libtest.a' }
|
107
86
|
end
|
108
87
|
end
|
109
88
|
end
|
110
|
-
|
111
|
-
### Local variables:
|
112
|
-
### mode: Ruby
|
113
|
-
### coding: utf-8-unix
|
114
|
-
### indent-tabs-mode: nil
|
115
|
-
### End:
|