completed transitioning, docs reflect that too

This commit is contained in:
George Danchev 2011-07-08 14:18:54 +00:00
parent 33475cd1cf
commit 83adbde947
4 changed files with 137 additions and 102 deletions

View File

@ -6,24 +6,20 @@ Release Engineering
Alternatively, use latest all-in-one development tarball from: Alternatively, use latest all-in-one development tarball from:
http://www.gnu.org/software/xorriso/ http://www.gnu.org/software/xorriso/
* SETUP THE TEST ENVIRONMENT * SETUP THE TEST ENVIRONMENT AND RUN THE TEST SUITE
+ Not all TESTs are scripts (e.g. cppcheck, valgrind) + All tests have to be run from the releng/ directory, within
+ Copy all SCRIPT.conf.template to $HOME/.libburnia-releng/SCRIPT.conf libisoburn source tree. There is a 'master' script called
+ Read the configuration files and set up accordingly to your needs run_all_releng, which runs all scripts prefixed with releng_*.
+ Any releng_* script can be run on its own, regardless.
+ All scripts support -h, -help, --help and
print usage help when run without options.
* DELIVERING A NEW TEST SCRIPT * DELIVERING A NEW TEST SCRIPT
+ Start a new test script over the top of template_new_releng + Start a new test script over the top of template_new_releng
+ All filenames start with releng_ prefix + All filenames start with releng_ prefix
+ Self generated data are to be stored in + Self generated data are to be stored in
./releng_generated_data/scriptname/ directory ./releng_generated_data/scriptname/ directory
+ Test data generation options -rc [-keep] + Keep the newly added script options in sync with other scripts
+ Test data removal options -cleanup
+ Well documented configuration file SCRIPT.conf.template
+ Throw FAIL string to stdout if any failure is detected + Throw FAIL string to stdout if any failure is detected
+ Return exit code 0 on success, non-zero on failure + Return exit code 0 on success, non-zero on failure
+ Use different exit codes for any failure (range 0-31) + Use different exit codes for any failure (range 0-31)
* RUNNING TESTS
+ All tests have to be run from the releng/ directory, within
libisoburn source tree. Ther is a 'master' script called
run_all_releng, which runs all scripts prefixed with releng_*.

View File

@ -2,90 +2,111 @@
set -e set -e
START_DIR_DONT_CHANGE=`pwd` # Include common bits
SELF=$(basename "$0") . inc/releng_getopts.inc
# required config items
RELENG_XORRISO=""
RELENG_GENISOIMAGE=/usr/bin/genisoimage
RELENG_MKISOFS=/usr/bin/mkisofs
# config file # Each releng_ test should decide whether or not it need
CONFFILE=${HOME}/.libburnia-releng/${SELF}.conf # a xorriso binary to test, since some do compilations only.
GEN_DATA_DIR=releng_generated_data/${SELF} if [ ! -x $RELENG_XORRISO ]; then
print_help
UPPER=40 printf "\n${SELF}: -x absolute or relative path to binary to be run.\n\n"
KEEP=0 exit 31
#####################################################################
print_help() {
cat << HLP
Usage:
$0 -help
# using a config file ${CONFFILE}
$0 -rc [-keep]
# without using a config file
$0 xorriso_cmd
# cleanup test generated data directory and exit
$0 -cleanup
HLP
}
#####################################################################
# cleanup
if [ "${1}" == "-cleanup" ]; then
cd "${START_DIR_DONT_CHANGE}" || exit 2
if [ -d "${GEN_DATA_DIR}" ]; then
rm -rf ${GEN_DATA_DIR}
printf "${SELF}: removed %s\n" ${GEN_DATA_DIR}
else
printf "${SELF}: ${GEN_DATA_DIR} does not exist.\n"
fi
exit 0
fi fi
# help # check data dir, if any and after checking -x xorriso
if [ ! "${1}" ]; then print_help && exit 3; fi
# config file
if [ "${1}" == "-rc" ]; then
if [ -e ${CONFFILE} ]; then
. ${CONFFILE}
printf "${SELF}: Using config file %s\n" ${CONFFILE}
else
echo -e "\n${SELF}: Config file ${CONFFILE} not found.\n" && exit 4
fi
if [ "${2}" == "-keep" ]; then KEEP=1; fi
# command line args
elif [ "${1}" ]; then
RELENG_XORRISO="${1}"
if [ "${2}" == "-keep" ]; then KEEP=1; fi
# the rest
else
print_help && exit 5
fi
# data dir
if [ -d "${GEN_DATA_DIR}" ]; then if [ -d "${GEN_DATA_DIR}" ]; then
printf "\n${SELF}: directory %s exists!" ${GEN_DATA_DIR} printf "\n${SELF}: directory %s exists!" ${GEN_DATA_DIR}
printf "\n${SELF}: use '${SELF} -cleanup' to remove.\n" printf "\n${SELF}: use '${SELF} -c1' to remove.\n"
exit 6 exit 8
else else
mkdir "${GEN_DATA_DIR}" mkdir "${GEN_DATA_DIR}"
fi fi
if [ "${RELENG_XORRISO}" == "" ]; then #START_DIR_DONT_CHANGE=`pwd`
echo -e "\n${SELF}: xorriso_cmd is required\n" #SELF=$(basename "$0")
exit 7 # required config items
fi #RELENG_XORRISO=""
if [ ! -x "${RELENG_XORRISO}" ]; then RELENG_GENISOIMAGE=/usr/bin/genisoimage
printf "${SELF}: Not found or not an executable: $RELENG_XORRISO\n" RELENG_MKISOFS=/usr/bin/mkisofs
exit 8
fi
# all must be set at this point # config file
# CONFFILE=${HOME}/.libburnia-releng/${SELF}.conf
# GEN_DATA_DIR=releng_generated_data/${SELF}
UPPER=40
# KEEP=0
#####################################################################
#print_help() {
# cat << HLP
#Usage:
# $0 -help
# using a config file ${CONFFILE}
# $0 -rc [-keep]
# without using a config file
# $0 xorriso_cmd
# cleanup test generated data directory and exit
# $0 -cleanup
#HLP
#}
#####################################################################
# cleanup
#if [ "${1}" == "-cleanup" ]; then
# cd "${START_DIR_DONT_CHANGE}" || exit 2
# if [ -d "${GEN_DATA_DIR}" ]; then
# rm -rf ${GEN_DATA_DIR}
# printf "${SELF}: removed %s\n" ${GEN_DATA_DIR}
# else
# printf "${SELF}: ${GEN_DATA_DIR} does not exist.\n"
# fi
# exit 0
#fi
# help
#if [ ! "${1}" ]; then print_help && exit 3; fi
# config file
#if [ "${1}" == "-rc" ]; then
# if [ -e ${CONFFILE} ]; then
# . ${CONFFILE}
# printf "${SELF}: Using config file %s\n" ${CONFFILE}
# else
# echo -e "\n${SELF}: Config file ${CONFFILE} not found.\n" && exit 4
# fi
# if [ "${2}" == "-keep" ]; then KEEP=1; fi
# command line args
#elif [ "${1}" ]; then
# RELENG_XORRISO="${1}"
# if [ "${2}" == "-keep" ]; then KEEP=1; fi
# the rest
#else
# print_help && exit 5
#fi
# data dir
#if [ -d "${GEN_DATA_DIR}" ]; then
# printf "\n${SELF}: directory %s exists!" ${GEN_DATA_DIR}
# printf "\n${SELF}: use '${SELF} -cleanup' to remove.\n"
# exit 6
#else
# mkdir "${GEN_DATA_DIR}"
#fi
#if [ "${RELENG_XORRISO}" == "" ]; then
# echo -e "\n${SELF}: xorriso_cmd is required\n"
# exit 7
# fi
#if [ ! -x "${RELENG_XORRISO}" ]; then
# printf "${SELF}: Not found or not an executable: $RELENG_XORRISO\n"
# exit 8
#fi
# All must be set at this point
printf "${SELF}: Config items:" printf "${SELF}: Config items:"
printf "\n\txorriso_cmd=${RELENG_XORRISO}\n" printf "\n\txorriso_cmd=${RELENG_XORRISO}\n"

View File

@ -2,29 +2,39 @@
set -e set -e
# It is not a good idea to include inc/releng_getopts.inc with the
# master script as it calls the subordinate scripts and they include
# this file too, and we want to avoid sharing variable with subshells
SELF=$(basename "$0") SELF=$(basename "$0")
GEN_DATA_DIR=releng_generated_data GEN_DATA_DIR=releng_generated_data
CLOG=${GEN_DATA_DIR}/log.${SELF} CLOG=${GEN_DATA_DIR}/log.${SELF}
PASSED_OPTIONS="$@"
CLEANUP_LOG=0
PASSED_OPTIONS="" #############################################
while getopts “x:k:c:f:h” OPT
do
case $OPT in
c)
CLEANUP_LOG=1
;;
*)
;;
esac
done
if [ "${1}" == "-cleanup" ]; then if [ ! "${1}" ]; then
PASSED_OPTIONS="-cleanup"
elif [ "${1}" == "-rc" -a "${2}" == "-keep" ]; then
PASSED_OPTIONS="-rc -keep"
elif [ "${1}" == "-rc" ]; then
PASSED_OPTIONS="-rc"
else
cat << HLP cat << HLP
${SELF} runs executables from CWD starting with releng_*. ${SELF} runs executables from CWD starting with releng_*, passing them its own options.
stdout/stderr output stored in ${CLOG} stdout/stderr output stored in ${CLOG}
${SELF} -rc [-keep] ${SELF} -x path/to/xorriso [-k1]
${SELF} -cleanup ${SELF} -c1
HLP HLP
exit 101 exit 31
fi fi
######################################################## ########################################################
@ -63,9 +73,16 @@ fi
DEND=`date --utc` DEND=`date --utc`
printf "\n${SELF}: Stopped at ${DEND}." printf "\n${SELF}: Stopped at ${DEND}."
if [ "${1}" == "-cleanup" ]; then if [ "${CLEANUP_LOG}" -eq 1 ]; then
if [ -f "${CLOG}" ]; then rm -f "${CLOG}"; fi if [ -f "${CLOG}" ]; then
if [ -f "${CLOG}".prev ]; then rm -f "${CLOG}".prev; fi printf "\n${SELF}: Removed my own log ${CLOG}."
rm -f "${CLOG}"
fi
if [ -f "${CLOG}".prev ]; then
printf "\n${SELF}: Removed my own log ${CLOG}.prev."
rm -f "${CLOG}".prev
fi
printf "\n"
else else
E2=`date '+%s'` E2=`date '+%s'`
let ES="${E2} - ${E1}" let ES="${E2} - ${E1}"
@ -110,6 +127,5 @@ fi
fi fi
fi fi
printf "\n" # Fin
exit 0 exit 0

View File

@ -2,7 +2,9 @@
set -e set -e
# Include common bits
. inc/releng_getopts.inc . inc/releng_getopts.inc
# Each releng_ test should decide whether or not it need # Each releng_ test should decide whether or not it need
# a xorriso binary to test, since some do compilations only. # a xorriso binary to test, since some do compilations only.
if [ ! -x $RELENG_XORRISO ]; then if [ ! -x $RELENG_XORRISO ]; then