From 9230092ecac2edd03d5d0458164df2c38cdc6c19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Sj=C3=B6lund?= Date: Thu, 25 Apr 2013 04:54:14 +0000 Subject: [PATCH] Fix to rebuild all svg-files when running the MSL coverage git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@15908 f25d12d1-65f4-0310-ae8a-bbce733d8d8e --- Examples/BuildModelTest.sh | 43 ++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/Examples/BuildModelTest.sh b/Examples/BuildModelTest.sh index 50f71cf5055..f6c77335cf9 100755 --- a/Examples/BuildModelTest.sh +++ b/Examples/BuildModelTest.sh @@ -31,7 +31,10 @@ sed "s/^libraryVersion:=\"default\";/libraryVersion:=\"$VERSION\";/" "$TRUNK/Exa rm -f *.err BuildModelRecursive.html if $OMC +g=MetaModelica "$SHORTNAME.mos" > log 2>&1; then rm -f "$PUB/$SHORTNAME/"*.err "$PUB/$SHORTNAME/"*.sim - cp BuildModelRecursive.html "$OLD/$SHORTNAME-`date +%Y-%m-%d`.html" + if ! cp BuildModelRecursive.html "$OLD/$SHORTNAME-`date +%Y-%m-%d`.html"; then + echo "Failed to install $OLD/$SHORTNAME-`date +%Y-%m-%d`.html" + exit 1 + fi for f in *.err *.sim BuildModelRecursive.html; do mv "$f" "$PUB/$SHORTNAME/"; done else cat log @@ -41,17 +44,17 @@ fi done fi # --plot-only -for lib in "$*"; do +for lib in "$@"; do SECTION=`echo $lib | cut -d, -f1` echo "$SECTION" -FIRST_DATE=`grep -H "Simulation Results:" $OLD/${SECTION}*.html | head -n1 | cut -d: -f1 | grep -o "20[0-9-]*"` -LAST_DATE=`grep -H "Simulation Results:" $OLD/${SECTION}*.html | tail -n1 | cut -d: -f1 | grep -o "20[0-9-]*"` +FIRST_DATE=`grep -H "Simulation Results:" "$OLD/${SECTION}"*.html | head -n1 | cut -d: -f1 | grep -o "20[0-9-]*"` +LAST_DATE=`grep -H "Simulation Results:" "$OLD/${SECTION}"*.html | tail -n1 | cut -d: -f1 | grep -o "20[0-9-]*"` if test "$FIRST_DATE" = "$LAST_DATE"; then FIRST_DATE="1970-01-01" fi -GOAL=`grep -H "Simulation Results:" $OLD/${SECTION}*.html | tail -n1 | grep -o "[0-9][0-9]*/[0-9][0-9]*" | sed s,.*/,,` -CURS=`grep -H "Simulation Results:" $OLD/${SECTION}*.html | tail -n1 | grep -o "[0-9][0-9]*/[0-9][0-9]*" | sed s,/.*,,` -CURC=`grep -H "BuildModel Results:" $OLD/${SECTION}*.html | tail -n1 | grep -o "[0-9][0-9]*/[0-9][0-9]*" | sed s,/.*,,` +GOAL=`grep -H "Simulation Results:" "$OLD/${SECTION}"*.html | tail -n1 | grep -o "[0-9][0-9]*/[0-9][0-9]*" | sed s,.*/,,` +CURS=`grep -H "Simulation Results:" "$OLD/${SECTION}"*.html | tail -n1 | grep -o "[0-9][0-9]*/[0-9][0-9]*" | sed s,/.*,,` +CURC=`grep -H "BuildModel Results:" "$OLD/${SECTION}"*.html | tail -n1 | grep -o "[0-9][0-9]*/[0-9][0-9]*" | sed s,/.*,,` cat > $PUB/MSL_old/${SECTION}-trend.gnuplot <> $OLD/${SECTION}-trend.csv - echo -n $DATE $REV + echo "$DATE,$BUILD,$SIMSUC" >> "$OLD/${SECTION}-trend.csv" + echo -n "$DATE $REV" echo -n " - total $TOT" echo -n " - build $BUILD" "($((100 * $BUILD / $TOT))%)" echo " - sim $SIMSUC" "($((100 * $SIMSUC / $TOT))%)" done (cd $OLD; gnuplot ${SECTION}-trend.gnuplot) -CUR=`ls $OLD/${SECTION}*.html | tail -n1` -YDAY=`ls $OLD/${SECTION}*.html | tail -n2 | head -n1` -WEEK=`ls $OLD/${SECTION}*.html | tail -n7 | head -n1` -MONTH=`ls $OLD/${SECTION}*.html | tail -n28 | head -n1` -"$TRUNK"/Examples/BuildModelRecursiveDiff.sh "$YDAY" "$CUR" > $PUB/MSL_old/${SECTION}-diff-yday.txt -"$TRUNK"/Examples/BuildModelRecursiveDiff.sh "$WEEK" "$CUR" > $PUB/MSL_old/${SECTION}-diff-week.txt -"$TRUNK"/Examples/BuildModelRecursiveDiff.sh "$MONTH" "$CUR" > $PUB/MSL_old/${SECTION}-diff-month.txt -done > $PUB/MSL_old/history.txt +CUR=`ls "$OLD/${SECTION}"*.html | tail -n1` +YDAY=`ls "$OLD/${SECTION}"*.html | tail -n2 | head -n1` +WEEK=`ls "$OLD/${SECTION}"*.html | tail -n7 | head -n1` +MONTH=`ls "$OLD/${SECTION}"*.html | tail -n28 | head -n1` +"$TRUNK"/Examples/BuildModelRecursiveDiff.sh "$YDAY" "$CUR" > "$PUB/MSL_old/${SECTION}-diff-yday.txt" +"$TRUNK"/Examples/BuildModelRecursiveDiff.sh "$WEEK" "$CUR" > "$PUB/MSL_old/${SECTION}-diff-week.txt" +"$TRUNK"/Examples/BuildModelRecursiveDiff.sh "$MONTH" "$CUR" > "$PUB/MSL_old/${SECTION}-diff-month.txt" +done > "$PUB/MSL_old/history.txt"