run_tests.sh 4.8 KB

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