test_configure.sh
1.8 KB
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
#!/bin/bash
# discover the current work dir, the log and access.
echo "argv[0]=$0"
if [[ ! -f $0 ]]; then
echo "directly execute the scripts on shell.";
work_dir=`pwd`
else
echo "execute scripts in file: $0";
work_dir=`dirname $0`; work_dir=`(cd ${work_dir} && pwd)`
fi
work_dir=`(cd ${work_dir}/.. && pwd)`
product_dir=$work_dir
build_objs=${work_dir}/objs
package_dir=${build_objs}/package
log="${build_objs}/test.`date +%s`.log" && . ${product_dir}/scripts/_log.sh && check_log
ret=$?; if [[ $ret -ne 0 ]]; then exit $ret; fi
item="default configure"
ok_msg "test ${item}"
(./configure && make) >>$log 2>&1
ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test ${item} failed. ret=$ret"; exit $ret; fi
ok_msg "test ${item} success"
item="preset --x86-x64"
ok_msg "test ${item}"
(./configure --x86-x64 && make) >>$log 2>&1
ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test ${item} failed. ret=$ret"; exit $ret; fi
ok_msg "test ${item} success"
item="preset --fast"
ok_msg "test ${item}"
(./configure --fast && make) >>$log 2>&1
ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test ${item} failed. ret=$ret"; exit $ret; fi
ok_msg "test ${item} success"
item="preset --pure-rtmp"
ok_msg "test ${item}"
(./configure --pure-rtmp && make) >>$log 2>&1
ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test ${item} failed. ret=$ret"; exit $ret; fi
ok_msg "test ${item} success"
item="preset --rtmp-hls"
ok_msg "test ${item}"
(./configure --rtmp-hls && make) >>$log 2>&1
ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test ${item} failed. ret=$ret"; exit $ret; fi
ok_msg "test ${item} success"
item="preset --dev"
ok_msg "test ${item}"
(./configure --dev && make) >>$log 2>&1
ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test ${item} failed. ret=$ret"; exit $ret; fi
ok_msg "test ${item} success"