cxxproject 0.6.25 → 0.6.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +1 -0
- data/Gemfile.lock +4 -2
- data/Rakefile.rb +1 -1
- data/junit.rb +91 -0
- data/lib/cxxproject/buildingblocks/building_block.rb +6 -4
- data/lib/cxxproject/buildingblocks/building_blocks.rb +19 -0
- data/lib/cxxproject/version.rb +1 -1
- data/lib/{cxxproject/cxxproject.rb → cxxproject.rb} +1 -1
- data/rake_helper/spec.rb +1 -0
- data/spec/building_block_spec.rb +21 -1
- data/spec/{project_path_spec.rb → project_path_spe.rb} +0 -1
- metadata +10 -8
- /data/{cxx.gemspec → cxxproject.gemspec} +0 -0
- /data/spec/{cxxproject_2_rake_spec.rb → cxxproject_2_rake_spe.rb} +0 -0
- /data/spec/{object_dependency_spec.rb → object_dependency_spe.rb} +0 -0
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
+
builder (3.0.0)
|
4
5
|
diff-lcs (1.1.3)
|
5
6
|
grit (2.5.0)
|
6
7
|
diff-lcs (~> 1.1)
|
@@ -14,8 +15,8 @@ GEM
|
|
14
15
|
rspec-core (~> 2.11.0)
|
15
16
|
rspec-expectations (~> 2.11.0)
|
16
17
|
rspec-mocks (~> 2.11.0)
|
17
|
-
rspec-core (2.11.
|
18
|
-
rspec-expectations (2.11.
|
18
|
+
rspec-core (2.11.1)
|
19
|
+
rspec-expectations (2.11.2)
|
19
20
|
diff-lcs (~> 1.1.3)
|
20
21
|
rspec-mocks (2.11.1)
|
21
22
|
ruby_parser (2.3.1)
|
@@ -26,6 +27,7 @@ PLATFORMS
|
|
26
27
|
ruby
|
27
28
|
|
28
29
|
DEPENDENCIES
|
30
|
+
builder
|
29
31
|
grit
|
30
32
|
roodi
|
31
33
|
rspec
|
data/Rakefile.rb
CHANGED
data/junit.rb
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
Copyright (c) 2012, Nathaniel Ritmeyer
|
4
|
+
All rights reserved.
|
5
|
+
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
8
|
+
|
9
|
+
1. Redistributions of source code must retain the above copyright notice,
|
10
|
+
this list of conditions and the following disclaimer.
|
11
|
+
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright
|
13
|
+
notice, this list of conditions and the following disclaimer in the
|
14
|
+
documentation and/or other materials provided with the distribution.
|
15
|
+
|
16
|
+
3. Neither the name Nathaniel Ritmeyer nor the names of contributors to
|
17
|
+
this software may be used to endorse or promote products derived from this
|
18
|
+
software without specific prior written permission.
|
19
|
+
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
|
21
|
+
IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
22
|
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
23
|
+
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
|
24
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
25
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
26
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
27
|
+
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
28
|
+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
29
|
+
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
30
|
+
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
31
|
+
|
32
|
+
=end
|
33
|
+
|
34
|
+
require 'time'
|
35
|
+
require 'builder'
|
36
|
+
require 'rspec/core/formatters/base_formatter'
|
37
|
+
|
38
|
+
class JUnit < RSpec::Core::Formatters::BaseFormatter
|
39
|
+
def initialize output
|
40
|
+
super output
|
41
|
+
@test_results = []
|
42
|
+
end
|
43
|
+
|
44
|
+
def example_passed example
|
45
|
+
@test_results << example
|
46
|
+
end
|
47
|
+
|
48
|
+
def example_failed example
|
49
|
+
@test_results << example
|
50
|
+
end
|
51
|
+
|
52
|
+
def example_pending example
|
53
|
+
@test_results << example
|
54
|
+
end
|
55
|
+
|
56
|
+
def failure_details_for example
|
57
|
+
exception = example.metadata[:execution_result][:exception]
|
58
|
+
exception.nil? ? "" : "#{exception.message}\n#{format_backtrace(exception.backtrace, example).join("\n")}"
|
59
|
+
end
|
60
|
+
|
61
|
+
def full_name_for example
|
62
|
+
test_name = ""
|
63
|
+
current_example_group = example.metadata[:example_group]
|
64
|
+
until current_example_group.nil? do
|
65
|
+
test_name = "#{current_example_group[:description]}." + test_name
|
66
|
+
current_example_group = current_example_group[:example_group]
|
67
|
+
end
|
68
|
+
test_name << example.metadata[:description]
|
69
|
+
end
|
70
|
+
|
71
|
+
def dump_summary duration, example_count, failure_count, pending_count
|
72
|
+
builder = Builder::XmlMarkup.new :indent => 2
|
73
|
+
builder.instruct! :xml, :version => "1.0", :encoding => "UTF-8"
|
74
|
+
builder.testsuite :errors => 0, :failures => failure_count, :skipped => pending_count, :tests => example_count, :time => duration, :timestamp => Time.now.iso8601 do
|
75
|
+
builder.properties
|
76
|
+
@test_results.each do |test|
|
77
|
+
builder.testcase :classname => full_name_for(test), :name => test.metadata[:full_description], :time => test.metadata[:execution_result][:run_time] do
|
78
|
+
case test.metadata[:execution_result][:status]
|
79
|
+
when "failed"
|
80
|
+
builder.failure :message => "failed #{test.metadata[:full_description]}", :type => "failed" do
|
81
|
+
builder.cdata! failure_details_for test
|
82
|
+
end
|
83
|
+
when "pending" then builder.skipped
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
output.puts builder.target!
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
@@ -99,11 +99,13 @@ module Cxxproject
|
|
99
99
|
@printedCmdAlternate = false
|
100
100
|
@lastCommand = nil
|
101
101
|
|
102
|
-
if ALL_BUILDING_BLOCKS.include?(@name)
|
103
|
-
|
104
|
-
|
105
|
-
|
102
|
+
if ALL_BUILDING_BLOCKS.include?(@name)
|
103
|
+
existing_bb = ALL_BUILDING_BLOCKS[@name]
|
104
|
+
if not (existing_bb.class == BinaryLibrary && self.class == BinaryLibrary)
|
105
|
+
raise "building block already exists: #{name} of type #{ALL_BUILDING_BLOCKS[@name].class} conflicts with #{self.class}"
|
106
|
+
end
|
106
107
|
end
|
108
|
+
ALL_BUILDING_BLOCKS[@name] = self
|
107
109
|
end
|
108
110
|
|
109
111
|
def set_config_name(x)
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'cxxproject/buildingblocks/binary_library'
|
2
|
+
require 'cxxproject/buildingblocks/building_block'
|
3
|
+
require 'cxxproject/buildingblocks/executable'
|
4
|
+
require 'cxxproject/buildingblocks/source_library'
|
5
|
+
require 'cxxproject/buildingblocks/module'
|
6
|
+
require 'cxxproject/buildingblocks/custom_building_block'
|
7
|
+
=begin
|
8
|
+
-rw-rw-r-- 2 ckoestlin ckoestlin 2027 Jul 10 15:12 command_line.rb
|
9
|
+
-rw-rw-r-- 2 ckoestlin ckoestlin 688 Jul 10 15:12 custom_building_block.rb
|
10
|
+
-rw-rw-r-- 2 ckoestlin ckoestlin 7241 Jul 18 11:51 executable.rb
|
11
|
+
-rw-rw-r-- 2 ckoestlin ckoestlin 2047 Jul 10 15:12 has_dependencies_mixin.rb
|
12
|
+
-rw-rw-r-- 2 ckoestlin ckoestlin 297 Jul 10 15:12 has_includes_mixin.rb
|
13
|
+
-rw-rw-r-- 2 ckoestlin ckoestlin 792 Jul 10 15:12 has_libraries_mixin.rb
|
14
|
+
-rw-rw-r-- 2 ckoestlin ckoestlin 10084 Jul 18 12:24 has_sources_mixin.rb
|
15
|
+
-rw-rw-r-- 2 ckoestlin ckoestlin 4034 Jul 10 15:12 makefile.rb
|
16
|
+
-rw-rw-r-- 2 ckoestlin ckoestlin 775 Jul 10 15:12 module.rb
|
17
|
+
-rw-rw-r-- 2 ckoestlin ckoestlin 811 Jul 10 15:12 single_source.rb
|
18
|
+
-rw-rw-r-- 2 ckoestlin ckoestlin 3582 Jul 18 12:23 source_library.rb
|
19
|
+
=end
|
data/lib/cxxproject/version.rb
CHANGED
@@ -3,7 +3,6 @@ require 'rubygems'
|
|
3
3
|
require 'yaml'
|
4
4
|
require 'rake/clean'
|
5
5
|
|
6
|
-
|
7
6
|
require 'cxxproject/ext/string'
|
8
7
|
require 'cxxproject/ext/hash'
|
9
8
|
|
@@ -15,6 +14,7 @@ require 'cxxproject/toolchain/provider'
|
|
15
14
|
require 'cxxproject/version'
|
16
15
|
|
17
16
|
require 'cxxproject/plugin_context'
|
17
|
+
require 'cxxproject/buildingblocks/building_blocks'
|
18
18
|
|
19
19
|
require 'frazzle/frazzle'
|
20
20
|
registry = Frazzle::Registry.new('cxxproject', '_', '')
|
data/rake_helper/spec.rb
CHANGED
data/spec/building_block_spec.rb
CHANGED
@@ -32,6 +32,26 @@ describe Cxxproject::BuildingBlock do
|
|
32
32
|
deps.should == ['4', '2', '3', '1']
|
33
33
|
end
|
34
34
|
|
35
|
+
it 'should generate an error if building block names conflict' do
|
36
|
+
expect {
|
37
|
+
Cxxproject::SourceLibrary.new('1')
|
38
|
+
Cxxproject::SourceLibrary.new('1')
|
39
|
+
}.should raise_exception
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'should be possible to give several binary libs with the same name' do
|
43
|
+
Cxxproject::BinaryLibrary.new('1')
|
44
|
+
Cxxproject::BinaryLibrary.new('1')
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'should be an error if the same name is used for different kinds of building blocks' do
|
48
|
+
expect {
|
49
|
+
Cxxproject::BinaryLibrary.new('1')
|
50
|
+
Cxxproject::SourceLibrary.new('1')
|
51
|
+
}.should raise_exception
|
52
|
+
end
|
53
|
+
|
54
|
+
=begin
|
35
55
|
it 'should have the right output-directory' do
|
36
56
|
lib1 = Cxxproject::SourceLibrary.new('lib1').set_sources(['test.cc'])
|
37
57
|
lib1.set_project_dir(File.join(Dir.pwd, 'lib1'))
|
@@ -54,5 +74,5 @@ describe Cxxproject::BuildingBlock do
|
|
54
74
|
cxx = CxxProject2Rake.new([], 'build', compiler)
|
55
75
|
end.to raise_exception(RuntimeError, 'Error: while reading config file for 1: dependent building block "unresolved" was specified but not found!')
|
56
76
|
end
|
57
|
-
|
77
|
+
=end
|
58
78
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cxxproject
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.26
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-09-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: colored
|
@@ -58,7 +58,7 @@ files:
|
|
58
58
|
- LICENSE
|
59
59
|
- README.md
|
60
60
|
- Rakefile.rb
|
61
|
-
-
|
61
|
+
- cxxproject.gemspec
|
62
62
|
- example/.gitignore
|
63
63
|
- example/Rakefile.rb
|
64
64
|
- example/big_project/.gitignore
|
@@ -109,8 +109,11 @@ files:
|
|
109
109
|
- example/three_tests/suite2/project.rb
|
110
110
|
- example/three_tests/suite2/suite2.cpp
|
111
111
|
- example/three_tests/suite2/suite2.h
|
112
|
+
- junit.rb
|
113
|
+
- lib/cxxproject.rb
|
112
114
|
- lib/cxxproject/buildingblocks/binary_library.rb
|
113
115
|
- lib/cxxproject/buildingblocks/building_block.rb
|
116
|
+
- lib/cxxproject/buildingblocks/building_blocks.rb
|
114
117
|
- lib/cxxproject/buildingblocks/command_line.rb
|
115
118
|
- lib/cxxproject/buildingblocks/custom_building_block.rb
|
116
119
|
- lib/cxxproject/buildingblocks/executable.rb
|
@@ -123,7 +126,6 @@ files:
|
|
123
126
|
- lib/cxxproject/buildingblocks/single_source.rb
|
124
127
|
- lib/cxxproject/buildingblocks/source_library.rb
|
125
128
|
- lib/cxxproject/context.rb
|
126
|
-
- lib/cxxproject/cxxproject.rb
|
127
129
|
- lib/cxxproject/errorparser/error_parser.rb
|
128
130
|
- lib/cxxproject/ext/file.rb
|
129
131
|
- lib/cxxproject/ext/filelist.rb
|
@@ -166,12 +168,12 @@ files:
|
|
166
168
|
- rake_helper/spec.rb
|
167
169
|
- roodi.yml
|
168
170
|
- spec/building_block_spec.rb
|
169
|
-
- spec/
|
171
|
+
- spec/cxxproject_2_rake_spe.rb
|
170
172
|
- spec/file_ext_spec.rb
|
171
173
|
- spec/ide_interface_spec.rb
|
172
|
-
- spec/
|
174
|
+
- spec/object_dependency_spe.rb
|
173
175
|
- spec/plugin_context_spec.rb
|
174
|
-
- spec/
|
176
|
+
- spec/project_path_spe.rb
|
175
177
|
- spec/provider_spec.rb
|
176
178
|
- spec/rake_listener_ext_spec.rb
|
177
179
|
- spec/spec_helper.rb
|
@@ -218,7 +220,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
218
220
|
version: '0'
|
219
221
|
segments:
|
220
222
|
- 0
|
221
|
-
hash:
|
223
|
+
hash: -4608833184588443303
|
222
224
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
223
225
|
none: false
|
224
226
|
requirements:
|
File without changes
|
File without changes
|
File without changes
|