-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-test.sh
106 lines (77 loc) · 2.18 KB
/
build-test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/usr/bin/env bash
source bash-toolbox/init.sh
include app.server.validator.test.AppServerValidatorTest
include app.server.version.constants.test.AppServerVersionConstantsTest
include app.server.version.test.AppServerVersionTest
include array.util.test.ArrayUtilTest
include array.validator.test.ArrayValidatorTest
include command.validator.test.CommandValidatorTest
include curl.util.test.CurlUtilTest
include file.name.util.test.FileNameUtilTest
include file.util.test.FileUtilTest
include file.validator.test.FileValidatorTest
include file.writer.test.FileWriterTest
include help.message.HelpMessage
include jira.util.test.JiraUtilTest
include language.util.test.LanguageUtilTest
include logger.Logger
include logger.util.test.LoggerUtilTest
include matcher.test.MatcherTest
include math.util.test.MathUtilTest
include props.reader.util.test.PropsReaderUtilTest
include props.util.test.PropsUtilTest
include props.writer.util.test.PropsWriterUtilTest
include repo.test.RepoTest
include string.util.test.StringUtilTest
include string.validator.test.StringValidatorTest
include system.test.SystemTest
include test.executor.TestExecutor
@description runs_all_unit_tests_in_/test_directory
runUnitTests(){
${_log} info "running_all_unit_tests..."
local classes=(
AppServerValidatorTest
AppServerVersionConstantsTest
AppServerVersionTest
ArrayUtilTest
ArrayValidatorTest
CommandValidatorTest
CurlUtilTest
FileNameUtilTest
FileUtilTest
FileValidatorTest
FileWriterTest
JiraUtilTest
LanguageUtilTest
LoggerUtilTest
MatcherTest
MathUtilTest
PropsReaderUtilTest
PropsUtilTest
PropsWriterUtilTest
RepoTest
StringUtilTest
StringValidatorTest
SystemTest
)
rm -rf ${resultsFile}
for class in ${classes[@]}; do
TestExecutor executeTest ${class} |& tee -a ${resultsFile}
done
${_log} info "completed"
${_log} info "removing_formatting_from_results_file..."
sed -i "s#\[0[0-9;]*m##g" ${resultsFile}
${_log} info "completed"
}
main(){
if [[ ! ${1} ]]; then
HelpMessage printHelpMessage
elif [[ ${1} == runUnitTests ]]; then
local _log="Logger log"
local resultsFile=results.txt
${1}
else
Logger logErrorMsg "${1}_is_not_a_valid_command"
fi
}
main $@