cxxproject 0.6.29 → 0.6.30

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. data/README.md +195 -65
  2. data/lib/cxxproject/buildingblocks/building_block.rb +1 -1
  3. data/lib/cxxproject/buildingblocks/executable.rb +3 -0
  4. data/lib/cxxproject/buildingblocks/has_dependencies_mixin.rb +5 -5
  5. data/lib/cxxproject/buildingblocks/has_sources_mixin.rb +30 -16
  6. data/lib/cxxproject/buildingblocks/single_source.rb +0 -1
  7. data/lib/cxxproject/ext/rake_listener.rb +11 -13
  8. data/lib/cxxproject/plugin_context.rb +6 -4
  9. data/lib/cxxproject/toolchain/colorizing_formatter.rb +8 -5
  10. data/lib/cxxproject/utils/printer.rb +6 -6
  11. data/lib/cxxproject/version.rb +1 -1
  12. data/lib/cxxproject.rb +0 -1
  13. metadata +37 -145
  14. data/.gitignore +0 -18
  15. data/.rvmrc +0 -1
  16. data/Gemfile +0 -6
  17. data/Gemfile.lock +0 -35
  18. data/Rakefile.rb +0 -125
  19. data/cxxproject.gemspec +0 -22
  20. data/example/.gitignore +0 -1
  21. data/example/Rakefile.rb +0 -35
  22. data/example/big_project/.gitignore +0 -2
  23. data/example/big_project/Rakefile_generator.rb +0 -80
  24. data/example/big_project/fak.h +0 -9
  25. data/example/custom/.gitignore +0 -1
  26. data/example/custom/Rakefile.rb +0 -12
  27. data/example/custom/foo.cpp +0 -5
  28. data/example/custom/project.rb +0 -27
  29. data/example/dependency_tests/Rakefile.rb +0 -3
  30. data/example/dependency_tests/help1.h +0 -12
  31. data/example/dependency_tests/help2.h +0 -10
  32. data/example/dependency_tests/main.cpp +0 -6
  33. data/example/dependency_tests/project.rb +0 -3
  34. data/example/generator/Rakefile.rb +0 -12
  35. data/example/generator/main/main.cpp +0 -3
  36. data/example/generator/main/project/project.rb +0 -3
  37. data/example/oneFileOnly/Rakefile.rb +0 -3
  38. data/example/oneFileOnly/config.h +0 -2
  39. data/example/oneFileOnly/main.cpp +0 -8
  40. data/example/oneFileOnly/project_compile.rb +0 -3
  41. data/example/protobuf/.gitignore +0 -4
  42. data/example/protobuf/Rakefile.rb +0 -70
  43. data/example/protobuf/addressbook/addressbook.proto +0 -24
  44. data/example/protobuf/addressbook/addressbook_read.cc +0 -67
  45. data/example/protobuf/addressbook/addressbook_write.cc +0 -93
  46. data/example/protobuf/addressbook/project.rb +0 -16
  47. data/example/protobuf/protobuf.files +0 -37
  48. data/example/protobuf/protobuf_project.rb +0 -9
  49. data/example/simpleUnitTest/Rakefile.rb +0 -4
  50. data/example/simpleUnitTest/atest.cpp +0 -16
  51. data/example/simpleUnitTest/atest.h +0 -11
  52. data/example/simpleUnitTest/project.rb +0 -5
  53. data/example/simpleUnitTest/test.cpp +0 -13
  54. data/example/strange_dirs/Rakefile.rb +0 -4
  55. data/example/strange_dirs/lazyLib/project.rb +0 -5
  56. data/example/strange_dirs/main/main.cpp +0 -5
  57. data/example/strange_dirs/main/project.rb +0 -5
  58. data/example/strange_dirs/src/test.cpp +0 -4
  59. data/example/test.rb +0 -10
  60. data/example/three_tests/Rakefile.rb +0 -5
  61. data/example/three_tests/allsuites/project.rb +0 -4
  62. data/example/three_tests/main/main.cpp +0 -13
  63. data/example/three_tests/main/project.rb +0 -5
  64. data/example/three_tests/suite1/project.rb +0 -6
  65. data/example/three_tests/suite1/suite1.cpp +0 -3
  66. data/example/three_tests/suite1/suite1.h +0 -28
  67. data/example/three_tests/suite2/project.rb +0 -6
  68. data/example/three_tests/suite2/suite2.cpp +0 -3
  69. data/example/three_tests/suite2/suite2.h +0 -29
  70. data/junit.rb +0 -91
  71. data/lib/cxxproject/ext/string.rb +0 -9
  72. data/plugins/tmp/.rvmrc +0 -1
  73. data/plugins/tmp/BuildDir/objects/testme/test.o +0 -0
  74. data/plugins/tmp/BuildDir/objects/testme/test.o.d +0 -1
  75. data/plugins/tmp/BuildDir/testme.exe +0 -0
  76. data/plugins/tmp/Rakefile.rb +0 -6
  77. data/plugins/tmp/project.rb +0 -6
  78. data/plugins/tmp/reinstall/Rakefile.rb +0 -15
  79. data/plugins/tmp/test.cpp +0 -7
  80. data/rake_helper/perftools.rb +0 -34
  81. data/rake_helper/spec.rb +0 -65
  82. data/roodi.yml +0 -8
  83. data/spec/building_block_spec.rb +0 -103
  84. data/spec/file_ext_spec.rb +0 -30
  85. data/spec/ide_interface_spec.rb +0 -41
  86. data/spec/plugin_context_spec.rb +0 -57
  87. data/spec/provider_spec.rb +0 -39
  88. data/spec/rake_listener_ext_spec.rb +0 -58
  89. data/spec/spec_helper.rb +0 -18
  90. data/spec/string_spec.rb +0 -11
  91. data/spec/testdata/basic/exe12/help.cpp +0 -5
  92. data/spec/testdata/basic/exe12/help.h +0 -6
  93. data/spec/testdata/basic/exe12/main.cpp +0 -10
  94. data/spec/testdata/basic/exe12/project.rb +0 -5
  95. data/spec/testdata/basic/lib1/lib1.cpp +0 -7
  96. data/spec/testdata/basic/lib1/lib1.h +0 -8
  97. data/spec/testdata/basic/lib1/project.rb +0 -5
  98. data/spec/testdata/basic/lib2/lib2.cpp +0 -17
  99. data/spec/testdata/basic/lib2/lib2.h +0 -6
  100. data/spec/testdata/basic/lib2/project.rb +0 -8
  101. data/spec/testdata/multiple_levels/libs/lib1/lib1.cpp +0 -7
  102. data/spec/testdata/multiple_levels/libs/lib1/lib1.h +0 -8
  103. data/spec/testdata/multiple_levels/libs/lib1/project.rb +0 -5
  104. data/spec/testdata/multiple_levels/libs/lib2/lib2.cpp +0 -21
  105. data/spec/testdata/multiple_levels/libs/lib2/lib2.h +0 -6
  106. data/spec/testdata/multiple_levels/libs/lib2/project.rb +0 -19
  107. data/spec/testdata/multiple_levels/mainproject/basic/help.cpp +0 -5
  108. data/spec/testdata/multiple_levels/mainproject/basic/help.h +0 -6
  109. data/spec/testdata/multiple_levels/mainproject/basic/main.cpp +0 -10
  110. data/spec/testdata/multiple_levels/mainproject/basic/project.rb +0 -8
  111. data/spec/testdata/onlyOneHeader/.gitignore +0 -1
  112. data/spec/testdata/onlyOneHeader/Rakefile.rb +0 -4
  113. data/spec/testdata/onlyOneHeader/help.cpp +0 -5
  114. data/spec/testdata/onlyOneHeader/help.h +0 -7
  115. data/spec/testdata/onlyOneHeader/main.cpp +0 -8
  116. data/spec/testdata/onlyOneHeader/project.rb +0 -4
  117. data/spec/testdata/onlyOneHeader/testin.c +0 -0
  118. data/spec/toolchain_spec.rb +0 -29
@@ -1,80 +0,0 @@
1
- require 'fileutils'
2
- require 'rake/clean'
3
-
4
- NR_OF_PROJECTS = 6000
5
- PROJECTS = {}
6
- MAX_SOURCES = 20
7
- MAX_FIB = 12
8
-
9
- directory 'gen'
10
-
11
- def create_project(name)
12
- base = File.join('gen', "project_#{name}")
13
- FileUtils.mkdir_p(base)
14
- sources = rand(MAX_SOURCES)
15
- PROJECTS[name] = sources
16
- sources.times do |i|
17
- File.open(File.join(base, "#{name}_file_#{i}.cxx"), 'w') do |io|
18
- io.puts("#include <stdio.h>\n#include \"../../fak.h\"\nvoid print_#{name}_#{i}() {printf(\"%ld\\n\", fib<#{rand(MAX_FIB)+1}>::value);}")
19
- end
20
- end
21
- File.open(File.join(base, "lib_#{name}.h"), 'w') do |io|
22
- sources.times do |i|
23
- io.puts("void print_#{name}_#{i}();")
24
- end
25
- end
26
-
27
- File.open(File.join(base, 'project.rb'), 'w') do |io|
28
- io.puts('cxx_configuration do')
29
- io.puts(" source_lib '#{name}', :sources => Dir.glob('*.cxx'), :includes => ['.']")
30
- io.puts('end')
31
- end
32
- end
33
-
34
- desc "Creating #{PROJECTS} projects"
35
- task :create_projects => [:gen] do
36
- NR_OF_PROJECTS.times do |i|
37
- create_project(i)
38
- end
39
- end
40
-
41
- desc 'creating rakefile'
42
- task 'Rakefile.rb' => [:gen] do
43
- File.open(File.join('gen', 'Rakefile.rb'), 'w') do |io|
44
- io.puts("$:.unshift File.join(File.dirname(__FILE__),'..','..','..','lib')")
45
- io.puts("require 'cxxproject'")
46
- io.puts("CxxProject2Rake.new(Dir.glob('**/*project.rb'), 'build', 'gcc', '.')")
47
- end
48
- end
49
-
50
- desc 'create a main project'
51
- task :create_main => [:create_projects, :gen] do
52
- base = File.join('gen', 'main')
53
- FileUtils.mkdir_p(base)
54
- File.open(File.join(base, 'main.cxx'), 'w') do |io|
55
- NR_OF_PROJECTS.times do |i|
56
- io.puts("#include \"lib_#{i}.h\"")
57
- end
58
- io.puts('#include <stdio.h>')
59
- io.puts('int main(int argc, char** args) {')
60
- NR_OF_PROJECTS.times do |name|
61
- PROJECTS[name].times do |i|
62
- io.puts(" print_#{name}_#{i}();")
63
- end
64
- end
65
- io.puts(' printf("\\n");')
66
- io.puts('}')
67
- end
68
- deps = []
69
- NR_OF_PROJECTS.times do |i|
70
- deps << "'#{i}'"
71
- end
72
- File.open(File.join(base, 'project.rb'), 'w') do |io|
73
- io.puts('cxx_configuration do')
74
- io.puts(" exe 'main', :sources => ['main.cxx'], :dependencies => [#{deps.join(', ')}]")
75
- io.puts('end')
76
- end
77
- end
78
-
79
- task :default => [:create_main, 'Rakefile.rb']
80
- CLEAN.include('gen')
@@ -1,9 +0,0 @@
1
- template <long N> class fib {
2
- public:
3
- static const long value = fib<N-1>::value + fib<N-1>::value;
4
- };
5
-
6
- template <> class fib<1> {
7
- public:
8
- static const long value = 1;
9
- };
@@ -1 +0,0 @@
1
- BuildDir
@@ -1,12 +0,0 @@
1
- $:.unshift File.join(File.dirname(__FILE__),"..","..","lib")
2
- require 'cxxproject'
3
- BuildDir = "BuildDir"
4
-
5
- dependent_projects = ['./project.rb']
6
- CxxProject2Rake.new(dependent_projects, BuildDir, "gcc", './')
7
-
8
- unittest_flags = {
9
- :DEFINES => ['UNIT_TEST','CPPUNIT_MAIN=main'],
10
- :FLAGS => "-O0 -g3 -Wall"
11
- }
12
- toolchain = Provider.modify_cpp_compiler("gcc", unittest_flags)
@@ -1,5 +0,0 @@
1
-
2
- int bar()
3
- {
4
- return 0;
5
- }
@@ -1,27 +0,0 @@
1
- cxx_configuration do
2
-
3
- source_lib "testme",
4
- :sources => FileList['**/*.cpp'],
5
- :includes => ['include'],
6
- :dependencies => []
7
-
8
- # using lambdas
9
- custom "testcustom",
10
- :execute => lambda { puts "executing testcustom" },
11
- :dependencies => ["testme"]
12
-
13
- def foo
14
- puts "foo for testcustom2"
15
- end
16
-
17
- # using methods
18
- custom "testcustom2",
19
- :execute => method(:foo),
20
- :dependencies => ["testcustom"]
21
-
22
- # using new lambda syntax
23
- custom "testcustom3",
24
- :execute => -> { puts "executing testcustom3" },
25
- :dependencies => ["testcustom2"]
26
-
27
- end
@@ -1,3 +0,0 @@
1
- $:.unshift File.join(File.dirname(__FILE__),"..","..","lib")
2
- require 'cxxproject'
3
- CxxProject2Rake.new(Dir.glob('**/project.rb'), "build", "gcc")
@@ -1,12 +0,0 @@
1
- #ifndef help1_h_
2
- #define help1_h_
3
-
4
- #include <iostream>
5
- #include "help2.h"
6
-
7
- void help1() {
8
- std::cout << "help1" << std::endl;
9
- help2();
10
- }
11
-
12
- #endif
@@ -1,10 +0,0 @@
1
- #ifndef help2_h_
2
- #define help2_h_
3
-
4
- #include <iostream>
5
-
6
- void help2() {
7
- std::cout << "help2" << std::endl;
8
- }
9
-
10
- #endif
@@ -1,6 +0,0 @@
1
- #include "help1.h"
2
-
3
- int main(int argc, char** args) {
4
- help1();
5
- return 0;
6
- }
@@ -1,3 +0,0 @@
1
- cxx_configuration do
2
- exe 'dependency_test', :sources => FileList['**/*.cpp']
3
- end
@@ -1,12 +0,0 @@
1
- $:.unshift File.join(File.dirname(__FILE__),"..","..","lib")
2
-
3
- require 'cxxproject'
4
-
5
- DIR = 'build/gen'
6
- directory DIR
7
-
8
- file File.join(DIR, 'test.cpp') => DIR do |t|
9
- sh "touch #{t.name}"
10
- end
11
-
12
- CxxProject2Rake.new('main/project/project.rb' , 'build', "gcc", '.')
@@ -1,3 +0,0 @@
1
- int main(int argc, char** args) {
2
- return 0;
3
- }
@@ -1,3 +0,0 @@
1
- cxx_configuration do
2
- exe 'main', :sources => ['../../build/gen/test.cpp', '../main.cpp'], :output_dir => 'build'
3
- end
@@ -1,3 +0,0 @@
1
- $:.unshift File.join(File.dirname(__FILE__),"..","..","lib")
2
- require 'cxxproject'
3
- CxxProject2Rake.new(['project_compile.rb'], 'build', "gcc", '.')
@@ -1,2 +0,0 @@
1
-
2
- int color = 3;
@@ -1,8 +0,0 @@
1
- #include "stdio.h"
2
- #include "config.h"
3
-
4
- int main()
5
- {
6
- printf("hello world %d\n", color);
7
- return 0;
8
- }
@@ -1,3 +0,0 @@
1
- cxx_configuration do
2
- compile "basic", :sources => ['main.cpp']
3
- end
@@ -1,4 +0,0 @@
1
- build
2
- tmp
3
- protobuf-2.4.1
4
- addressbook/gen
@@ -1,70 +0,0 @@
1
- $:.unshift File.join(File.dirname(__FILE__),"..","..","lib")
2
-
3
- require 'yaml'
4
-
5
- PROTOBUF_VERSION='2.4.1'
6
- PROTOBUF_BASE="protobuf-#{PROTOBUF_VERSION}"
7
- PROTOBUF_ARCHIVE="#{PROTOBUF_BASE}.tar.gz"
8
- PROTOBUF_DOWNLOAD="tmp/#{PROTOBUF_ARCHIVE}"
9
-
10
- directory 'tmp'
11
-
12
- desc "download protobuf #{PROTOBUF_VERSION}"
13
- file PROTOBUF_DOWNLOAD => 'tmp' do
14
- cd 'tmp' do
15
- command = "wget http://protobuf.googlecode.com/files/#{PROTOBUF_ARCHIVE}"
16
- sh command
17
- sleep(2)
18
- end
19
- end
20
-
21
- PROTOBUF_TMP = File.join(PROTOBUF_BASE, 'tmp')
22
- PROTOC = File.join(PROTOBUF_TMP, 'src', 'protoc')
23
- PROTOBUF_CONFIG_H=File.join(PROTOBUF_TMP, 'config.h')
24
-
25
- PROTOBUF_LITE_SOURCES=YAML.load(IO.read('protobuf.files')).map{ | i | File.join(PROTOBUF_BASE, 'src', i)}
26
- file PROTOBUF_LITE_SOURCES[0] => PROTOBUF_DOWNLOAD do |t|
27
- command = "tar xf #{PROTOBUF_DOWNLOAD}"
28
- sh command
29
- command = "find #{PROTOBUF_BASE}/ -exec touch {} \\;"
30
- sh command
31
- sleep(2) # wait for file timestamps to matter
32
- end
33
-
34
- directory PROTOBUF_TMP
35
- desc 'configure protobuf'
36
- file PROTOBUF_CONFIG_H => PROTOBUF_LITE_SOURCES + [PROTOBUF_TMP] do
37
- cd PROTOBUF_TMP do
38
- command = '../configure'
39
- sh command
40
- end
41
- end
42
-
43
- desc 'build protoc'
44
- file PROTOC => [PROTOBUF_CONFIG_H] do
45
- cd PROTOBUF_TMP do
46
- command = 'make'
47
- sh command
48
- end
49
- end
50
-
51
- require 'cxxproject'
52
-
53
- GEN_FOLDER = File.join('addressbook', 'gen')
54
- CLEAN.include('GEN_FOLDER')
55
-
56
- directory GEN_FOLDER
57
- ['addressbook.pb.h', 'addressbook.pb.cc'].each do |f|
58
- desc 'protoc addressbook.proto'
59
- file File.join(GEN_FOLDER, 'addressbook', f) => [File.join('addressbook', 'addressbook.proto'), GEN_FOLDER, PROTOC] do
60
- command = "#{PROTOC} --cpp_out=#{GEN_FOLDER} #{File.join('addressbook', 'addressbook.proto')}"
61
- sh command
62
- end
63
- end
64
-
65
- CxxProject2Rake.new(FileList['**/*project.rb'] , "build", "gcc", ".")
66
-
67
-
68
- CLEAN.include('tmp')
69
- CLEAN.include(PROTOBUF_BASE)
70
- CLEAN.include(GEN_FOLDER)
@@ -1,24 +0,0 @@
1
- package tutorial;
2
-
3
- message Person {
4
- required string name = 1;
5
- required int32 id = 2;
6
- optional string email = 3;
7
-
8
- enum PhoneType {
9
- MOBILE = 0;
10
- HOME = 1;
11
- WORK = 2;
12
- }
13
-
14
- message PhoneNumber {
15
- required string number = 1;
16
- optional PhoneType type = 2 [default = HOME];
17
- }
18
-
19
- repeated PhoneNumber phone = 4;
20
- }
21
-
22
- message AddressBook {
23
- repeated Person person = 1;
24
- }
@@ -1,67 +0,0 @@
1
- #include <iostream>
2
- #include <fstream>
3
- #include <string>
4
- #include "addressbook/addressbook.pb.h"
5
-
6
- using namespace std;
7
-
8
- // Iterates though all people in the AddressBook and prints info about them.
9
- void ListPeople(const tutorial::AddressBook& address_book) {
10
- for (int i = 0; i < address_book.person_size(); i++) {
11
- const tutorial::Person& person = address_book.person(i);
12
-
13
- cout << "Person ID: " << person.id() << endl;
14
- cout << " Name: " << person.name() << endl;
15
- if (person.has_email()) {
16
- cout << " E-mail address: " << person.email() << endl;
17
- }
18
-
19
- for (int j = 0; j < person.phone_size(); j++) {
20
- const tutorial::Person::PhoneNumber& phone_number = person.phone(j);
21
-
22
- switch (phone_number.type()) {
23
- case tutorial::Person::MOBILE:
24
- cout << " Mobile phone #: ";
25
- break;
26
- case tutorial::Person::HOME:
27
- cout << " Home phone #: ";
28
- break;
29
- case tutorial::Person::WORK:
30
- cout << " Work phone #: ";
31
- break;
32
- }
33
- cout << phone_number.number() << endl;
34
- }
35
- }
36
- }
37
-
38
- // Main function: Reads the entire address book from a file and prints all
39
- // the information inside.
40
- int main(int argc, char* argv[]) {
41
- // Verify that the version of the library that we linked against is
42
- // compatible with the version of the headers we compiled against.
43
- GOOGLE_PROTOBUF_VERIFY_VERSION;
44
-
45
- if (argc != 2) {
46
- cerr << "Usage: " << argv[0] << " ADDRESS_BOOK_FILE" << endl;
47
- return -1;
48
- }
49
-
50
- tutorial::AddressBook address_book;
51
-
52
- {
53
- // Read the existing address book.
54
- fstream input(argv[1], ios::in | ios::binary);
55
- if (!address_book.ParseFromIstream(&input)) {
56
- cerr << "Failed to parse address book." << endl;
57
- return -1;
58
- }
59
- }
60
-
61
- ListPeople(address_book);
62
-
63
- // Optional: Delete all global objects allocated by libprotobuf.
64
- google::protobuf::ShutdownProtobufLibrary();
65
-
66
- return 0;
67
- }
@@ -1,93 +0,0 @@
1
- #include <iostream>
2
- #include <fstream>
3
- #include <string>
4
- #include "addressbook/addressbook.pb.h"
5
- using namespace std;
6
-
7
- // This function fills in a Person message based on user input.
8
- void PromptForAddress(tutorial::Person* person) {
9
- cout << "Enter person ID number: ";
10
- int id;
11
- cin >> id;
12
- person->set_id(id);
13
- cin.ignore(256, '\n');
14
-
15
- cout << "Enter name: ";
16
- getline(cin, *person->mutable_name());
17
-
18
- cout << "Enter email address (blank for none): ";
19
- string email;
20
- getline(cin, email);
21
- if (!email.empty()) {
22
- person->set_email(email);
23
- }
24
-
25
- while (true) {
26
- cout << "Enter a phone number (or leave blank to finish): ";
27
- string number;
28
- getline(cin, number);
29
- if (number.empty()) {
30
- break;
31
- }
32
-
33
- tutorial::Person::PhoneNumber* phone_number = person->add_phone();
34
- phone_number->set_number(number);
35
-
36
- cout << "Is this a mobile, home, or work phone? ";
37
- string type;
38
- getline(cin, type);
39
- if (type == "mobile") {
40
- phone_number->set_type(tutorial::Person::MOBILE);
41
- } else if (type == "home") {
42
- phone_number->set_type(tutorial::Person::HOME);
43
- } else if (type == "work") {
44
- phone_number->set_type(tutorial::Person::WORK);
45
- } else {
46
- cout << "Unknown phone type. Using default." << endl;
47
- }
48
- }
49
- }
50
-
51
- // Main function: Reads the entire address book from a file,
52
- // adds one person based on user input, then writes it back out to the same
53
- // file.
54
- int main(int argc, char* argv[]) {
55
- // Verify that the version of the library that we linked against is
56
- // compatible with the version of the headers we compiled against.
57
- GOOGLE_PROTOBUF_VERIFY_VERSION;
58
-
59
- if (argc != 2) {
60
- cerr << "Usage: " << argv[0] << " ADDRESS_BOOK_FILE" << endl;
61
- return -1;
62
- }
63
-
64
- tutorial::AddressBook address_book;
65
-
66
- {
67
- // Read the existing address book.
68
- fstream input(argv[1], ios::in | ios::binary);
69
- if (!input) {
70
- cout << argv[1] << ": File not found. Creating a new file." << endl;
71
- } else if (!address_book.ParseFromIstream(&input)) {
72
- cerr << "Failed to parse address book." << endl;
73
- return -1;
74
- }
75
- }
76
-
77
- // Add an address.
78
- PromptForAddress(address_book.add_person());
79
-
80
- {
81
- // Write the new address book back to disk.
82
- fstream output(argv[1], ios::out | ios::trunc | ios::binary);
83
- if (!address_book.SerializeToOstream(&output)) {
84
- cerr << "Failed to write address book." << endl;
85
- return -1;
86
- }
87
- }
88
-
89
- // Optional: Delete all global objects allocated by libprotobuf.
90
- google::protobuf::ShutdownProtobufLibrary();
91
-
92
- return 0;
93
- }
@@ -1,16 +0,0 @@
1
- cxx_configuration do
2
-
3
- source_lib 'addressbook_pb_api',
4
- :sources => ['gen/addressbook/addressbook.pb.cc'],
5
- :includes => ['gen'],
6
- :dependencies => ['protobuf']
7
-
8
- exe 'addressbook_write',
9
- :sources => ['addressbook_write.cc'],
10
- :dependencies => ['addressbook_pb_api']
11
-
12
- exe 'addressbook_read',
13
- :sources => ['addressbook_read.cc'],
14
- :dependencies => ['addressbook_pb_api']
15
-
16
- end
@@ -1,37 +0,0 @@
1
- - google/protobuf/stubs/common.cc
2
- - google/protobuf/stubs/once.cc
3
- - google/protobuf/stubs/hash.h
4
- - google/protobuf/stubs/map-util.h
5
- - google/protobuf/stubs/stl_util-inl.h
6
- - google/protobuf/extension_set.cc
7
- - google/protobuf/generated_message_util.cc
8
- - google/protobuf/message_lite.cc
9
- - google/protobuf/repeated_field.cc
10
- - google/protobuf/wire_format_lite.cc
11
- - google/protobuf/io/coded_stream.cc
12
- - google/protobuf/io/coded_stream_inl.h
13
- - google/protobuf/io/zero_copy_stream.cc
14
- - google/protobuf/io/zero_copy_stream_impl_lite.cc
15
- - google/protobuf/stubs/strutil.cc
16
- - google/protobuf/stubs/strutil.h
17
- - google/protobuf/stubs/substitute.cc
18
- - google/protobuf/stubs/substitute.h
19
- - google/protobuf/stubs/structurally_valid.cc
20
- - google/protobuf/descriptor.cc
21
- - google/protobuf/descriptor.pb.cc
22
- - google/protobuf/descriptor_database.cc
23
- - google/protobuf/dynamic_message.cc
24
- - google/protobuf/extension_set_heavy.cc
25
- - google/protobuf/generated_message_reflection.cc
26
- - google/protobuf/message.cc
27
- - google/protobuf/reflection_ops.cc
28
- - google/protobuf/service.cc
29
- - google/protobuf/text_format.cc
30
- - google/protobuf/unknown_field_set.cc
31
- - google/protobuf/wire_format.cc
32
- - google/protobuf/io/gzip_stream.cc
33
- - google/protobuf/io/printer.cc
34
- - google/protobuf/io/tokenizer.cc
35
- - google/protobuf/io/zero_copy_stream_impl.cc
36
- - google/protobuf/compiler/importer.cc
37
- - google/protobuf/compiler/parser.cc
@@ -1,9 +0,0 @@
1
- cxx_configuration do
2
- deps = [BinaryLibrary.new('z'), BinaryLibrary.new('pthread')]
3
-
4
- source_lib 'protobuf',
5
- :sources => PROTOBUF_LITE_SOURCES.delete_if{ |i| i.index('.h') },
6
- :includes => [File.join(PROTOBUF_BASE, 'src'), File.join(PROTOBUF_BASE, 'tmp')],
7
- :dependencies => deps,
8
- :file_dependencies => [PROTOBUF_CONFIG_H]
9
- end
@@ -1,4 +0,0 @@
1
- $:.unshift File.join(File.dirname(__FILE__),"..","..","lib")
2
- require 'cxxproject'
3
- BuildDir='build'
4
- CxxProject2Rake.new(Dir.glob('**/project.rb'), BuildDir, "gcc")
@@ -1,16 +0,0 @@
1
- #include "atest.h"
2
-
3
- CPPUNIT_TEST_SUITE_REGISTRATION(ATest);
4
-
5
- void ATest::test1() {
6
- CPPUNIT_ASSERT(1 == 1);
7
- }
8
- int f1() {
9
- return 1;
10
- }
11
- int f2() {
12
- return 2;
13
- }
14
- void ATest::test2() {
15
- CPPUNIT_ASSERT_EQUAL(f1(), f2());
16
- }
@@ -1,11 +0,0 @@
1
- #include "cppunit/extensions/HelperMacros.h"
2
-
3
- class ATest : public CppUnit::TestFixture {
4
- CPPUNIT_TEST_SUITE( ATest );
5
- CPPUNIT_TEST( test1 );
6
- CPPUNIT_TEST( test2 );
7
- CPPUNIT_TEST_SUITE_END();
8
- public:
9
- void test1();
10
- void test2();
11
- };
@@ -1,5 +0,0 @@
1
- cxx_configuration do
2
- exe "dependency_test",
3
- :sources => FileList['**/*.cpp'],
4
- :dependencies => [BinaryLibrary.new('cppunit')]
5
- end
@@ -1,13 +0,0 @@
1
- #include <cassert>
2
-
3
- #include <cppunit/TestCase.h>
4
- #include <cppunit/ui/text/TestRunner.h>
5
- #include <cppunit/extensions/TestFactoryRegistry.h>
6
-
7
- int main( int argc, char **argv) {
8
- CppUnit::TextUi::TestRunner runner;
9
- CppUnit::TestFactoryRegistry &registry = CppUnit::TestFactoryRegistry::getRegistry();
10
- runner.addTest( registry.makeTest() );
11
- bool wasSuccessful = runner.run( );
12
- return wasSuccessful ? 0 : 1;
13
- }
@@ -1,4 +0,0 @@
1
- $:.unshift File.join(File.dirname(__FILE__),"..","..","lib")
2
-
3
- require 'cxxproject'
4
- CxxProject2Rake.new(Dir.glob('**/*project.rb'), "build", "gcc", ".")
@@ -1,5 +0,0 @@
1
- cxx_configuration do
2
- source_lib "lazy",
3
- :sources => FileList['../src/*.cpp'],
4
- :includes => ['.']
5
- end
@@ -1,5 +0,0 @@
1
- extern void print();
2
- int main(int argc, char** args) {
3
- print();
4
- return 0;
5
- }
@@ -1,5 +0,0 @@
1
- cxx_configuration do
2
- exe 'main',
3
- :sources => Dir.glob('*.cpp'),
4
- :dependencies => 'lazy'
5
- end
@@ -1,4 +0,0 @@
1
- #include <stdio.h>
2
- void print() {
3
- printf("super\n");
4
- }
data/example/test.rb DELETED
@@ -1,10 +0,0 @@
1
- require 'logger'
2
-
3
- log = Logger.new(STDOUT)
4
- log.level = Logger::DEBUG
5
-
6
- log.debug("Created logger")
7
- log.info("Program started")
8
- log.warn("Nothing to do!")
9
-
10
-