cxxproject 0.6.29 → 0.6.30
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +195 -65
- data/lib/cxxproject/buildingblocks/building_block.rb +1 -1
- data/lib/cxxproject/buildingblocks/executable.rb +3 -0
- data/lib/cxxproject/buildingblocks/has_dependencies_mixin.rb +5 -5
- data/lib/cxxproject/buildingblocks/has_sources_mixin.rb +30 -16
- data/lib/cxxproject/buildingblocks/single_source.rb +0 -1
- data/lib/cxxproject/ext/rake_listener.rb +11 -13
- data/lib/cxxproject/plugin_context.rb +6 -4
- data/lib/cxxproject/toolchain/colorizing_formatter.rb +8 -5
- data/lib/cxxproject/utils/printer.rb +6 -6
- data/lib/cxxproject/version.rb +1 -1
- data/lib/cxxproject.rb +0 -1
- metadata +37 -145
- data/.gitignore +0 -18
- data/.rvmrc +0 -1
- data/Gemfile +0 -6
- data/Gemfile.lock +0 -35
- data/Rakefile.rb +0 -125
- data/cxxproject.gemspec +0 -22
- data/example/.gitignore +0 -1
- data/example/Rakefile.rb +0 -35
- data/example/big_project/.gitignore +0 -2
- data/example/big_project/Rakefile_generator.rb +0 -80
- data/example/big_project/fak.h +0 -9
- data/example/custom/.gitignore +0 -1
- data/example/custom/Rakefile.rb +0 -12
- data/example/custom/foo.cpp +0 -5
- data/example/custom/project.rb +0 -27
- data/example/dependency_tests/Rakefile.rb +0 -3
- data/example/dependency_tests/help1.h +0 -12
- data/example/dependency_tests/help2.h +0 -10
- data/example/dependency_tests/main.cpp +0 -6
- data/example/dependency_tests/project.rb +0 -3
- data/example/generator/Rakefile.rb +0 -12
- data/example/generator/main/main.cpp +0 -3
- data/example/generator/main/project/project.rb +0 -3
- data/example/oneFileOnly/Rakefile.rb +0 -3
- data/example/oneFileOnly/config.h +0 -2
- data/example/oneFileOnly/main.cpp +0 -8
- data/example/oneFileOnly/project_compile.rb +0 -3
- data/example/protobuf/.gitignore +0 -4
- data/example/protobuf/Rakefile.rb +0 -70
- data/example/protobuf/addressbook/addressbook.proto +0 -24
- data/example/protobuf/addressbook/addressbook_read.cc +0 -67
- data/example/protobuf/addressbook/addressbook_write.cc +0 -93
- data/example/protobuf/addressbook/project.rb +0 -16
- data/example/protobuf/protobuf.files +0 -37
- data/example/protobuf/protobuf_project.rb +0 -9
- data/example/simpleUnitTest/Rakefile.rb +0 -4
- data/example/simpleUnitTest/atest.cpp +0 -16
- data/example/simpleUnitTest/atest.h +0 -11
- data/example/simpleUnitTest/project.rb +0 -5
- data/example/simpleUnitTest/test.cpp +0 -13
- data/example/strange_dirs/Rakefile.rb +0 -4
- data/example/strange_dirs/lazyLib/project.rb +0 -5
- data/example/strange_dirs/main/main.cpp +0 -5
- data/example/strange_dirs/main/project.rb +0 -5
- data/example/strange_dirs/src/test.cpp +0 -4
- data/example/test.rb +0 -10
- data/example/three_tests/Rakefile.rb +0 -5
- data/example/three_tests/allsuites/project.rb +0 -4
- data/example/three_tests/main/main.cpp +0 -13
- data/example/three_tests/main/project.rb +0 -5
- data/example/three_tests/suite1/project.rb +0 -6
- data/example/three_tests/suite1/suite1.cpp +0 -3
- data/example/three_tests/suite1/suite1.h +0 -28
- data/example/three_tests/suite2/project.rb +0 -6
- data/example/three_tests/suite2/suite2.cpp +0 -3
- data/example/three_tests/suite2/suite2.h +0 -29
- data/junit.rb +0 -91
- data/lib/cxxproject/ext/string.rb +0 -9
- data/plugins/tmp/.rvmrc +0 -1
- data/plugins/tmp/BuildDir/objects/testme/test.o +0 -0
- data/plugins/tmp/BuildDir/objects/testme/test.o.d +0 -1
- data/plugins/tmp/BuildDir/testme.exe +0 -0
- data/plugins/tmp/Rakefile.rb +0 -6
- data/plugins/tmp/project.rb +0 -6
- data/plugins/tmp/reinstall/Rakefile.rb +0 -15
- data/plugins/tmp/test.cpp +0 -7
- data/rake_helper/perftools.rb +0 -34
- data/rake_helper/spec.rb +0 -65
- data/roodi.yml +0 -8
- data/spec/building_block_spec.rb +0 -103
- data/spec/file_ext_spec.rb +0 -30
- data/spec/ide_interface_spec.rb +0 -41
- data/spec/plugin_context_spec.rb +0 -57
- data/spec/provider_spec.rb +0 -39
- data/spec/rake_listener_ext_spec.rb +0 -58
- data/spec/spec_helper.rb +0 -18
- data/spec/string_spec.rb +0 -11
- data/spec/testdata/basic/exe12/help.cpp +0 -5
- data/spec/testdata/basic/exe12/help.h +0 -6
- data/spec/testdata/basic/exe12/main.cpp +0 -10
- data/spec/testdata/basic/exe12/project.rb +0 -5
- data/spec/testdata/basic/lib1/lib1.cpp +0 -7
- data/spec/testdata/basic/lib1/lib1.h +0 -8
- data/spec/testdata/basic/lib1/project.rb +0 -5
- data/spec/testdata/basic/lib2/lib2.cpp +0 -17
- data/spec/testdata/basic/lib2/lib2.h +0 -6
- data/spec/testdata/basic/lib2/project.rb +0 -8
- data/spec/testdata/multiple_levels/libs/lib1/lib1.cpp +0 -7
- data/spec/testdata/multiple_levels/libs/lib1/lib1.h +0 -8
- data/spec/testdata/multiple_levels/libs/lib1/project.rb +0 -5
- data/spec/testdata/multiple_levels/libs/lib2/lib2.cpp +0 -21
- data/spec/testdata/multiple_levels/libs/lib2/lib2.h +0 -6
- data/spec/testdata/multiple_levels/libs/lib2/project.rb +0 -19
- data/spec/testdata/multiple_levels/mainproject/basic/help.cpp +0 -5
- data/spec/testdata/multiple_levels/mainproject/basic/help.h +0 -6
- data/spec/testdata/multiple_levels/mainproject/basic/main.cpp +0 -10
- data/spec/testdata/multiple_levels/mainproject/basic/project.rb +0 -8
- data/spec/testdata/onlyOneHeader/.gitignore +0 -1
- data/spec/testdata/onlyOneHeader/Rakefile.rb +0 -4
- data/spec/testdata/onlyOneHeader/help.cpp +0 -5
- data/spec/testdata/onlyOneHeader/help.h +0 -7
- data/spec/testdata/onlyOneHeader/main.cpp +0 -8
- data/spec/testdata/onlyOneHeader/project.rb +0 -4
- data/spec/testdata/onlyOneHeader/testin.c +0 -0
- data/spec/toolchain_spec.rb +0 -29
@@ -1,58 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'cxxproject'
|
3
|
-
require 'cxxproject/ext/rake_listener.rb'
|
4
|
-
require 'cxxproject/utils/cleanup'
|
5
|
-
|
6
|
-
describe Rake::Task do
|
7
|
-
|
8
|
-
before(:each) do
|
9
|
-
Cxxproject::Utils.cleanup_rake
|
10
|
-
end
|
11
|
-
after(:each) do
|
12
|
-
Cxxproject::Utils.cleanup_rake
|
13
|
-
end
|
14
|
-
|
15
|
-
|
16
|
-
it "should call a listener for prerequisites and execute" do
|
17
|
-
task "mypre"
|
18
|
-
t = task "test" => "mypre"
|
19
|
-
|
20
|
-
l = mock
|
21
|
-
Rake::add_listener(l)
|
22
|
-
|
23
|
-
l.should_receive(:before_execute).with('mypre')
|
24
|
-
l.should_receive(:after_execute).with('mypre')
|
25
|
-
l.should_receive(:before_prerequisites).with('mypre')
|
26
|
-
l.should_receive(:after_prerequisites).with('mypre')
|
27
|
-
l.should_receive(:before_prerequisites).with('test')
|
28
|
-
l.should_receive(:after_prerequisites).with('test')
|
29
|
-
l.should_receive(:before_execute).with('test')
|
30
|
-
l.should_receive(:after_execute).with('test')
|
31
|
-
t.invoke
|
32
|
-
|
33
|
-
Rake::remove_listener(l)
|
34
|
-
|
35
|
-
t.invoke
|
36
|
-
end
|
37
|
-
|
38
|
-
class DummyListener
|
39
|
-
def calls
|
40
|
-
@calls ||= []
|
41
|
-
end
|
42
|
-
def after_execute(name)
|
43
|
-
c = calls
|
44
|
-
c << name
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
it "should work with only half implemented rake-listener" do
|
49
|
-
task "mypre"
|
50
|
-
t = task "test" => "mypre"
|
51
|
-
l = DummyListener.new
|
52
|
-
Rake::add_listener(l)
|
53
|
-
t.invoke
|
54
|
-
Rake::remove_listener(l)
|
55
|
-
l.calls.should eq(['mypre', 'test'])
|
56
|
-
end
|
57
|
-
|
58
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
$:.unshift File.join(File.dirname(__FILE__),"..","lib")
|
2
|
-
|
3
|
-
require 'cxxproject/utils/optional'
|
4
|
-
initialize_simplecov = lambda do
|
5
|
-
require 'simplecov'
|
6
|
-
if ENV['COVERAGE']
|
7
|
-
SimpleCov.start do
|
8
|
-
add_group 'buildingblocks', 'lib/cxxproject/buildingblocks'
|
9
|
-
add_group 'utils', 'lib/cxxproject/utils'
|
10
|
-
add_group 'errorparser', 'lib/cxxproject/errorparser'
|
11
|
-
add_group 'toolchain', 'lib/cxxproject/toolchain'
|
12
|
-
add_group 'ext', 'lib/cxxproject/ext'
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
Cxxproject::Utils::optional_package(initialize_simplecov, nil)
|
17
|
-
|
18
|
-
RakeFileUtils.send(:verbose, false)
|
data/spec/string_spec.rb
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
require 'cxxproject'
|
2
|
-
|
3
|
-
describe String do
|
4
|
-
it 'should remove from start if matching' do
|
5
|
-
s = "abcd"
|
6
|
-
s.remove_from_start('abc').should == 'd'
|
7
|
-
end
|
8
|
-
it 'should not change the string if the start does not match' do
|
9
|
-
"abcd".remove_from_start('z').should == 'abcd'
|
10
|
-
end
|
11
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
#include "lib2.h"
|
2
|
-
|
3
|
-
#include <iostream>
|
4
|
-
#include <math.h>
|
5
|
-
#include "lib1.h"
|
6
|
-
#include <dlfcn.h>
|
7
|
-
#include <zlib.h>
|
8
|
-
|
9
|
-
void lib2() {
|
10
|
-
std::cout << "lib2" << std::endl;
|
11
|
-
lib1();
|
12
|
-
std::cout << sin(5) << std::endl;
|
13
|
-
void* help = dlopen("test", RTLD_LAZY);
|
14
|
-
std::cout << (long)help << std::endl;
|
15
|
-
Bytef b = 0;
|
16
|
-
uLong res = crc32(0, &b, 1);
|
17
|
-
}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
#include "lib2.h"
|
2
|
-
|
3
|
-
#include <iostream>
|
4
|
-
#include <math.h>
|
5
|
-
#include "lib1.h"
|
6
|
-
#include <dlfcn.h>
|
7
|
-
#include <zlib.h>
|
8
|
-
|
9
|
-
void lib2() {
|
10
|
-
#ifdef UNIT_TEST
|
11
|
-
std::cout << "lib2 for UNIT_TEST defined" << std::endl;
|
12
|
-
#else
|
13
|
-
std::cout << "lib2" << std::endl;
|
14
|
-
#endif
|
15
|
-
lib1();
|
16
|
-
std::cout << sin(5) << std::endl;
|
17
|
-
void* help = dlopen("test", RTLD_LAZY);
|
18
|
-
std::cout << (long)help << std::endl;
|
19
|
-
Bytef b = 0;
|
20
|
-
uLong res = crc32(0, &b, 1);
|
21
|
-
}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
cxx_configuration do
|
2
|
-
deps = ['1', BinaryLibrary.new('z')]
|
3
|
-
deps << BinaryLibrary.new('dl') if Utils::OS.linux?
|
4
|
-
|
5
|
-
source_lib "2",
|
6
|
-
:sources => FileList['**/*.cpp'],
|
7
|
-
:dependencies => deps,
|
8
|
-
:includes => ['.']
|
9
|
-
|
10
|
-
|
11
|
-
unittest_flags = {
|
12
|
-
:DEFINES => ['UNIT_TEST','CPPUNIT_MAIN="main"']
|
13
|
-
}
|
14
|
-
source_lib "2_debug",
|
15
|
-
:sources => FileList['**/*.cpp'],
|
16
|
-
:dependencies => deps,
|
17
|
-
:includes => ['.'],
|
18
|
-
:toolchain => Provider.modify_cpp_compiler("gcc", unittest_flags)
|
19
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
output
|
File without changes
|
data/spec/toolchain_spec.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
GCC_JSON = File.join(File.dirname(__FILE__),"..","lib","cxxproject","toolchain","gcc.json")
|
2
|
-
require 'cxxproject/toolchain/toolchain'
|
3
|
-
|
4
|
-
# describe String do
|
5
|
-
# it 'should correctly load toolchain from json file' do
|
6
|
-
# tc = Toolchain.new(GCC_JSON)
|
7
|
-
# tc.name.should == "gcc"
|
8
|
-
# tc.compiler.cpp.command.should == "g++"
|
9
|
-
# tc.compiler.c.source_file_endings.should == [".c"]
|
10
|
-
# tc.linker.output_ending == ".exe"
|
11
|
-
# end
|
12
|
-
#
|
13
|
-
# it 'should be possible to add list items to existing settings' do
|
14
|
-
# tc = Toolchain.new(GCC_JSON)
|
15
|
-
# tc.compiler.c.source_file_endings.should == [".c"]
|
16
|
-
# tc.compiler.c.source_file_endings << ".cc"
|
17
|
-
# tc.compiler.c.source_file_endings.should == [".c",".cc"]
|
18
|
-
# tc.compiler.c.source_file_endings << ".aa"
|
19
|
-
# tc.compiler.c.source_file_endings.should == [".c",".cc",".aa"]
|
20
|
-
# end
|
21
|
-
#
|
22
|
-
# it "should be possible to replace existing settings" do
|
23
|
-
# tc = Toolchain.new(GCC_JSON)
|
24
|
-
# tc.compiler.c.source_file_endings.should == [".c"]
|
25
|
-
# tc.compiler.c.source_file_endings = [".cc"]
|
26
|
-
# tc.compiler.c.source_file_endings.should == [".cc"]
|
27
|
-
# end
|
28
|
-
#
|
29
|
-
# end
|