yugui-chkbuild 0.1.2
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/README.ja.rd +191 -0
- data/Rakefile +56 -0
- data/VERSION +1 -0
- data/bin/last-build +28 -0
- data/bin/start-build +37 -0
- data/chkbuild.gemspec +107 -0
- data/core_ext/io.rb +17 -0
- data/core_ext/string.rb +10 -0
- data/lib/chkbuild.rb +45 -0
- data/lib/chkbuild/build.rb +718 -0
- data/lib/chkbuild/lock.rb +57 -0
- data/lib/chkbuild/logfile.rb +230 -0
- data/lib/chkbuild/main.rb +138 -0
- data/lib/chkbuild/options.rb +62 -0
- data/lib/chkbuild/scm/cvs.rb +132 -0
- data/lib/chkbuild/scm/git.rb +223 -0
- data/lib/chkbuild/scm/svn.rb +215 -0
- data/lib/chkbuild/scm/xforge.rb +33 -0
- data/lib/chkbuild/target.rb +180 -0
- data/lib/chkbuild/targets/gcc.rb +94 -0
- data/lib/chkbuild/targets/ruby.rb +456 -0
- data/lib/chkbuild/title.rb +107 -0
- data/lib/chkbuild/upload.rb +66 -0
- data/lib/misc/escape.rb +535 -0
- data/lib/misc/gdb.rb +74 -0
- data/lib/misc/timeoutcom.rb +174 -0
- data/lib/misc/udiff.rb +244 -0
- data/lib/misc/util.rb +232 -0
- data/sample/build-autoconf-ruby +69 -0
- data/sample/build-gcc-ruby +43 -0
- data/sample/build-ruby +37 -0
- data/sample/build-ruby2 +36 -0
- data/sample/build-svn +55 -0
- data/sample/build-yarv +35 -0
- data/sample/test-apr +12 -0
- data/sample/test-catcherr +23 -0
- data/sample/test-combfail +21 -0
- data/sample/test-core +14 -0
- data/sample/test-core2 +19 -0
- data/sample/test-date +9 -0
- data/sample/test-dep +17 -0
- data/sample/test-depver +14 -0
- data/sample/test-echo +9 -0
- data/sample/test-env +9 -0
- data/sample/test-error +9 -0
- data/sample/test-fail +18 -0
- data/sample/test-fmesg +16 -0
- data/sample/test-gcc-v +15 -0
- data/sample/test-git +11 -0
- data/sample/test-leave-proc +9 -0
- data/sample/test-limit +9 -0
- data/sample/test-make +9 -0
- data/sample/test-neterr +16 -0
- data/sample/test-savannah +14 -0
- data/sample/test-sleep +9 -0
- data/sample/test-timeout +9 -0
- data/sample/test-timeout2 +10 -0
- data/sample/test-timeout3 +9 -0
- data/sample/test-upload +13 -0
- data/sample/test-warn +13 -0
- data/setup/upload-rsync-ssh +572 -0
- data/test/misc/test-escape.rb +17 -0
- data/test/misc/test-logfile.rb +108 -0
- data/test/misc/test-timeoutcom.rb +23 -0
- data/test/test_helper.rb +9 -0
- metadata +123 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'escape'
|
3
|
+
|
4
|
+
class TestEscape < Test::Unit::TestCase
|
5
|
+
def test_shell_command
|
6
|
+
assert_equal("com arg", Escape.shell_command(%w[com arg]))
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_html_text
|
10
|
+
assert_equal('a&<>"', Escape.html_text('a&<>"'))
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_html_attr
|
14
|
+
assert_equal('a&<>"', Escape.html_attr('a&<>"'))
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,108 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'tempfile'
|
3
|
+
require 'chkbuild/logfile'
|
4
|
+
|
5
|
+
class TestLogFile < Test::Unit::TestCase
|
6
|
+
def with_logfile
|
7
|
+
t = Tempfile.new("test-logfile")
|
8
|
+
begin
|
9
|
+
l = ChkBuild::LogFile.new(t.path, true)
|
10
|
+
yield l
|
11
|
+
ensure
|
12
|
+
t.close(true)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_start_section
|
17
|
+
with_logfile {|l|
|
18
|
+
l.start_section("a")
|
19
|
+
assert_match(/^== a #/, l.get_all_log)
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_get_section
|
24
|
+
with_logfile {|l|
|
25
|
+
l.with_default_output {
|
26
|
+
l.start_section("a")
|
27
|
+
puts "aaa"
|
28
|
+
l.start_section("b")
|
29
|
+
puts "bbb"
|
30
|
+
}
|
31
|
+
assert_equal("aaa\n", l.get_section("a"))
|
32
|
+
assert_equal("bbb\n", l.get_section("b"))
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_unique_section_name
|
37
|
+
with_logfile {|l|
|
38
|
+
secname1 = l.start_section("a")
|
39
|
+
secname2 = l.start_section("a")
|
40
|
+
secname3 = l.start_section("a")
|
41
|
+
secname5 = l.start_section("a (5)")
|
42
|
+
secname4 = l.start_section("a")
|
43
|
+
secname6 = l.start_section("a")
|
44
|
+
assert_equal("a", secname1)
|
45
|
+
assert_equal("a (2)", secname2)
|
46
|
+
assert_equal("a (3)", secname3)
|
47
|
+
assert_equal("a (4)", secname4)
|
48
|
+
assert_equal("a (5)", secname5)
|
49
|
+
assert_equal("a (6)", secname6)
|
50
|
+
assert_match(/^== #{Regexp.quote secname1} #/, l.get_all_log)
|
51
|
+
assert_match(/^== #{Regexp.quote secname2} #/, l.get_all_log)
|
52
|
+
assert_match(/^== #{Regexp.quote secname3} #/, l.get_all_log)
|
53
|
+
}
|
54
|
+
end
|
55
|
+
|
56
|
+
def test_each_secname
|
57
|
+
with_logfile {|l|
|
58
|
+
secname1 = l.start_section("a")
|
59
|
+
secname2 = l.start_section("b")
|
60
|
+
secname3 = l.start_section("c")
|
61
|
+
ss = []
|
62
|
+
l.each_secname {|v|
|
63
|
+
ss << v
|
64
|
+
}
|
65
|
+
assert_equal(%w[a b c], ss)
|
66
|
+
}
|
67
|
+
end
|
68
|
+
|
69
|
+
def test_section_size
|
70
|
+
with_logfile {|l|
|
71
|
+
l.with_default_output {
|
72
|
+
secname1 = l.start_section("a")
|
73
|
+
puts "A"
|
74
|
+
secname2 = l.start_section("b")
|
75
|
+
puts "BB"
|
76
|
+
secname3 = l.start_section("c")
|
77
|
+
puts "CCC"
|
78
|
+
}
|
79
|
+
secseize_a = l.section_size("a")
|
80
|
+
secseize_b = l.section_size("b")
|
81
|
+
secseize_c = l.section_size("c")
|
82
|
+
assert_equal(secseize_b, secseize_a+1)
|
83
|
+
assert_equal(secseize_c, secseize_b+1)
|
84
|
+
}
|
85
|
+
end
|
86
|
+
|
87
|
+
def test_modify_section
|
88
|
+
with_logfile {|l|
|
89
|
+
secname1 = secname2 = nil
|
90
|
+
l.with_default_output {
|
91
|
+
secname1 = l.start_section("a")
|
92
|
+
puts "aaa"
|
93
|
+
secname2 = l.start_section("b")
|
94
|
+
puts "bbb"
|
95
|
+
}
|
96
|
+
assert_equal("aaa\n", l.get_section("a"))
|
97
|
+
assert_equal("bbb\n", l.get_section("b"))
|
98
|
+
l.modify_section("a", "cc")
|
99
|
+
assert_equal("cc\n", l.get_section("a"))
|
100
|
+
l.modify_section("b", "dd")
|
101
|
+
assert_equal("dd\n", l.get_section("b"))
|
102
|
+
l.modify_section("a", "eeeeee")
|
103
|
+
assert_equal("eeeeee\n", l.get_section("a"))
|
104
|
+
l.modify_section("b", "ffffffff")
|
105
|
+
assert_equal("ffffffff\n", l.get_section("b"))
|
106
|
+
}
|
107
|
+
end
|
108
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'timeoutcom'
|
2
|
+
require 'test/unit'
|
3
|
+
|
4
|
+
class TestTimeoutCommand < Test::Unit::TestCase
|
5
|
+
def test_time
|
6
|
+
assert_raise(CommandTimeout) {
|
7
|
+
open("/dev/null", 'w') {|null|
|
8
|
+
TimeoutCommand.timeout_command(Time.now+1, null) {
|
9
|
+
begin
|
10
|
+
sleep 2
|
11
|
+
rescue Interrupt
|
12
|
+
end
|
13
|
+
}
|
14
|
+
}
|
15
|
+
}
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_past_time
|
19
|
+
assert_raise(CommandTimeout) {
|
20
|
+
TimeoutCommand.timeout_command(Time.now-1, nil) {}
|
21
|
+
}
|
22
|
+
end
|
23
|
+
end
|
data/test/test_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,123 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: yugui-chkbuild
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- TANAKA, Akira
|
8
|
+
- Yuki Sonoda (Yugui)
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2009-09-27 00:00:00 -07:00
|
14
|
+
default_executable:
|
15
|
+
dependencies: []
|
16
|
+
|
17
|
+
description:
|
18
|
+
email: yugui@yugui.jp
|
19
|
+
executables:
|
20
|
+
- last-build
|
21
|
+
- start-build
|
22
|
+
extensions: []
|
23
|
+
|
24
|
+
extra_rdoc_files:
|
25
|
+
- README.ja.rd
|
26
|
+
files:
|
27
|
+
- README.ja.rd
|
28
|
+
- Rakefile
|
29
|
+
- VERSION
|
30
|
+
- bin/last-build
|
31
|
+
- bin/start-build
|
32
|
+
- chkbuild.gemspec
|
33
|
+
- core_ext/io.rb
|
34
|
+
- core_ext/string.rb
|
35
|
+
- lib/chkbuild.rb
|
36
|
+
- lib/chkbuild/build.rb
|
37
|
+
- lib/chkbuild/lock.rb
|
38
|
+
- lib/chkbuild/logfile.rb
|
39
|
+
- lib/chkbuild/main.rb
|
40
|
+
- lib/chkbuild/options.rb
|
41
|
+
- lib/chkbuild/scm/cvs.rb
|
42
|
+
- lib/chkbuild/scm/git.rb
|
43
|
+
- lib/chkbuild/scm/svn.rb
|
44
|
+
- lib/chkbuild/scm/xforge.rb
|
45
|
+
- lib/chkbuild/target.rb
|
46
|
+
- lib/chkbuild/targets/gcc.rb
|
47
|
+
- lib/chkbuild/targets/ruby.rb
|
48
|
+
- lib/chkbuild/title.rb
|
49
|
+
- lib/chkbuild/upload.rb
|
50
|
+
- lib/misc/escape.rb
|
51
|
+
- lib/misc/gdb.rb
|
52
|
+
- lib/misc/timeoutcom.rb
|
53
|
+
- lib/misc/udiff.rb
|
54
|
+
- lib/misc/util.rb
|
55
|
+
- sample/build-autoconf-ruby
|
56
|
+
- sample/build-gcc-ruby
|
57
|
+
- sample/build-ruby
|
58
|
+
- sample/build-ruby2
|
59
|
+
- sample/build-svn
|
60
|
+
- sample/build-yarv
|
61
|
+
- sample/test-apr
|
62
|
+
- sample/test-catcherr
|
63
|
+
- sample/test-combfail
|
64
|
+
- sample/test-core
|
65
|
+
- sample/test-core2
|
66
|
+
- sample/test-date
|
67
|
+
- sample/test-dep
|
68
|
+
- sample/test-depver
|
69
|
+
- sample/test-echo
|
70
|
+
- sample/test-env
|
71
|
+
- sample/test-error
|
72
|
+
- sample/test-fail
|
73
|
+
- sample/test-fmesg
|
74
|
+
- sample/test-gcc-v
|
75
|
+
- sample/test-git
|
76
|
+
- sample/test-leave-proc
|
77
|
+
- sample/test-limit
|
78
|
+
- sample/test-make
|
79
|
+
- sample/test-neterr
|
80
|
+
- sample/test-savannah
|
81
|
+
- sample/test-sleep
|
82
|
+
- sample/test-timeout
|
83
|
+
- sample/test-timeout2
|
84
|
+
- sample/test-timeout3
|
85
|
+
- sample/test-upload
|
86
|
+
- sample/test-warn
|
87
|
+
- setup/upload-rsync-ssh
|
88
|
+
- test/misc/test-escape.rb
|
89
|
+
- test/misc/test-logfile.rb
|
90
|
+
- test/misc/test-timeoutcom.rb
|
91
|
+
- test/test_helper.rb
|
92
|
+
has_rdoc: true
|
93
|
+
homepage: http://github.com/yugui/chkbuild
|
94
|
+
licenses:
|
95
|
+
post_install_message:
|
96
|
+
rdoc_options:
|
97
|
+
- --charset=UTF-8
|
98
|
+
require_paths:
|
99
|
+
- lib
|
100
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: "0"
|
105
|
+
version:
|
106
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: "0"
|
111
|
+
version:
|
112
|
+
requirements: []
|
113
|
+
|
114
|
+
rubyforge_project:
|
115
|
+
rubygems_version: 1.3.5
|
116
|
+
signing_key:
|
117
|
+
specification_version: 2
|
118
|
+
summary: gemified version of akr's chkbuild - a robust continuous building system
|
119
|
+
test_files:
|
120
|
+
- test/misc/test-escape.rb
|
121
|
+
- test/misc/test-logfile.rb
|
122
|
+
- test/misc/test-timeoutcom.rb
|
123
|
+
- test/test_helper.rb
|