test-release.sh 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. #!/usr/bin/env bash
  2. #===-- test-release.sh - Test the LLVM release candidates ------------------===#
  3. #
  4. # The LLVM Compiler Infrastructure
  5. #
  6. # This file is distributed under the University of Illinois Open Source
  7. # License.
  8. #
  9. #===------------------------------------------------------------------------===#
  10. #
  11. # Download, build, and test the release candidate for an LLVM release.
  12. #
  13. #===------------------------------------------------------------------------===#
  14. if [ `uname -s` = "FreeBSD" ]; then
  15. MAKE=gmake
  16. else
  17. MAKE=make
  18. fi
  19. # Base SVN URL for the sources.
  20. Base_url="http://llvm.org/svn/llvm-project"
  21. Release=""
  22. Release_no_dot=""
  23. RC=""
  24. Triple=""
  25. use_gzip="no"
  26. do_checkout="yes"
  27. do_debug="no"
  28. do_asserts="no"
  29. do_compare="yes"
  30. do_rt="yes"
  31. do_libs="yes"
  32. do_libunwind="yes"
  33. do_test_suite="yes"
  34. do_openmp="no"
  35. BuildDir="`pwd`"
  36. use_autoconf="no"
  37. ExtraConfigureFlags=""
  38. function usage() {
  39. echo "usage: `basename $0` -release X.Y.Z -rc NUM [OPTIONS]"
  40. echo ""
  41. echo " -release X.Y.Z The release version to test."
  42. echo " -rc NUM The pre-release candidate number."
  43. echo " -final The final release candidate."
  44. echo " -triple TRIPLE The target triple for this machine."
  45. echo " -j NUM Number of compile jobs to run. [default: 3]"
  46. echo " -build-dir DIR Directory to perform testing in. [default: pwd]"
  47. echo " -no-checkout Don't checkout the sources from SVN."
  48. echo " -test-debug Test the debug build. [default: no]"
  49. echo " -test-asserts Test with asserts on. [default: no]"
  50. echo " -no-compare-files Don't test that phase 2 and 3 files are identical."
  51. echo " -use-gzip Use gzip instead of xz."
  52. echo " -configure-flags FLAGS Extra flags to pass to the configure step."
  53. echo " -use-autoconf Use autoconf instead of cmake"
  54. echo " -no-rt Disable check-out & build Compiler-RT"
  55. echo " -no-libs Disable check-out & build libcxx/libcxxabi/libunwind"
  56. echo " -no-libunwind Disable check-out & build libunwind"
  57. echo " -no-test-suite Disable check-out & build test-suite"
  58. echo " -openmp Check out and build the OpenMP run-time (experimental)"
  59. }
  60. if [ `uname -s` = "Darwin" ]; then
  61. # compiler-rt doesn't yet build with CMake on Darwin.
  62. use_autoconf="yes"
  63. fi
  64. while [ $# -gt 0 ]; do
  65. case $1 in
  66. -release | --release )
  67. shift
  68. Release="$1"
  69. Release_no_dot="`echo $1 | sed -e 's,\.,,g'`"
  70. ;;
  71. -rc | --rc | -RC | --RC )
  72. shift
  73. RC="rc$1"
  74. ;;
  75. -final | --final )
  76. RC=final
  77. ;;
  78. -triple | --triple )
  79. shift
  80. Triple="$1"
  81. ;;
  82. -configure-flags | --configure-flags )
  83. shift
  84. ExtraConfigureFlags="$1"
  85. ;;
  86. -j* )
  87. NumJobs="`echo $1 | sed -e 's,-j\([0-9]*\),\1,g'`"
  88. if [ -z "$NumJobs" ]; then
  89. shift
  90. NumJobs="$1"
  91. fi
  92. ;;
  93. -build-dir | --build-dir | -builddir | --builddir )
  94. shift
  95. BuildDir="$1"
  96. ;;
  97. -no-checkout | --no-checkout )
  98. do_checkout="no"
  99. ;;
  100. -test-debug | --test-debug )
  101. do_debug="yes"
  102. ;;
  103. -test-asserts | --test-asserts )
  104. do_asserts="yes"
  105. ;;
  106. -no-compare-files | --no-compare-files )
  107. do_compare="no"
  108. ;;
  109. -use-gzip | --use-gzip )
  110. use_gzip="yes"
  111. ;;
  112. -use-autoconf | --use-autoconf )
  113. use_autoconf="yes"
  114. ;;
  115. -no-rt )
  116. do_rt="no"
  117. ;;
  118. -no-libs )
  119. do_libs="no"
  120. ;;
  121. -no-libunwind )
  122. do_libunwind="no"
  123. ;;
  124. -no-test-suite )
  125. do_test_suite="no"
  126. ;;
  127. -openmp )
  128. do_openmp="yes"
  129. ;;
  130. -help | --help | -h | --h | -\? )
  131. usage
  132. exit 0
  133. ;;
  134. * )
  135. echo "unknown option: $1"
  136. usage
  137. exit 1
  138. ;;
  139. esac
  140. shift
  141. done
  142. # Check required arguments.
  143. if [ -z "$Release" ]; then
  144. echo "error: no release number specified"
  145. exit 1
  146. fi
  147. if [ -z "$RC" ]; then
  148. echo "error: no release candidate number specified"
  149. exit 1
  150. fi
  151. if [ -z "$Triple" ]; then
  152. echo "error: no target triple specified"
  153. exit 1
  154. fi
  155. # Figure out how many make processes to run.
  156. if [ -z "$NumJobs" ]; then
  157. NumJobs=`sysctl -n hw.activecpu 2> /dev/null || true`
  158. fi
  159. if [ -z "$NumJobs" ]; then
  160. NumJobs=`sysctl -n hw.ncpu 2> /dev/null || true`
  161. fi
  162. if [ -z "$NumJobs" ]; then
  163. NumJobs=`grep -c processor /proc/cpuinfo 2> /dev/null || true`
  164. fi
  165. if [ -z "$NumJobs" ]; then
  166. NumJobs=3
  167. fi
  168. # Projects list
  169. projects="llvm cfe clang-tools-extra"
  170. if [ $do_rt = "yes" ]; then
  171. projects="$projects compiler-rt"
  172. fi
  173. if [ $do_libs = "yes" ]; then
  174. projects="$projects libcxx libcxxabi"
  175. if [ $do_libunwind = "yes" ]; then
  176. projects="$projects libunwind"
  177. fi
  178. fi
  179. if [ $do_test_suite = "yes" ]; then
  180. projects="$projects test-suite"
  181. fi
  182. if [ $do_openmp = "yes" ]; then
  183. projects="$projects openmp"
  184. fi
  185. # Go to the build directory (may be different from CWD)
  186. BuildDir=$BuildDir/$RC
  187. mkdir -p $BuildDir
  188. cd $BuildDir
  189. # Location of log files.
  190. LogDir=$BuildDir/logs
  191. mkdir -p $LogDir
  192. # Final package name.
  193. Package=clang+llvm-$Release
  194. if [ $RC != "final" ]; then
  195. Package=$Package-$RC
  196. fi
  197. Package=$Package-$Triple
  198. # Errors to be highlighted at the end are written to this file.
  199. echo -n > $LogDir/deferred_errors.log
  200. function deferred_error() {
  201. Phase="$1"
  202. Flavor="$2"
  203. Msg="$3"
  204. echo "[${Flavor} Phase${Phase}] ${Msg}" | tee -a $LogDir/deferred_errors.log
  205. }
  206. # Make sure that a required program is available
  207. function check_program_exists() {
  208. local program="$1"
  209. if ! type -P $program > /dev/null 2>&1 ; then
  210. echo "program '$1' not found !"
  211. exit 1
  212. fi
  213. }
  214. if [ `uname -s` != "Darwin" ]; then
  215. check_program_exists 'chrpath'
  216. check_program_exists 'file'
  217. check_program_exists 'objdump'
  218. fi
  219. # Make sure that the URLs are valid.
  220. function check_valid_urls() {
  221. for proj in $projects ; do
  222. echo "# Validating $proj SVN URL"
  223. if ! svn ls $Base_url/$proj/tags/RELEASE_$Release_no_dot/$RC > /dev/null 2>&1 ; then
  224. echo "$proj $Release release candidate $RC doesn't exist!"
  225. exit 1
  226. fi
  227. done
  228. }
  229. # Export sources to the build directory.
  230. function export_sources() {
  231. check_valid_urls
  232. for proj in $projects ; do
  233. if [ -d $proj.src ]; then
  234. echo "# Reusing $proj $Release-$RC sources"
  235. continue
  236. fi
  237. echo "# Exporting $proj $Release-$RC sources"
  238. if ! svn export -q $Base_url/$proj/tags/RELEASE_$Release_no_dot/$RC $proj.src ; then
  239. echo "error: failed to export $proj project"
  240. exit 1
  241. fi
  242. done
  243. echo "# Creating symlinks"
  244. cd $BuildDir/llvm.src/tools
  245. if [ ! -h clang ]; then
  246. ln -s ../../cfe.src clang
  247. fi
  248. cd $BuildDir/llvm.src/tools/clang/tools
  249. if [ ! -h extra ]; then
  250. ln -s ../../../../clang-tools-extra.src extra
  251. fi
  252. cd $BuildDir/llvm.src/projects
  253. if [ -d $BuildDir/test-suite.src ] && [ ! -h test-suite ]; then
  254. ln -s ../../test-suite.src test-suite
  255. fi
  256. if [ -d $BuildDir/compiler-rt.src ] && [ ! -h compiler-rt ]; then
  257. ln -s ../../compiler-rt.src compiler-rt
  258. fi
  259. if [ -d $BuildDir/libcxx.src ] && [ ! -h libcxx ]; then
  260. ln -s ../../libcxx.src libcxx
  261. fi
  262. if [ -d $BuildDir/libcxxabi.src ] && [ ! -h libcxxabi ]; then
  263. ln -s ../../libcxxabi.src libcxxabi
  264. fi
  265. if [ -d $BuildDir/libunwind.src ] && [ ! -h libunwind ]; then
  266. ln -s ../../libunwind.src libunwind
  267. fi
  268. cd $BuildDir
  269. }
  270. function configure_llvmCore() {
  271. Phase="$1"
  272. Flavor="$2"
  273. ObjDir="$3"
  274. case $Flavor in
  275. Release )
  276. BuildType="Release"
  277. Assertions="OFF"
  278. ConfigureFlags="--enable-optimized --disable-assertions"
  279. ;;
  280. Release+Asserts )
  281. BuildType="Release"
  282. Assertions="ON"
  283. ConfigureFlags="--enable-optimized --enable-assertions"
  284. ;;
  285. Debug )
  286. BuildType="Debug"
  287. Assertions="ON"
  288. ConfigureFlags="--disable-optimized --enable-assertions"
  289. ;;
  290. * )
  291. echo "# Invalid flavor '$Flavor'"
  292. echo ""
  293. return
  294. ;;
  295. esac
  296. echo "# Using C compiler: $c_compiler"
  297. echo "# Using C++ compiler: $cxx_compiler"
  298. cd $ObjDir
  299. echo "# Configuring llvm $Release-$RC $Flavor"
  300. if [ "$use_autoconf" = "yes" ]; then
  301. echo "#" env CC="$c_compiler" CXX="$cxx_compiler" \
  302. $BuildDir/llvm.src/configure \
  303. $ConfigureFlags --disable-timestamps $ExtraConfigureFlags \
  304. 2>&1 | tee $LogDir/llvm.configure-Phase$Phase-$Flavor.log
  305. env CC="$c_compiler" CXX="$cxx_compiler" \
  306. $BuildDir/llvm.src/configure \
  307. $ConfigureFlags --disable-timestamps $ExtraConfigureFlags \
  308. 2>&1 | tee $LogDir/llvm.configure-Phase$Phase-$Flavor.log
  309. else
  310. echo "#" env CC="$c_compiler" CXX="$cxx_compiler" \
  311. cmake -G "Unix Makefiles" \
  312. -DCMAKE_BUILD_TYPE=$BuildType -DLLVM_ENABLE_ASSERTIONS=$Assertions \
  313. -DLLVM_ENABLE_TIMESTAMPS=OFF -DLLVM_CONFIGTIME="(timestamp not enabled)" \
  314. $ExtraConfigureFlags $BuildDir/llvm.src \
  315. 2>&1 | tee $LogDir/llvm.configure-Phase$Phase-$Flavor.log
  316. env CC="$c_compiler" CXX="$cxx_compiler" \
  317. cmake -G "Unix Makefiles" \
  318. -DCMAKE_BUILD_TYPE=$BuildType -DLLVM_ENABLE_ASSERTIONS=$Assertions \
  319. -DLLVM_ENABLE_TIMESTAMPS=OFF -DLLVM_CONFIGTIME="(timestamp not enabled)" \
  320. $ExtraConfigureFlags $BuildDir/llvm.src \
  321. 2>&1 | tee $LogDir/llvm.configure-Phase$Phase-$Flavor.log
  322. fi
  323. cd $BuildDir
  324. }
  325. function build_llvmCore() {
  326. Phase="$1"
  327. Flavor="$2"
  328. ObjDir="$3"
  329. DestDir="$4"
  330. cd $ObjDir
  331. echo "# Compiling llvm $Release-$RC $Flavor"
  332. echo "# ${MAKE} -j $NumJobs VERBOSE=1"
  333. ${MAKE} -j $NumJobs VERBOSE=1 \
  334. 2>&1 | tee $LogDir/llvm.make-Phase$Phase-$Flavor.log
  335. echo "# Installing llvm $Release-$RC $Flavor"
  336. echo "# ${MAKE} install"
  337. ${MAKE} install \
  338. DESTDIR="${DestDir}" \
  339. 2>&1 | tee $LogDir/llvm.install-Phase$Phase-$Flavor.log
  340. cd $BuildDir
  341. }
  342. function test_llvmCore() {
  343. Phase="$1"
  344. Flavor="$2"
  345. ObjDir="$3"
  346. cd $ObjDir
  347. if ! ( ${MAKE} -j $NumJobs -k check-all \
  348. 2>&1 | tee $LogDir/llvm.check-Phase$Phase-$Flavor.log ) ; then
  349. deferred_error $Phase $Flavor "check-all failed"
  350. fi
  351. if [ "$use_autoconf" = "yes" ]; then
  352. # In the cmake build, unit tests are run as part of check-all.
  353. if ! ( ${MAKE} -k unittests 2>&1 | \
  354. tee $LogDir/llvm.unittests-Phase$Phase-$Flavor.log ) ; then
  355. deferred_error $Phase $Flavor "unittests failed"
  356. fi
  357. fi
  358. cd $BuildDir
  359. }
  360. # Clean RPATH. Libtool adds the build directory to the search path, which is
  361. # not necessary --- and even harmful --- for the binary packages we release.
  362. function clean_RPATH() {
  363. if [ `uname -s` = "Darwin" ]; then
  364. return
  365. fi
  366. local InstallPath="$1"
  367. for Candidate in `find $InstallPath/{bin,lib} -type f`; do
  368. if file $Candidate | grep ELF | egrep 'executable|shared object' > /dev/null 2>&1 ; then
  369. if rpath=`objdump -x $Candidate | grep 'RPATH'` ; then
  370. rpath=`echo $rpath | sed -e's/^ *RPATH *//'`
  371. if [ -n "$rpath" ]; then
  372. newrpath=`echo $rpath | sed -e's/.*\(\$ORIGIN[^:]*\).*/\1/'`
  373. chrpath -r $newrpath $Candidate 2>&1 > /dev/null 2>&1
  374. fi
  375. fi
  376. fi
  377. done
  378. }
  379. # Create a package of the release binaries.
  380. function package_release() {
  381. cwd=`pwd`
  382. cd $BuildDir/Phase3/Release
  383. mv llvmCore-$Release-$RC.install/usr/local $Package
  384. if [ "$use_gzip" = "yes" ]; then
  385. tar cfz $BuildDir/$Package.tar.gz $Package
  386. else
  387. tar cfJ $BuildDir/$Package.tar.xz $Package
  388. fi
  389. mv $Package llvmCore-$Release-$RC.install/usr/local
  390. cd $cwd
  391. }
  392. # Build and package the OpenMP run-time. This is still experimental and not
  393. # meant for official testing in the release, but as a way for providing
  394. # binaries as a convenience to those who want to try it out.
  395. function build_OpenMP() {
  396. cwd=`pwd`
  397. rm -rf $BuildDir/Phase3/openmp
  398. rm -rf $BuildDir/Phase3/openmp.install
  399. mkdir -p $BuildDir/Phase3/openmp
  400. cd $BuildDir/Phase3/openmp
  401. clang=$BuildDir/Phase3/Release/llvmCore-$Release-$RC.install/usr/local/bin/clang
  402. echo "#" cmake -DCMAKE_C_COMPILER=${clang} -DCMAKE_CXX_COMPILER=${clang}++ \
  403. -DCMAKE_BUILD_TYPE=Release -DLIBOMP_MICRO_TESTS=on \
  404. $BuildDir/openmp.src/runtime
  405. cmake -DCMAKE_C_COMPILER=${clang} -DCMAKE_CXX_COMPILER=${clang}++ \
  406. -DCMAKE_BUILD_TYPE=Release -DLIBOMP_MICRO_TESTS=on \
  407. $BuildDir/openmp.src/runtime
  408. echo "# Building OpenMP run-time"
  409. echo "# ${MAKE} -j $NumJobs VERBOSE=1"
  410. ${MAKE} -j $NumJobs VERBOSE=1
  411. echo "# ${MAKE} libomp-micro-tests VERBOSE=1"
  412. ${MAKE} libomp-micro-tests VERBOSE=1
  413. echo "# ${MAKE} install DESTDIR=$BuildDir/Phase3/openmp.install"
  414. ${MAKE} install DESTDIR=$BuildDir/Phase3/openmp.install
  415. OpenMPPackage=OpenMP-$Release
  416. if [ $RC != "final" ]; then
  417. OpenMPPackage=$OpenMPPackage-$RC
  418. fi
  419. OpenMPPackage=$OpenMPPackage-$Triple
  420. mv $BuildDir/Phase3/openmp.install/usr/local $BuildDir/$OpenMPPackage
  421. cd $BuildDir
  422. tar cvfJ $BuildDir/$OpenMPPackage.tar.xz $OpenMPPackage
  423. mv $OpenMPPackage $BuildDir/Phase3/openmp.install/usr/local
  424. cd $cwd
  425. }
  426. # Exit if any command fails
  427. # Note: pipefail is necessary for running build commands through
  428. # a pipe (i.e. it changes the output of ``false | tee /dev/null ; echo $?``)
  429. set -e
  430. set -o pipefail
  431. if [ "$do_checkout" = "yes" ]; then
  432. export_sources
  433. fi
  434. (
  435. Flavors="Release"
  436. if [ "$do_debug" = "yes" ]; then
  437. Flavors="Debug $Flavors"
  438. fi
  439. if [ "$do_asserts" = "yes" ]; then
  440. Flavors="$Flavors Release+Asserts"
  441. fi
  442. for Flavor in $Flavors ; do
  443. echo ""
  444. echo ""
  445. echo "********************************************************************************"
  446. echo " Release: $Release-$RC"
  447. echo " Build: $Flavor"
  448. echo " System Info: "
  449. echo " `uname -a`"
  450. echo "********************************************************************************"
  451. echo ""
  452. c_compiler="$CC"
  453. cxx_compiler="$CXX"
  454. llvmCore_phase1_objdir=$BuildDir/Phase1/$Flavor/llvmCore-$Release-$RC.obj
  455. llvmCore_phase1_destdir=$BuildDir/Phase1/$Flavor/llvmCore-$Release-$RC.install
  456. llvmCore_phase2_objdir=$BuildDir/Phase2/$Flavor/llvmCore-$Release-$RC.obj
  457. llvmCore_phase2_destdir=$BuildDir/Phase2/$Flavor/llvmCore-$Release-$RC.install
  458. llvmCore_phase3_objdir=$BuildDir/Phase3/$Flavor/llvmCore-$Release-$RC.obj
  459. llvmCore_phase3_destdir=$BuildDir/Phase3/$Flavor/llvmCore-$Release-$RC.install
  460. rm -rf $llvmCore_phase1_objdir
  461. rm -rf $llvmCore_phase1_destdir
  462. rm -rf $llvmCore_phase2_objdir
  463. rm -rf $llvmCore_phase2_destdir
  464. rm -rf $llvmCore_phase3_objdir
  465. rm -rf $llvmCore_phase3_destdir
  466. mkdir -p $llvmCore_phase1_objdir
  467. mkdir -p $llvmCore_phase1_destdir
  468. mkdir -p $llvmCore_phase2_objdir
  469. mkdir -p $llvmCore_phase2_destdir
  470. mkdir -p $llvmCore_phase3_objdir
  471. mkdir -p $llvmCore_phase3_destdir
  472. ############################################################################
  473. # Phase 1: Build llvmCore and clang
  474. echo "# Phase 1: Building llvmCore"
  475. configure_llvmCore 1 $Flavor $llvmCore_phase1_objdir
  476. build_llvmCore 1 $Flavor \
  477. $llvmCore_phase1_objdir $llvmCore_phase1_destdir
  478. clean_RPATH $llvmCore_phase1_destdir/usr/local
  479. ########################################################################
  480. # Phase 2: Build llvmCore with newly built clang from phase 1.
  481. c_compiler=$llvmCore_phase1_destdir/usr/local/bin/clang
  482. cxx_compiler=$llvmCore_phase1_destdir/usr/local/bin/clang++
  483. echo "# Phase 2: Building llvmCore"
  484. configure_llvmCore 2 $Flavor $llvmCore_phase2_objdir
  485. build_llvmCore 2 $Flavor \
  486. $llvmCore_phase2_objdir $llvmCore_phase2_destdir
  487. clean_RPATH $llvmCore_phase2_destdir/usr/local
  488. ########################################################################
  489. # Phase 3: Build llvmCore with newly built clang from phase 2.
  490. c_compiler=$llvmCore_phase2_destdir/usr/local/bin/clang
  491. cxx_compiler=$llvmCore_phase2_destdir/usr/local/bin/clang++
  492. echo "# Phase 3: Building llvmCore"
  493. configure_llvmCore 3 $Flavor $llvmCore_phase3_objdir
  494. build_llvmCore 3 $Flavor \
  495. $llvmCore_phase3_objdir $llvmCore_phase3_destdir
  496. clean_RPATH $llvmCore_phase3_destdir/usr/local
  497. ########################################################################
  498. # Testing: Test phase 3
  499. echo "# Testing - built with clang"
  500. test_llvmCore 3 $Flavor $llvmCore_phase3_objdir
  501. ########################################################################
  502. # Compare .o files between Phase2 and Phase3 and report which ones
  503. # differ.
  504. if [ "$do_compare" = "yes" ]; then
  505. echo
  506. echo "# Comparing Phase 2 and Phase 3 files"
  507. for p2 in `find $llvmCore_phase2_objdir -name '*.o'` ; do
  508. p3=`echo $p2 | sed -e 's,Phase2,Phase3,'`
  509. # Substitute 'Phase2' for 'Phase3' in the Phase 2 object file in
  510. # case there are build paths in the debug info. On some systems,
  511. # sed adds a newline to the output, so pass $p3 through sed too.
  512. if ! cmp -s <(sed -e 's,Phase2,Phase3,g' $p2) <(sed -e '' $p3) \
  513. 16 16 ; then
  514. echo "file `basename $p2` differs between phase 2 and phase 3"
  515. fi
  516. done
  517. fi
  518. done
  519. if [ $do_openmp = "yes" ]; then
  520. build_OpenMP
  521. fi
  522. ) 2>&1 | tee $LogDir/testing.$Release-$RC.log
  523. package_release
  524. set +e
  525. # Woo hoo!
  526. echo "### Testing Finished ###"
  527. if [ "$use_gzip" = "yes" ]; then
  528. echo "### Package: $Package.tar.gz"
  529. else
  530. echo "### Package: $Package.tar.xz"
  531. fi
  532. echo "### Logs: $LogDir"
  533. echo "### Errors:"
  534. if [ -s "$LogDir/deferred_errors.log" ]; then
  535. cat "$LogDir/deferred_errors.log"
  536. exit 1
  537. else
  538. echo "None."
  539. fi
  540. exit 0