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

reduce output to stdout of test_create_html

parent 8c912c85
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,21 +5,23 @@ RESEARCH_TESTING=$RESEARCH_ROOT/testing/test_create_html ...@@ -5,21 +5,23 @@ RESEARCH_TESTING=$RESEARCH_ROOT/testing/test_create_html
# prepare place for logfiles # prepare place for logfiles
mkdir -p $RESEARCH_ROOT/log mkdir -p $RESEARCH_ROOT/log
LOGFILE=$RESEARCH_ROOT/log/create_html.log
rm -rf $LOGFILE && touch $LOGFILE
#BEGIN Test 1: test create_html for _research.html with no arguments #BEGIN Test 1: test create_html for _research.html with no arguments
T=1 T=1
echo "##################################################" #echo "##################################################"
echo "Test 1: create_html with no arguments" echo "Test 1: create_html with no arguments"
echo "##################################################" #echo "##################################################"
# preparation # preparation
REF_FILE=$RESEARCH_TESTING/ref_fgabel_research.html REF_FILE=$RESEARCH_TESTING/ref_fgabel_research.html
rm -rf $RESEARCH_TESTING/build rm -rf $RESEARCH_TESTING/build
cd $RESEARCH_TESTING cd $RESEARCH_TESTING
# run test # run test
$RESEARCH_ROOT/bin/create_html.sh $RESEARCH_ROOT/bin/create_html.sh >> $LOGFILE 2>&1
# check results # check results
DIFF=$(diff $REF_FILE $RESEARCH_TESTING/build/fgabel_research.html ) DIFF=$(diff $REF_FILE $RESEARCH_TESTING/build/fgabel_research.html )
echo "--------------------------------------------------" #echo "--------------------------------------------------"
if [ "$DIFF" == "" ] && [ -f "$RESEARCH_TESTING/build/fgabel_research.html" ] if [ "$DIFF" == "" ] && [ -f "$RESEARCH_TESTING/build/fgabel_research.html" ]
then then
echo "Test $T: PASSED." echo "Test $T: PASSED."
...@@ -32,20 +34,20 @@ fi ...@@ -32,20 +34,20 @@ fi
#BEGIN Test 2: test create_html for _research.html with build argument #BEGIN Test 2: test create_html for _research.html with build argument
T=2 T=2
echo "##################################################" #echo "##################################################"
echo "Test $T: create_html with build argument" echo "Test $T: create_html with build argument"
echo "##################################################" #echo "##################################################"
# preparation # preparation
RESEARCH_BUILD=$RESEARCH_TESTING/build RESEARCH_BUILD=$RESEARCH_TESTING/build
REF_FILE=$RESEARCH_TESTING/ref_fgabel_research.html REF_FILE=$RESEARCH_TESTING/ref_fgabel_research.html
rm -rf $RESEARCH_BUILD rm -rf $RESEARCH_BUILD
mkdir -p $RESEARCH_BUILD mkdir -p $RESEARCH_BUILD
cp -v $RESEARCH_TESTING/*.md $RESEARCH_BUILD cp $RESEARCH_TESTING/*.md $RESEARCH_BUILD
# run test # run test
$RESEARCH_ROOT/bin/create_html.sh $RESEARCH_BUILD $RESEARCH_ROOT/bin/create_html.sh $RESEARCH_BUILD >> $LOGFILE 2>&1
# check results # check results
DIFF=$(diff $REF_FILE $RESEARCH_TESTING/fgabel_research.html) DIFF=$(diff $REF_FILE $RESEARCH_TESTING/fgabel_research.html)
echo "--------------------------------------------------" #echo "--------------------------------------------------"
if [ "$DIFF" == "" ] && [ -f "$RESEARCH_BUILD/fgabel_research.html" ] if [ "$DIFF" == "" ] && [ -f "$RESEARCH_BUILD/fgabel_research.html" ]
then then
echo "Test $T: PASSED." echo "Test $T: PASSED."
...@@ -58,18 +60,18 @@ fi ...@@ -58,18 +60,18 @@ fi
#BEGIN Test 3: test create_html for _research.html with build and topics argument #BEGIN Test 3: test create_html for _research.html with build and topics argument
T=3 T=3
echo "##################################################" #echo "##################################################"
echo "Test $T: create_html with build argument" echo "Test $T: create_html with build and topics argument"
echo "##################################################" #echo "##################################################"
# preparation # preparation
RESEARCH_BUILD=$RESEARCH_TESTING/build RESEARCH_BUILD=$RESEARCH_TESTING/build
RESEARCH_TOPICS=$RESEARCH_BUILD/topics RESEARCH_TOPICS=$RESEARCH_BUILD/topics
REF_FILE=$RESEARCH_TESTING/ref_fgabel_research.html REF_FILE=$RESEARCH_TESTING/ref_fgabel_research.html
rm -rf $RESEARCH_BUILD rm -rf $RESEARCH_BUILD
mkdir -p $RESEARCH_BUILD && mkdir -p $RESEARCH_TOPICS mkdir -p $RESEARCH_BUILD && mkdir -p $RESEARCH_TOPICS
cp -v $RESEARCH_TESTING/*.md $RESEARCH_TOPICS cp $RESEARCH_TESTING/*.md $RESEARCH_TOPICS
# run test # run test
$RESEARCH_ROOT/bin/create_html.sh $RESEARCH_BUILD $RESEARCH_TOPICS $RESEARCH_ROOT/bin/create_html.sh $RESEARCH_BUILD $RESEARCH_TOPICS >> $LOGFILE 2>&1
# check if output exists and results coincide with reference file # check if output exists and results coincide with reference file
DIFF=$(diff $REF_FILE $RESEARCH_BUILD/fgabel_research.html) DIFF=$(diff $REF_FILE $RESEARCH_BUILD/fgabel_research.html)
if [ "$DIFF" == "" ] && [ -f "$RESEARCH_BUILD/fgabel_research.html" ] if [ "$DIFF" == "" ] && [ -f "$RESEARCH_BUILD/fgabel_research.html" ]
...@@ -86,4 +88,3 @@ fi ...@@ -86,4 +88,3 @@ fi
echo "--------------------------------------------------" echo "--------------------------------------------------"
echo "ALL $T tests in $0 PASSED." echo "ALL $T tests in $0 PASSED."
exit 0 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