@@ -23,16 +23,6 @@ GREEN="${ESCAPE}[92m"
2323YELLOW=" ${ESCAPE} [93m"
2424BLUE=" ${ESCAPE} [94m"
2525
26- # All tests informations must be sent to the following three
27- # file descriptors:
28- # LOG -> all test logs, such as SUCCESS, FAILURE, stacktrace...
29- # OUT -> all code under test outputs relevant in the context
30- # ERR -> all code under test error outputs relevant in the context
31- exec {LOG}>&1
32- exec {STACK}>&1
33- exec {OUT}>&1
34- exec {ERR}>&1
35-
3626fail () {
3727 local message=$1
3828 local stdout=$2
@@ -188,61 +178,61 @@ color() {
188178text_format () {
189179 notify_suite_starting () {
190180 test_file=" $1 "
191- echo " Running tests in $test_file " >& $LOG
181+ echo " Running tests in $test_file "
192182 }
193183 notify_test_starting () {
194184 local test=" $1 "
195- echo -n " Running $test ... " | color " $BLUE " >& $LOG
185+ echo -n " Running $test ... " | color " $BLUE "
196186 }
197187 notify_test_succeeded () {
198- color " $GREEN " " SUCCESS" >& $LOG
188+ color " $GREEN " " SUCCESS"
199189 }
200190 notify_test_failed () {
201191 local message=" $2 "
202- color " $RED " " FAILURE" >& $LOG
203- [[ -z $message ]] || printf -- " $message \n" >& $LOG
192+ color " $RED " " FAILURE"
193+ [[ -z $message ]] || printf -- " $message \n"
204194 }
205195 notify_stdout () {
206- sed ' s:^:out> :' | color $GREEN >& $OUT
196+ sed ' s:^:out> :' | color $GREEN
207197 }
208198 notify_stderr () {
209- sed ' s:^:err> :' | color $RED >& $ERR
199+ sed ' s:^:err> :' | color $RED
210200 }
211201 notify_stack () {
212- color " $YELLOW " >& $STACK
202+ color " $YELLOW "
213203 }
214204}
215205
216206tap_format () {
217207 notify_suite_starting () {
218208 test_file=" $1 "
219- echo " # Running tests in $test_file " >& $LOG
209+ echo " # Running tests in $test_file "
220210 }
221211 notify_test_starting () {
222212 echo -n
223213 }
224214 notify_test_succeeded () {
225215 local test=" $1 "
226- echo -n " ok" | color " $GREEN " >& $LOG
227- echo -n ' - ' >& $LOG
228- echo " $test " | color " $BLUE " >& $LOG
216+ echo -n " ok" | color " $GREEN "
217+ echo -n ' - '
218+ echo " $test " | color " $BLUE "
229219 }
230220 notify_test_failed () {
231221 local test=" $1 "
232222 local message=" $2 "
233- echo -n " not ok" | color " $RED " >& $LOG
234- echo -n " - " >& $LOG
235- echo " $test " >& $LOG
236- [[ -z $message ]] || printf -- " $message \n" | sed -u -e ' s/^/# /' >& $LOG
223+ echo -n " not ok" | color " $RED "
224+ echo -n " - "
225+ echo " $test "
226+ [[ -z $message ]] || printf -- " $message \n" | sed -u -e ' s/^/# /'
237227 }
238228 notify_stdout () {
239- sed ' s:^:# out> :' | color $GREEN >& $OUT
229+ sed ' s:^:# out> :' | color $GREEN
240230 }
241231 notify_stderr () {
242- sed ' s:^:# err> :' | color $RED >& $ERR
232+ sed ' s:^:# err> :' | color $RED
243233 }
244234 notify_stack () {
245- sed ' s:^:# :' | color " $YELLOW " >& $STACK
235+ sed ' s:^:# :' | color " $YELLOW "
246236 }
247237}
248238
0 commit comments