Skip to content
Snippets Groups Projects
Commit f94c95a2 authored by Fabian Nuraddin Alexander Gabel's avatar Fabian Nuraddin Alexander Gabel :speech_balloon:
Browse files

make output of test_replace_marker more readable

parent 36da5352
No related branches found
No related tags found
3 merge requests!84Draft: Resolve "create tests for new commandline arguments",!83Draft: Resolve "deliver css and javascript to www3",!77Resolve "tuhh-deployment"
......@@ -5,25 +5,27 @@
RESEARCH_TESTING=$RESEARCH_ROOT/testing/test_replace_marker
# prepare place for logfiles
mkdir -p $RESARCH_ROOT/log
mkdir -p $RESEARCH_ROOT/log
LOGFILE=$RESEARCH_ROOT/log/replace_marker.log
rm -rf $LOGFILE && touch $LOGFILE
#BEGIN Test 1: test replace_marker for _research.html with no arguments
T=1
echo "##################################################"
#echo "##################################################"
echo "Test 1: replace_marker with no arguments"
echo "##################################################"
#echo "##################################################"
# preparation
RESEARCH_BUILD=$RESEARCH_TESTING/build
rm -rf $RESEARCH_TESTING/build
mkdir -p $RESEARCH_BUILD
REF_FILE=$RESEARCH_TESTING/ref_fgabel_final.html
cd $RESEARCH_TESTING
cp -v fgabel_research.html $RESEARCH_BUILD
cp fgabel_research.html $RESEARCH_BUILD
# run test
$RESEARCH_ROOT/bin/replace_marker.sh
$RESEARCH_ROOT/bin/replace_marker.sh >> $LOGFILE 2>&1
# check results
DIFF=$(diff $REF_FILE $RESEARCH_BUILD/fgabel_final.html )
echo "--------------------------------------------------"
#echo "--------------------------------------------------"
if [ "$DIFF" == "" ] && [ -f "$RESEARCH_BUILD/fgabel_final.html" ]
then
echo "Test $T: PASSED."
......@@ -32,26 +34,25 @@ else
echo "Aborting further execution of $0 ..."
exit 1
fi
cd -
#END Test 1
#BEGIN Test 2: test replace_marker for _research.html with build argument
T=2
echo "##################################################"
#echo "##################################################"
echo "Test $T: replace_marker with build argument"
echo "##################################################"
#echo "##################################################"
# preparation build dir
RESEARCH_BUILD=$RESEARCH_TESTING/build
rm -rf $RESEARCH_BUILD
mkdir -p $RESEARCH_BUILD
#set ref file and copy basefiles
REF_FILE=$RESEARCH_TESTING/ref_fgabel_final.html
cp -v $RESEARCH_TESTING/*_research.html $RESEARCH_BUILD
cp $RESEARCH_TESTING/*_research.html $RESEARCH_BUILD
# run test
$RESEARCH_ROOT/bin/replace_marker.sh $RESEARCH_BUILD
$RESEARCH_ROOT/bin/replace_marker.sh $RESEARCH_BUILD >> $LOGFILE 2>&1
# check results
DIFF=$(diff $REF_FILE $RESEARCH_BUILD/fgabel_final.html)
echo "--------------------------------------------------"
#echo "--------------------------------------------------"
if [ "$DIFF" == "" ] && [ -f "$RESEARCH_BUILD/fgabel_final.html" ]
then
echo "Test $T: PASSED."
......@@ -64,9 +65,9 @@ fi
#BEGIN Test 3: test replace_marker for _research.html with build and topics argument
T=3
echo "##################################################"
echo "Test $T: replace_marker with build argument"
echo "##################################################"
#echo "##################################################"
echo "Test $T: replace_marker with build and plain argument"
#echo "##################################################"
# preparation build dir
RESEARCH_BUILD=$RESEARCH_TESTING/build
RESEARCH_PLAIN=$RESEARCH_BUILD/plain
......@@ -74,9 +75,10 @@ rm -rf $RESEARCH_BUILD
mkdir -p $RESEARCH_BUILD && mkdir -p $RESEARCH_PLAIN
#set ref file and copy basefiles
REF_FILE=$RESEARCH_TESTING/ref_fgabel_final.html
cp -v $RESEARCH_TESTING/fgabel_research.html $RESEARCH_PLAIN
cp $RESEARCH_TESTING/fgabel_research.html $RESEARCH_PLAIN
# run test
$RESEARCH_ROOT/bin/replace_marker.sh $RESEARCH_BUILD $RESEARCH_PLAIN
$RESEARCH_ROOT/bin/replace_marker.sh $RESEARCH_BUILD $RESEARCH_PLAIN >> $LOGFILE 2>&1
# check if output exists and results coincide with reference file
DIFF=$(diff $REF_FILE $RESEARCH_BUILD/fgabel_final.html)
if [ "$DIFF" == "" ] && [ -f "$RESEARCH_BUILD/fgabel_final.html" ]
......@@ -93,4 +95,3 @@ fi
echo "--------------------------------------------------"
echo "ALL $T tests in $0 PASSED."
exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment