run_tests.sh 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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. if test -n "${BOOST_BUILD_PATH}" ; then
  72. BOOST_BUILD_PATH="$boost_build_path:$BOOST_BUILD_PATH"
  73. else
  74. BOOST_BUILD_PATH="$boost_build_path"
  75. fi
  76. export BOOST_BUILD_PATH
  77. #
  78. # STEP 0:
  79. #
  80. # Get the source code:
  81. #
  82. if test ! -d "$boost_root" ; then
  83. mkdir -p "$boost_root"
  84. if test $? -ne 0 ; then
  85. echo "creation of $boost_root directory failed."
  86. exit 256
  87. fi
  88. fi
  89. if test $cvs_update = yes ; then
  90. echo fetching Boost:
  91. echo "/1 :pserver:anonymous@cvs.sourceforge.net:2401/cvsroot/boost A" >> "$HOME/.cvspass"
  92. cat "$HOME/.cvspass" | sort | uniq > "$HOME/.cvspass"
  93. cd `dirname "$boost_root"`
  94. if test -f boost/CVS/Root ; then
  95. cvs -z3 -d `cat "$boost_dir/CVS/Root"` co -d "$boost_dir" boost
  96. else
  97. cvs -z3 -d :pserver:anonymous@cvs.sourceforge.net:2401/cvsroot/boost co -d "$boost_dir" boost
  98. fi
  99. fi
  100. #
  101. # STEP 1:
  102. # rebuild bjam if required:
  103. #
  104. echo building bjam:
  105. cd "$boost_root/tools/build/jam_src" && \
  106. LOCATE_TARGET=bin sh ./build.sh
  107. if test $? != 0 ; then
  108. echo "bjam build failed."
  109. exit 256
  110. fi
  111. #
  112. # STEP 2:
  113. # rebuild the regression test helper programs if required:
  114. #
  115. echo building regression test helper programs:
  116. cd "$boost_root/tools/regression/build" && \
  117. "$bjam" -sTOOLS=$toolset -sBUILD=release run
  118. if test $? != 0 ; then
  119. echo "helper program build failed."
  120. exit 256
  121. fi
  122. #
  123. # STEP 5:
  124. # repeat steps 3 and 4 for each additional toolset:
  125. #
  126. for tool in $test_tools ; do
  127. #
  128. # STEP 3:
  129. # run the regression tests:
  130. #
  131. echo running the $tool regression tests:
  132. cd "$boost_root/status"
  133. "$bjam" -sTOOLS=$tool --dump-tests test 2>&1 | tee regress.log
  134. #
  135. # STEP 4:
  136. # post process the results:
  137. #
  138. echo processing the regression test results for $tool:
  139. cat regress.log | "$process_jam_log"
  140. if test $? != 0 ; then
  141. echo "Failed regression log post processing."
  142. exit 256
  143. fi
  144. done
  145. #
  146. # STEP 6:
  147. # create the html table:
  148. #
  149. uname=`uname`
  150. echo generating html tables:
  151. "$compiler_status" --comment "$comment_path" "$boost_root" cs-$uname.html cs-$uname-links.html
  152. if test $? != 0 ; then
  153. echo "Failed HTML result table generation."
  154. exit 256
  155. fi
  156. echo "done!"
粤ICP备19079148号