|
From: <ai...@us...> - 2010-10-22 00:07:31
|
Revision: 11266
http://plplot.svn.sourceforge.net/plplot/?rev=11266&view=rev
Author: airwin
Date: 2010-10-22 00:07:24 +0000 (Fri, 22 Oct 2010)
Log Message:
-----------
Improve organization of script, naming of options, and parsing of
cmake_added_options. Add generator_string option.
Modified Paths:
--------------
trunk/scripts/comprehensive_test.sh
Modified: trunk/scripts/comprehensive_test.sh
===================================================================
--- trunk/scripts/comprehensive_test.sh 2010-10-21 19:07:37 UTC (rev 11265)
+++ trunk/scripts/comprehensive_test.sh 2010-10-22 00:07:24 UTC (rev 11266)
@@ -13,14 +13,12 @@
local prog=`basename $0`
echo "Usage: $prog [OPTIONS]
OPTIONS:
- This next option is mandatory.
- [--build_command (e.g., 'make -j4' or 'nmake')]
- The next four control what kind of build is tested.
- [--cmake_added_options (defaults to no additional cmake options, but this
- shell option can be used to supply additional cmake
- options to, e.g, specify the cmake generator or
- refine what parts of the PLplot software are
- built and tested)
+ The next five control what kind of build is tested.
+ [--generator_string (defaults to 'Unix Makefiles')]
+ [--cmake_added_options (defaults to none, but can be used to specify any
+ combination of white-space-separated cmake options
+ to, e.g., refine what parts of the PLplot software are
+ built and tested)]
[--do_shared (yes/no, defaults to yes)]
[--do_nondynamic (yes/no, defaults to yes)]
[--do_static (yes/no, defaults to yes)]
@@ -28,24 +26,28 @@
The next six control which of seven kinds of tests are done for
each kind of build.
[--do_ctest (yes/no, defaults to yes)]
- [--do_noninteractive_test (yes/no, defaults to yes)]
- [--do_interactive_test (yes/no, defaults to yes)]
- [--do_build_tree_test (yes/no, defaults to yes)]
- [--do_install_tree_test (yes/no, defaults to yes)]
- [--do_traditional_tree_test (yes/no, defaults to yes)]
+ [--do_test_noninteractive (yes/no, defaults to yes)]
+ [--do_test_interactive (yes/no, defaults to yes)]
+ [--do_test_build_tree (yes/no, defaults to yes)]
+ [--do_test_install_tree (yes/no, defaults to yes)]
+ [--do_test_traditional_install_tree (yes/no, defaults to yes)]
+ The next option controls what command is used for the build(s).
+ [--build_command (defaults to 'make -j4')]
+
[--help] Show this message.
"
exit $1
}
comprehensive_test () {
+ CMAKE_BUILD_TYPE_OPTION=$1
echo "
Running comprehensive_test function with the following variables set:
The variables below are key CMake options which determine the entire
kind of build that will be tested.
-\$1 = $1
+CMAKE_BUILD_TYPE_OPTION = $CMAKE_BUILD_TYPE_OPTION
The location below is where all the important *.out files will be found.
OUTPUT_TREE = $OUTPUT_TREE
@@ -66,81 +68,88 @@
rm -rf "$BUILD_TREE"
mkdir -p "$BUILD_TREE"
cd "$BUILD_TREE"
- if [ "$do_ctest" = "yes" -o "$do_build_tree_test" = "yes" ] ; then
+ if [ "$do_ctest" = "yes" -o "$do_test_build_tree" = "yes" ] ; then
BUILD_TEST_OPTION="-DBUILD_TEST=ON"
else
BUILD_TEST_OPTION=""
fi
output="$OUTPUT_TREE"/cmake.out
rm -f "$output"
+ #Process $cmake_added_options into $*
+ set -- $cmake_added_options
echo "cmake in the build tree"
cmake "-DCMAKE_INSTALL_PREFIX=$INSTALL_TREE" $BUILD_TEST_OPTION \
- "$cmake_added_options" $1 "$SOURCE_TREE" >& "$output"
+ $* $CMAKE_BUILD_TYPE_OPTION -G "$generator_string" \
+ "$SOURCE_TREE" >& "$output"
cmake_rc=$?
if [ "$cmake_rc" -eq 0 ] ; then
- if [ "$do_build_tree_test" = "yes" -a "$do_noninteractive_test" = "yes" ] ; then
+ if [ "$do_test_build_tree" = "yes" -a "$do_test_noninteractive" = "yes" ] ; then
output="$OUTPUT_TREE"/make_noninteractive.out
rm -f "$output"
echo "$build_command test_noninteractive in the build tree"
$build_command VERBOSE=1 test_noninteractive >& "$output"
fi
- rm -rf "$INSTALL_TREE"
- output="$OUTPUT_TREE"/make_install.out
- rm -f "$output"
- echo "$build_command install in the build tree"
- $build_command VERBOSE=1 install >& "$output"
- make_install_rc=$?
- if [ "$make_install_rc" -eq 0 ] ; then
- PATH="$INSTALL_TREE/bin":$PATH
- if [ "$do_ctest" = "yes" ] ; then
- output="$OUTPUT_TREE"/ctest.out
- rm -f "$output"
- echo "launch ctest job in the build tree"
- ctest --extra-verbose >& "$output" &
- fi
- if [ "$do_install_tree_test" = "yes" ] ; then
- rm -rf "$INSTALL_BUILD_TREE"
- mkdir -p "$INSTALL_BUILD_TREE"
- cd "$INSTALL_BUILD_TREE"
- output="$OUTPUT_TREE"/installed_cmake.out
- rm -f "$output"
- echo "cmake in the installed examples build tree"
- cmake "$INSTALL_TREE"/share/plplot?.?.?/examples >& "$output"
- if [ "$do_noninteractive_test" = "yes" ] ; then
- output="$OUTPUT_TREE"/installed_make_noninteractive.out
+ if [ "$do_ctest" = "yes" -o \
+ "$do_test_install_tree" = "yes" -o \
+ "$do_test_traditional_install_tree" = "yes" ] ; then
+ rm -rf "$INSTALL_TREE"
+ output="$OUTPUT_TREE"/make_install.out
+ rm -f "$output"
+ echo "$build_command install in the build tree"
+ $build_command VERBOSE=1 install >& "$output"
+ make_install_rc=$?
+ if [ "$make_install_rc" -eq 0 ] ; then
+ PATH="$INSTALL_TREE/bin":$PATH
+ if [ "$do_ctest" = "yes" ] ; then
+ output="$OUTPUT_TREE"/ctest.out
rm -f "$output"
- echo "$build_command test_noninteractive in the installed examples build tree"
- $build_command VERBOSE=1 test_noninteractive >& "$output"
+ echo "launch ctest job in the build tree"
+ ctest --extra-verbose >& "$output" &
fi
+ if [ "$do_test_install_tree" = "yes" ] ; then
+ rm -rf "$INSTALL_BUILD_TREE"
+ mkdir -p "$INSTALL_BUILD_TREE"
+ cd "$INSTALL_BUILD_TREE"
+ output="$OUTPUT_TREE"/installed_cmake.out
+ rm -f "$output"
+ echo "cmake in the installed examples build tree"
+ cmake "$INSTALL_TREE"/share/plplot?.?.?/examples >& "$output"
+ if [ "$do_test_noninteractive" = "yes" ] ; then
+ output="$OUTPUT_TREE"/installed_make_noninteractive.out
+ rm -f "$output"
+ echo "$build_command test_noninteractive in the installed examples build tree"
+ $build_command VERBOSE=1 test_noninteractive >& "$output"
+ fi
+ fi
+ if [ "$do_test_traditional_install_tree" = "yes" -a "$do_test_noninteractive" = "yes" ] ; then
+ cd "$INSTALL_TREE"/share/plplot?.?.?/examples
+ output="$OUTPUT_TREE"/traditional_make_noninteractive.out
+ rm -f "$output"
+ echo "Traditional $build_command test_noninteractive in the installed examples tree"
+ $build_command test_noninteractive >& "$output"
+ fi
+ else
+ echo "ERROR: $build_command install failed"
+ exit 1
fi
- if [ "$do_traditional_tree_test" = "yes" -a "$do_noninteractive_test" = "yes" ] ; then
- cd "$INSTALL_TREE"/share/plplot?.?.?/examples
- output="$OUTPUT_TREE"/traditional_make_noninteractive.out
- rm -f "$output"
- echo "Traditional $build_command test_noninteractive in the installed examples tree"
- $build_command test_noninteractive >& "$output"
- fi
- else
- echo "ERROR: $build_command install failed"
- exit 1
fi
- if [ "$do_interactive_test" = "yes" ] ; then
- if [ "$do_build_tree_test" = "yes" ] ; then
+ if [ "$do_test_interactive" = "yes" ] ; then
+ if [ "$do_test_build_tree" = "yes" ] ; then
cd "$BUILD_TREE"
output="$OUTPUT_TREE"/make_interactive.out
rm -f "$output"
echo "$build_command test_interactive in the build tree"
$build_command VERBOSE=1 test_interactive >& "$output"
fi
- if [ "$do_install_tree_test" = "yes" ] ; then
+ if [ "$do_test_install_tree" = "yes" ] ; then
cd "$INSTALL_BUILD_TREE"
output="$OUTPUT_TREE"/installed_make_interactive.out
rm -f "$output"
echo "$build_command test_interactive in the installed examples build tree"
$build_command VERBOSE=1 test_interactive >& "$output"
fi
- if [ "$do_traditional_tree_test" = "yes" ] ; then
+ if [ "$do_test_traditional_install_tree" = "yes" ] ; then
cd "$INSTALL_TREE"/share/plplot?.?.?/examples
output="$OUTPUT_TREE"/traditional_make_interactive.out
rm -f "$output"
@@ -154,25 +163,27 @@
fi
}
-build_command=
+# Default values for options
+generator_string="Unix Makefiles"
cmake_added_options=
do_shared=yes
do_nondynamic=yes
do_static=yes
-# These control which of 7 tests that are run.
do_ctest=yes
-do_noninteractive_test=yes
-do_interactive_test=yes
-do_build_tree_test=yes
-do_install_tree_test=yes
-do_traditional_tree_test=yes
+do_test_noninteractive=yes
+do_test_interactive=yes
+do_test_build_tree=yes
+do_test_install_tree=yes
+do_test_traditional_install_tree=yes
+build_command="make -j4"
+
while test $# -gt 0; do
case $1 in
- --build_command)
- build_command=$2
+ --generator_string)
+ generator_string=$2
shift
;;
--cmake_added_options)
@@ -224,10 +235,10 @@
;;
esac
;;
- --do_noninteractive_test)
+ --do_test_noninteractive)
case $2 in
yes|no)
- do_noninteractive_test=$2
+ do_test_noninteractive=$2
shift
;;
*)
@@ -235,10 +246,10 @@
;;
esac
;;
- --do_interactive_test)
+ --do_test_interactive)
case $2 in
yes|no)
- do_interactive_test=$2
+ do_test_interactive=$2
shift
;;
*)
@@ -246,10 +257,10 @@
;;
esac
;;
- --do_build_tree_test)
+ --do_test_build_tree)
case $2 in
yes|no)
- do_build_tree_test=$2
+ do_test_build_tree=$2
shift
;;
*)
@@ -257,10 +268,10 @@
;;
esac
;;
- --do_install_tree_test)
+ --do_test_install_tree)
case $2 in
yes|no)
- do_install_tree_test=$2
+ do_test_install_tree=$2
shift
;;
*)
@@ -268,10 +279,10 @@
;;
esac
;;
- --do_traditional_tree_test)
+ --do_test_traditional_install_tree)
case $2 in
yes|no)
- do_traditional_tree_test=$2
+ do_test_traditional_install_tree=$2
shift
;;
*)
@@ -279,6 +290,10 @@
;;
esac
;;
+ --build_command)
+ build_command=$2
+ shift
+ ;;
--help)
usage 0 1>&2
;;
@@ -289,40 +304,26 @@
shift
done
-if [ -z "$build_command" ] ; then
- echo "--build_command option is mandatory!"
- usage 1 1>&2
-fi
-
echo "Summary of options used for these tests
-This variable set as a result of the one mandatory --build_command option.
-build_command = $build_command
-
-This/these cmake option(s) added for all builds
+generator_string = $generator_string
cmake_added_options = $cmake_added_options
-The next three control whether builds with shared libraries/dynamic
-drivers; shared_libraries/nondynamic drivers; and/or static
-libraries/nondynamic drivers are tested
do_shared = $do_shared
do_nondynamic = $do_nondynamic
do_static = $do_static
-Run the ctest test?
do_ctest = $do_ctest
-The next two control whether noninteractive and/or interactive tests are
-performed for the next three kinds of tests
-do_noninteractive_test = $do_noninteractive_test
-do_interactive_test = $do_interactive_test
+do_test_noninteractive = $do_test_noninteractive
+do_test_interactive = $do_test_interactive
-The next three control whether build tree examples, installed examples
-with CMake-based build system, and/or installed examples with
-traditional (Makefile + pkg-config) build system tests are run.
-do_build_tree_test = $do_build_tree_test
-do_install_tree_test = $do_install_tree_test
-do_traditional_tree_test = $do_traditional_tree_test
+do_test_build_tree = $do_test_build_tree
+do_test_install_tree = $do_test_install_tree
+do_test_traditional_install_tree = $do_test_traditional_install_tree
+
+build_command = $build_command
+
"
ANSWER=
while [ "$ANSWER" != "yes" -a "$ANSWER" != "no" ] ; do
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|