4 # @author MyungJoo Ham <myungjoo.ham@gmail.com>
7 # @brief This is API set for SSAT (Shell Script Automated Tester)
15 LightGreen='\033[1;32m'
19 LightBlue='\033[1;34m'
21 LightPurple='\033[1;35m'
23 LightCyan='\033[1;36m'
24 LightGray='\033[0;37m'
29 # @brief Report results of a test group (a "runTest.sh" in a testee directory)
30 # @param $1 # total test cases
31 # @param $2 # total success cases
32 # @param $3 # test log
33 # @param $4 # print outs from test (stdout)
40 # @brief Write Test Log
41 # @param $1 1 = success / 0 = fail
42 # @param $2 test case ID (short string)
43 # @param $3 test case description
49 # @brief Call Test Case (a shell script), expected exit = 0
50 # @param $1 Full path to the executable (e.g., ~/script/a1.sh)
51 # @param $2 Full string of the arguments to $1 (e.g., "-q -n --dryrun")
52 # @param $3 test case ID
53 # @param $4 test case description
54 function callTestSuccess {
59 # @brief Call Test Case (a shell script), expected exit != 0
60 # @param $1 Full path to the executable (e.g., ~/script/a1.sh)
61 # @param $2 Full string of the arguments to $1 (e.g., "-q -n --dryrun")
62 # @param $3 test case ID
63 # @param $4 test case description
64 function callTestFail {
69 # @brief Call Test Case (a shell script), expected exit == $5
70 # @param $1 Full path to the executable (e.g., ~/script/a1.sh)
71 # @param $2 Full string of the arguments to $1 (e.g., "-q -n --dryrun")
72 # @param $3 test case ID
73 # @param $4 test case description
74 # @param $5 Expected exit code.
75 function callTestExitEq {
80 # @brief Compare two result files expected to be equal
81 # @param $1 Path to result 1 (golden)
82 # @param $2 Path to result 2 (test run)
83 # @param $3 test case ID
84 # @param $4 test case description
85 # @param $5 0 if the size is expected to be equal as well. 1 if golden (result 1) might be smaller (will ignore rest of result 2). 2 if the opposite of 1. If $5 > 2, it denotes the max size of compared bytes. (compare the first $5 bytes only)
86 function callCompareTest {