bin
doc
examples
files
lib
python
src
t
bin
00-assert.rb
00-exit_nonzero.rb
00-exit_status.rb
00-exit_zero.rb
00-file_equal.rb
00-file_not_equal.rb
00-ignore_file.rb
00-import_file.rb
00-stderr_equal.rb
00-stderr_not_equal.rb
00-stdout_equal.rb
00-stdout_not_equal.rb
01-cmd.rb
01-misc.rb
01-simple.rb
CMDTEST_assert.rb
CMDTEST_chdir.rb
CMDTEST_cmd.rb
CMDTEST_crnl.rb
CMDTEST_dont_ignore_files.rb
CMDTEST_exit_nonzero.rb
CMDTEST_exit_status.rb
CMDTEST_exit_zero.rb
CMDTEST_file_encoding.rb
CMDTEST_file_equal.rb
CMDTEST_file_not_equal.rb
CMDTEST_ignore_file.rb
CMDTEST_import_directory.rb
CMDTEST_import_file.rb
CMDTEST_misc.rb
CMDTEST_options.rb
CMDTEST_output_encoding.rb
CMDTEST_raise.rb
CMDTEST_readonly.rb
CMDTEST_setenv.rb
CMDTEST_simple.rb
CMDTEST_skip_test.rb
CMDTEST_stdxxx_contain.rb
CMDTEST_stdxxx_equal.rb
CMDTEST_summary.rb
CMDTEST_teardown.rb
CMDTEST_unicode.rb
selftest_utils.rb
.gitignore
.hgignore
CMDTEST_example.yml
CMakeLists.txt
COPYING.txt
README.html
README.rst
Rakefile
cmdtest.gemspec
file1.txt
file2.txt
replace_strings.pl
run-regression.rb
setup.rb
162 lines
3.5 KiB
Ruby
162 lines
3.5 KiB
Ruby
|
|
require "selftest_utils"
|
|
|
|
class CMDTEST_summery < Cmdtest::Testcase
|
|
|
|
include SelftestUtils
|
|
|
|
#-----------------------------------
|
|
|
|
def test_summary_ERRORS
|
|
|
|
create_file "CMDTEST_foo.rb", [
|
|
"class CMDTEST_foo1 < Cmdtest::Testcase",
|
|
" def setup",
|
|
" prepend_path #{BIN.inspect}",
|
|
" prepend_path #{PLATFORM_BIN.inspect}",
|
|
" end",
|
|
"",
|
|
|
|
' def test_foo1',
|
|
' cmd "true" do',
|
|
' exit_zero',
|
|
' end',
|
|
' cmd "true" do',
|
|
' exit_zero',
|
|
' end',
|
|
' cmd "true" do',
|
|
' exit_zero',
|
|
' end',
|
|
' cmd "true" do',
|
|
' exit_nonzero', # +1 errors
|
|
' end',
|
|
' end',
|
|
'',
|
|
' def test_foo2',
|
|
' cmd "true" do',
|
|
' exit_zero',
|
|
' end',
|
|
' non_existing_method', # +1 fatals
|
|
' end',
|
|
'',
|
|
' def test_foo3',
|
|
' cmd "true" do',
|
|
' exit_zero',
|
|
' end',
|
|
' non_existing_method', # +1 fatals
|
|
' end',
|
|
'',
|
|
' def test_foo4',
|
|
' cmd "true" do',
|
|
' exit_nonzero', # +1 errors
|
|
' end',
|
|
' end',
|
|
'',
|
|
' def test_foo5',
|
|
' cmd "true" do',
|
|
' exit_nonzero', # +1 errors
|
|
' end',
|
|
' end',
|
|
'',
|
|
' def test_skip_1',
|
|
' skip_test "skip_1"',
|
|
' never_called()',
|
|
' end',
|
|
'',
|
|
' def test_skip_2',
|
|
' skip_test "skip_2"',
|
|
' never_called()',
|
|
' end',
|
|
'',
|
|
' def test_skip_3',
|
|
' skip_test "skip_3"',
|
|
' never_called()',
|
|
' end',
|
|
'',
|
|
' def test_skip_4',
|
|
' skip_test "skip_4"',
|
|
' never_called()',
|
|
' end',
|
|
'',
|
|
'end',
|
|
]
|
|
|
|
cmd_cmdtest_verbose do
|
|
stdout_equal /^--- .* test classes,.*test methods,.*commands,.*skipped,.*errors,.*fatals\.$/
|
|
stdout_equal /. 1 test classes/
|
|
stdout_equal /. 9 test methods/
|
|
stdout_equal /. 8 commands/
|
|
stdout_equal /. 4 skipped/
|
|
stdout_equal /. 3 errors/
|
|
stdout_equal /. 2 fatals/
|
|
exit_nonzero
|
|
end
|
|
end
|
|
|
|
#-----------------------------------
|
|
|
|
def test_summary_OK
|
|
|
|
create_file "CMDTEST_foo.rb", [
|
|
"class CMDTEST_foo1 < Cmdtest::Testcase",
|
|
" def setup",
|
|
" prepend_path #{BIN.inspect}",
|
|
" prepend_path #{PLATFORM_BIN.inspect}",
|
|
" end",
|
|
"",
|
|
|
|
' def test_foo1',
|
|
' cmd "true" do',
|
|
' exit_zero',
|
|
' end',
|
|
' cmd "true" do',
|
|
' exit_zero',
|
|
' end',
|
|
' cmd "true" do',
|
|
' exit_zero',
|
|
' end',
|
|
' cmd "true" do',
|
|
' exit_zero',
|
|
' end',
|
|
' end',
|
|
'',
|
|
' def test_foo2',
|
|
' cmd "true" do',
|
|
' exit_zero',
|
|
' end',
|
|
' end',
|
|
'',
|
|
' def test_foo3',
|
|
' cmd "true" do',
|
|
' exit_zero',
|
|
' end',
|
|
' end',
|
|
'',
|
|
' def test_foo4',
|
|
' cmd "true" do',
|
|
' exit_zero',
|
|
' end',
|
|
' end',
|
|
'',
|
|
' def test_foo5',
|
|
' cmd "true" do',
|
|
' exit_zero',
|
|
' end',
|
|
' end',
|
|
'',
|
|
'end',
|
|
]
|
|
|
|
cmd_cmdtest_verbose do
|
|
stdout_equal /^### .* test classes,.*test methods,.*commands,.*errors,.*fatals\.$/
|
|
stdout_equal /. 1 test classes/
|
|
stdout_equal /. 5 test methods/
|
|
stdout_equal /. 8 commands/
|
|
stdout_equal /. 0 errors/
|
|
stdout_equal /. 0 fatals/
|
|
exit_zero
|
|
end
|
|
end
|
|
|
|
end
|