From ef8c267fd054d45b96609bd88c336e918ee6dda5 Mon Sep 17 00:00:00 2001 From: George Danchev Date: Tue, 5 Jul 2011 10:27:27 +0000 Subject: [PATCH] move first code sample in target directory, and use that as well --- .../sample1.cpp | 0 libisoburn/trunk/releng/releng_cxx | 19 +++++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) rename libisoburn/trunk/releng/{releng_generated_data => codesamples}/sample1.cpp (100%) diff --git a/libisoburn/trunk/releng/releng_generated_data/sample1.cpp b/libisoburn/trunk/releng/codesamples/sample1.cpp similarity index 100% rename from libisoburn/trunk/releng/releng_generated_data/sample1.cpp rename to libisoburn/trunk/releng/codesamples/sample1.cpp diff --git a/libisoburn/trunk/releng/releng_cxx b/libisoburn/trunk/releng/releng_cxx index 5f75535d..ba3488be 100755 --- a/libisoburn/trunk/releng/releng_cxx +++ b/libisoburn/trunk/releng/releng_cxx @@ -6,7 +6,7 @@ START_DIR_DONT_CHANGE=`pwd` SELF=$(basename "$0") GEN_DATA_DIR=releng_generated_data/${SELF} KEEP=0 -SAMPLE_CODE_DIR=releng_generated_data +SAMPLE_CODE_DIR=codesamples CC=g++ CC_FLAFS=" -I ../libisoburn -L ../libisoburn/.libs/ -lisoburn " @@ -82,9 +82,19 @@ if test -f "${SAMPLE_CODE_DIR}"/*.cpp; then for SMPL in `ls "${SAMPLE_CODE_DIR}"/*.cpp`; do CMD_CPL="${CC} ${CC_FLAGS} -o ${SMPL}.obj ${SMPL}" printf "\n${SELF}: ${CMD_CPL}\n" + set +e ${CMD_CPL} - printf "${SELF}: Running ./${SMPL}.obj" - ./${SMPL}.obj + RET_CPL="$?" + if [ ${RET_CPL} == 0 -a -f ${SMPL}.obj ]; then + mv ${SMPL}.obj ${GEN_DATA_DIR} + else + printf "\n${SELF}: FAIL Compilation of ${SMPL}\n" + cleanup + exit 7 + fi + BASE=$(basename ${SMPL}.obj) + printf "${SELF}: Running ${GEN_DATA_DIR}/${BASE}" + ${GEN_DATA_DIR}/${BASE} RET_SMPL="$?" case ${RET_SMPL} in 0) @@ -93,9 +103,10 @@ if test -f "${SAMPLE_CODE_DIR}"/*.cpp; then *) printf "exit code: ${RET_SMPL}\n" cleanup - exit 7 + exit 8 ;; esac + set -e done else printf "\n${SELF}: No C++ code samples found in ${SAMPLE_CODE_DIR}\n"