run_tests.sh 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. #!/bin/sh
  2. #
  3. # shell script for running the boost regression test suite and generating
  4. # a html table of results.
  5. # Set the following variables to configure the operation. Variables you
  6. # should set, i.e. usually required are listed first. Optional variables
  7. # have reasonable defaults for most situations.
  8. ### THESE SHOULD BE CHANGED!
  9. #
  10. # "boost_root" points to the root of you boost installation:
  11. # This can be either a non-exitent directory or an already complete Boost
  12. # source tree.
  13. #
  14. boost_root=$HOME/CVSROOTs/Boost/boost_regression
  15. #
  16. # Wether to fetch the most current Boost code from CVS (yes/no):
  17. # There are two contexts to use this script in: on an active Boost CVS
  18. # tree, and on a fresh Boost CVS tree. If "yes" is specified here an attempt
  19. # to fetch the latest CVS Boost files is made. For an active Boost CVS
  20. # the CVS connection information is used. If an empty tree is detected
  21. # the code is fetched with the anonymous read only information.
  22. #
  23. cvs_update=no
  24. #
  25. # "test_tools" are the Boost.Build toolsets to use for building and running the
  26. # regression tests. Specify a space separated list, of the Boost.Build toolsets.
  27. # Each will be built and tested in sequence.
  28. #
  29. test_tools=gcc
  30. #
  31. # "toolset" is the Boost.Build toolset to use for building the helper programs.
  32. # This is usually different than the toolsets one is testing. And this is
  33. # normally a toolset that corresponds to the compiler built into your platform.
  34. #
  35. toolset=gcc
  36. #
  37. # "comment_path" is the path to an html-file describing the test environment.
  38. # The content of this file will be embedded in the status pages being produced.
  39. #
  40. comment_path=$boost_root/../regression_comment.html
  41. ### DEFAULTS ARE OK FOR THESE.
  42. #
  43. # "exe_suffix" the suffix used by exectable files:
  44. # In case your platform requires use of a special suffix for executables specify
  45. # it here, including the "." if needed. This should not be needed even in Windows
  46. # like platforms as they will execute without the suffix anyway.
  47. #
  48. exe_suffix=
  49. #
  50. # "bjam" points to your built bjam executable:
  51. # The location of the binary for running bjam. The default should work
  52. # under most circumstances.
  53. #
  54. bjam=$boost_root/tools/build/jam_src/bin/bjam$exe_suffix
  55. #
  56. # "process_jam_log", and "compiler_status" paths to built helper programs:
  57. # The location of the executables of the regression help programs. These
  58. # are built locally so the default should work in most situations.
  59. #
  60. process_jam_log=$boost_root/tools/regression/build/run/process_jam_log$exe_suffix
  61. compiler_status=$boost_root/tools/regression/build/run/compiler_status$exe_suffix
  62. #
  63. # "boost_build_path" can point to additional locations to find toolset files.
  64. #
  65. boost_build_path=$HOME/.boost-build
  66. ### NO MORE CONFIGURABLE PARTS.
  67. #
  68. # Some setup.
  69. #
  70. boost_dir=`basename $boost_root`
  71. export BOOST_BUILD_PATH=$boost_build_path $BOOST_BUILD_PATH
  72. #
  73. # STEP 0:
  74. #
  75. # Get the source code:
  76. #
  77. if test ! -d $boost_root ; then
  78. mkdir -p $boost_root
  79. if test $? -ne 0 ; then
  80. echo "creation of $boost_root directory failed."
  81. exit 256
  82. fi
  83. fi
  84. if test $cvs_update = yes ; then
  85. echo fetching Boost:
  86. echo "/1 :pserver:anonymous@cvs.sourceforge.net:2401/cvsroot/boost A" >> $HOME/.cvspass
  87. cat $HOME/.cvspass | sort | uniq > $HOME/.cvspass
  88. cd `dirname $boost_root`
  89. if test -f boost/CVS/Root ; then
  90. cvs -z3 -d `cat $boost_dir/CVS/Root` co -d $boost_dir boost
  91. else
  92. cvs -z3 -d :pserver:anonymous@cvs.sourceforge.net:2401/cvsroot/boost co -d $boost_dir boost
  93. fi
  94. fi
  95. #
  96. # STEP 1:
  97. # rebuild bjam if required:
  98. #
  99. echo building bjam:
  100. cd $boost_root/tools/build/jam_src && \
  101. LOCATE_TARGET=bin sh ./build.sh
  102. if test $? != 0 ; then
  103. echo "bjam build failed."
  104. exit 256
  105. fi
  106. #
  107. # STEP 2:
  108. # rebuild the regression test helper programs if required:
  109. #
  110. echo building regression test helper programs:
  111. cd $boost_root/tools/regression/build && \
  112. $bjam -sTOOLS=$toolset -sBUILD=release run
  113. if test $? != 0 ; then
  114. echo "helper program build failed."
  115. exit 256
  116. fi
  117. #
  118. # STEP 5:
  119. # repeat steps 3 and 4 for each additional toolset:
  120. #
  121. for tool in $test_tools ; do
  122. #
  123. # STEP 3:
  124. # run the regression tests:
  125. #
  126. echo running the $tool regression tests:
  127. cd $boost_root/status
  128. $bjam -sTOOLS=$tool --dump-tests test 2>&1 | tee regress.log
  129. #
  130. # STEP 4:
  131. # post process the results:
  132. #
  133. echo processing the regression test results for $tool:
  134. cat regress.log | $process_jam_log
  135. if test $? != 0 ; then
  136. echo "Failed regression log post processing."
  137. exit 256
  138. fi
  139. done
  140. #
  141. # STEP 6:
  142. # create the html table:
  143. #
  144. uname=`uname`
  145. echo generating html tables:
  146. $compiler_status --comment $comment_path $boost_root cs-$uname.html cs-$uname-links.html
  147. if test $? != 0 ; then
  148. echo "Failed HTML result table generation."
  149. exit 256
  150. fi
  151. echo "done!"
粤ICP备19079148号