-
Notifications
You must be signed in to change notification settings - Fork 2
/
run_test.sh
41 lines (33 loc) · 945 Bytes
/
run_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
#!/bin/bash
bashfoo_require test
bashfoo_require assert
bashfoo_require run
#@bashfoo.test test_quiet_if_success_conveys_exit_code
test_quiet_if_success_conveys_exit_code()
{
assert_succeeds quiet_if_success true
assert_fails quiet_if_success false
}
_failing_fun_return()
{
echo "_failing_fun_return: error foobar"
return 1
}
_failing_fun_exit()
{
echo "_failing_fun_exit: error foobar"
exit 1
}
#@bashfoo.test test_quiet_if_success_outputs_failed_command_output_return
test_quiet_if_success_outputs_failed_command_output_return()
{
quiet_if_success _failing_fun_return >& out1 || true
assert_grep "_failing_fun_return: error foobar" out1
}
#@bashfoo.test test_quiet_if_success_outputs_failed_command_output_exit
test_quiet_if_success_outputs_failed_command_output_exit()
{
quiet_if_success _failing_fun_exit >& out1 || true
assert_grep "_failing_fun_exit: error foobar" out1
}
autotest