Project

General

Profile

Patch #226 » manual_test_suite.rb

Matt Jones, 2008-02-03 11:01

 
1

    
2
# Move the path to the location of the current file
3
Dir.chdir(File.dirname(File.expand_path(__FILE__)))
4

    
5
# Require the unit test libs
6
require 'test/unit/testsuite'
7
require 'test/unit/ui/console/testrunner'
8
require 'test/unit/testcase'
9

    
10
# Require the unit tests
11
['unit/board_test.rb',
12
'unit/comment_test.rb',
13
'unit/issue_status_test.rb',
14
'unit/issue_test.rb',
15
'unit/mailer_test.rb',
16
'unit/mail_handler_test.rb',
17
'unit/member_test.rb',
18
'unit/message_test.rb',
19
'unit/project_test.rb',
20
'unit/repository_test.rb',
21
'unit/setting_test.rb',
22
'unit/token_test.rb',
23
'unit/user_preference_test.rb',
24
'unit/user_test.rb',
25
'unit/watcher_test.rb',
26
'unit/wiki_content_test.rb',
27
'unit/wiki_page_test.rb',
28
'unit/wiki_test.rb'
29
].each do |file|
30
	require file
31
end
32

    
33
# Require the functional tests
34
['functional/application_controller_test.rb',
35
'functional/feeds_controller_test.rb',
36
'functional/my_controller_test.rb',
37
'functional/projects_controller_test.rb',
38
'functional/search_controller_test.rb',
39
'functional/timelog_controller_test.rb'
40
].each do |file|
41
	require file
42
end
43

    
44
# Require the integration tests
45
['integration/account_test.rb',
46
'integration/admin_test.rb',
47
'integration/issues_test.rb',
48
'integration/projects_test.rb'
49
].each do |file|
50
	require file
51
end
52

    
53
Thread.abort_on_exception = true
54

    
55
def unit_tests
56
    [BoardTest.suite,
57
	CommentTest.suite,
58
	IssueStatusTest.suite,
59
	IssueTest.suite,
60
	MailerTest.suite,
61
	MailHandlerTest.suite,
62
	MemberTest.suite,
63
	MessageTest.suite,
64
	ProjectTest.suite,
65
	RepositoryTest.suite,
66
	SettingTest.suite,
67
	TokenTest.suite,
68
	UserPreferenceTest.suite,
69
	UserTest.suite,
70
	WatcherTest.suite,
71
	WikiContentTest.suite,
72
	WikiPageTest.suite,
73
	WikiTest.suite]
74
end
75

    
76
def functional_tests
77
	[ApplicationControllerTest.suite,
78
	FeedsControllerTest.suite,
79
	MyControllerTest.suite,
80
	ProjectsControllerTest.suite,
81
	SearchControllerTest.suite,
82
	TimelogControllerTest.suite]
83
end
84

    
85
def integration_tests
86
	[AccountTest.suite,
87
	AdminTest.suite,
88
	IssuesTest.suite,
89
	ProjectsTest.suite]
90
end
91

    
92
class TestSuite
93
    def self.suite
94
        master_suite = Test::Unit::TestSuite.new
95
        
96
        [integration_tests].each do |suite_set|
97
            suite_set.each do |suite|
98
                master_suite << suite
99
            end
100
        end
101
        
102
        return master_suite
103
    end
104
end 
105

    
106
Test::Unit::UI::Console::TestRunner.run(TestSuite)
107

    
108

    
(1-1/2)