2
0

test_configure.sh 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. #!/bin/bash
  2. params="$@"
  3. echo "params is: $params"
  4. # discover the current work dir, the log and access.
  5. echo "argv[0]=$0"
  6. if [[ ! -f $0 ]]; then
  7. echo "directly execute the scripts on shell.";
  8. work_dir=`pwd`
  9. else
  10. echo "execute scripts in file: $0";
  11. work_dir=`dirname $0`; work_dir=`(cd ${work_dir} && pwd)`
  12. fi
  13. work_dir=`(cd ${work_dir}/.. && pwd)`
  14. product_dir=$work_dir
  15. build_objs=${work_dir}/objs
  16. package_dir=${build_objs}/package
  17. log="${build_objs}/test.`date +%s`.log" && . ${product_dir}/scripts/_log.sh && check_log
  18. ret=$?; if [[ $ret -ne 0 ]]; then exit $ret; fi
  19. item="./configure"
  20. ok_msg "test \" ${item} \""
  21. ($item && make $params) >>$log 2>&1
  22. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  23. ok_msg "test \" ${item} \" success"
  24. item="./configure --x86-x64"
  25. ok_msg "test \" ${item} \""
  26. ($item && make $params) >>$log 2>&1
  27. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  28. ok_msg "test \" ${item} \" success"
  29. item="./configure --disable-all"
  30. ok_msg "test \" ${item} \""
  31. ($item && make $params) >>$log 2>&1
  32. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  33. ok_msg "test \" ${item} \" success"
  34. item="./configure --fast"
  35. ok_msg "test \" ${item} \""
  36. ($item && make $params) >>$log 2>&1
  37. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  38. ok_msg "test \" ${item} \" success"
  39. item="./configure --pure-rtmp"
  40. ok_msg "test \" ${item} \""
  41. ($item && make $params) >>$log 2>&1
  42. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  43. ok_msg "test \" ${item} \" success"
  44. item="./configure --fast --with-ssl"
  45. ok_msg "test \" ${item} \""
  46. ($item && make $params) >>$log 2>&1
  47. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  48. ok_msg "test \" ${item} \" success"
  49. item="./configure --fast --with-hls"
  50. ok_msg "test \" ${item} \""
  51. ($item && make $params) >>$log 2>&1
  52. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  53. ok_msg "test \" ${item} \" success"
  54. item="./configure --fast --with-dvr"
  55. ok_msg "test \" ${item} \""
  56. ($item && make $params) >>$log 2>&1
  57. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  58. ok_msg "test \" ${item} \" success"
  59. item="./configure --fast --with-nginx"
  60. ok_msg "test \" ${item} \""
  61. ($item && make $params) >>$log 2>&1
  62. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  63. ok_msg "test \" ${item} \" success"
  64. item="./configure --fast --with-http-callback"
  65. ok_msg "test \" ${item} \""
  66. ($item && make $params) >>$log 2>&1
  67. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  68. ok_msg "test \" ${item} \" success"
  69. item="./configure --fast --with-http-server"
  70. ok_msg "test \" ${item} \""
  71. ($item && make $params) >>$log 2>&1
  72. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  73. ok_msg "test \" ${item} \" success"
  74. item="./configure --fast --with-http-api"
  75. ok_msg "test \" ${item} \""
  76. ($item && make $params) >>$log 2>&1
  77. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  78. ok_msg "test \" ${item} \" success"
  79. item="./configure --fast --with-ffmpeg"
  80. ok_msg "test \" ${item} \""
  81. ($item && make $params) >>$log 2>&1
  82. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  83. ok_msg "test \" ${item} \" success"
  84. item="./configure --fast --with-transcode"
  85. ok_msg "test \" ${item} \""
  86. ($item && make $params) >>$log 2>&1
  87. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  88. ok_msg "test \" ${item} \" success"
  89. item="./configure --fast --with-ingest"
  90. ok_msg "test \" ${item} \""
  91. ($item && make $params) >>$log 2>&1
  92. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  93. ok_msg "test \" ${item} \" success"
  94. item="./configure --fast --with-librtmp"
  95. ok_msg "test \" ${item} \""
  96. ($item && make $params) >>$log 2>&1
  97. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  98. ok_msg "test \" ${item} \" success"
  99. item="./configure --fast --with-research"
  100. ok_msg "test \" ${item} \""
  101. ($item && make $params) >>$log 2>&1
  102. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  103. ok_msg "test \" ${item} \" success"
  104. item="./configure --fast --with-stream-caster --with-http-api"
  105. ok_msg "test \" ${item} \""
  106. ($item && make $params) >>$log 2>&1
  107. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  108. ok_msg "test \" ${item} \" success"
  109. item="./configure --fast --with-utest"
  110. ok_msg "test \" ${item} \""
  111. ($item && make $params) >>$log 2>&1
  112. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  113. ok_msg "test \" ${item} \" success"
  114. item="./configure --fast --with-ssl --with-utest"
  115. ok_msg "test \" ${item} \""
  116. ($item && make $params) >>$log 2>&1
  117. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  118. ok_msg "test \" ${item} \" success"
  119. item="./configure --fast --with-gperf"
  120. ok_msg "test \" ${item} \""
  121. ($item && make $params) >>$log 2>&1
  122. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  123. ok_msg "test \" ${item} \" success"
  124. item="./configure --fast --with-gperf --with-gmc"
  125. ok_msg "test \" ${item} \""
  126. ($item && make $params) >>$log 2>&1
  127. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  128. ok_msg "test \" ${item} \" success"
  129. item="./configure --fast --with-gperf --with-gmp"
  130. ok_msg "test \" ${item} \""
  131. ($item && make $params) >>$log 2>&1
  132. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  133. ok_msg "test \" ${item} \" success"
  134. item="./configure --fast --with-gperf --with-gcp"
  135. ok_msg "test \" ${item} \""
  136. ($item && make $params) >>$log 2>&1
  137. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  138. ok_msg "test \" ${item} \" success"
  139. item="./configure --fast --with-gprof"
  140. ok_msg "test \" ${item} \""
  141. ($item && make $params) >>$log 2>&1
  142. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  143. ok_msg "test \" ${item} \" success"
  144. item="./configure --fast --log-verbose"
  145. ok_msg "test \" ${item} \""
  146. ($item && make $params) >>$log 2>&1
  147. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  148. ok_msg "test \" ${item} \" success"
  149. item="./configure --fast --log-info"
  150. ok_msg "test \" ${item} \""
  151. ($item && make $params) >>$log 2>&1
  152. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  153. ok_msg "test \" ${item} \" success"
  154. item="./configure --fast --log-trace"
  155. ok_msg "test \" ${item} \""
  156. ($item && make $params) >>$log 2>&1
  157. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  158. ok_msg "test \" ${item} \" success"
  159. item="./configure --fast --log-info --log-verbose --log-trace"
  160. ok_msg "test \" ${item} \""
  161. ($item && make $params) >>$log 2>&1
  162. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  163. ok_msg "test \" ${item} \" success"
  164. #######################################################################################################
  165. #######################################################################################################
  166. #######################################################################################################
  167. item="./configure --dev"
  168. ok_msg "test \" ${item} \""
  169. ($item && make $params) >>$log 2>&1
  170. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  171. ok_msg "test \" ${item} \" success"
  172. item="./configure --fast-dev"
  173. ok_msg "test \" ${item} \""
  174. ($item && make $params) >>$log 2>&1
  175. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  176. ok_msg "test \" ${item} \" success"
  177. item="./configure --demo"
  178. ok_msg "test \" ${item} \""
  179. ($item && make $params) >>$log 2>&1
  180. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  181. ok_msg "test \" ${item} \" success"
  182. item="./configure --full"
  183. ok_msg "test \" ${item} \""
  184. ($item && make $params) >>$log 2>&1
  185. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  186. ok_msg "test \" ${item} \" success"
  187. #######################################################################################################
  188. #######################################################################################################
  189. #######################################################################################################
  190. item="./configure --disable-all --with-ssl"
  191. ok_msg "test \" ${item} \""
  192. ($item && make $params) >>$log 2>&1
  193. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  194. ok_msg "test \" ${item} \" success"
  195. item="./configure --disable-all --with-hls --with-ssl --with-http-server --with-http-api"
  196. ok_msg "test \" ${item} \""
  197. ($item && make $params) >>$log 2>&1
  198. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  199. ok_msg "test \" ${item} \" success"
  200. item="./configure --disable-all --with-ssl --with-hls --with-nginx"
  201. ok_msg "test \" ${item} \""
  202. ($item && make $params) >>$log 2>&1
  203. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  204. ok_msg "test \" ${item} \" success"
  205. item="./configure --disable-all --with-ssl --with-hls --with-nginx --with-ffmpeg --with-transcode"
  206. ok_msg "test \" ${item} \""
  207. ($item && make $params) >>$log 2>&1
  208. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  209. ok_msg "test \" ${item} \" success"
  210. item="./configure --disable-all --with-ssl --with-ffmpeg --with-transcode"
  211. ok_msg "test \" ${item} \""
  212. ($item && make $params) >>$log 2>&1
  213. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  214. ok_msg "test \" ${item} \" success"
  215. item="./configure --disable-all --with-ssl --with-ffmpeg --with-ingest"
  216. ok_msg "test \" ${item} \""
  217. ($item && make $params) >>$log 2>&1
  218. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  219. ok_msg "test \" ${item} \" success"
  220. item="./configure --disable-all --with-hls --with-ssl --with-http-server"
  221. ok_msg "test \" ${item} \""
  222. ($item && make $params) >>$log 2>&1
  223. ret=$?; if [[ $ret -ne 0 ]]; then failed_msg "test \" ${item} \" failed. ret=$ret"; exit $ret; fi
  224. ok_msg "test \" ${item} \" success"
  225. echo "success"