run_tests.sh 5.2 KB

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