From d029015cf53457affd674fd6c8cebf6cdec4ba4d Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Tue, 3 Dec 2024 09:04:41 +0100 Subject: [PATCH] add argument for passing the ref wmops log --- ci/complexity_measurements/getWmops.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ci/complexity_measurements/getWmops.sh b/ci/complexity_measurements/getWmops.sh index 1853704863..be169bebba 100755 --- a/ci/complexity_measurements/getWmops.sh +++ b/ci/complexity_measurements/getWmops.sh @@ -29,11 +29,11 @@ # the United Nations Convention on Contracts on the International Sales of Goods. function usage { - echo "Usage: $0 \"ivas-format(s)\" \"output-format(s)\" \"mode{full(default)|mem_only}\" \"repo{float(default)|basop}\" " + echo "Usage: $0 \"ivas-format(s)\" \"output-format(s)\" \"mode{full(default)|mem_only}\" \"repo{float(default)|basop}\" [wmops_ref_logfile]" exit 1 } -if [ $# -ne 2 ] && [ $# -ne 3 ] && [ $# -ne 4 ]; then +if [ $# -ne 2 ] && [ $# -ne 3 ] && [ $# -ne 4 ] && [ $# -ne 5 ]; then usage fi @@ -58,6 +58,11 @@ if [ $# -eq 4 ]; then fi fi +wmops_ref_logfile="" +if [ $# -eq 5 ]; then + wmops_ref_logfile=$5 +fi + date=$(date +%Y%m%d) # used for log-file file ending shortDate=$(date "+%b %d" | sed -e "s/\ /_/g") # stored in the log-file fullDate=$(date "+%c" | sed -e "s/\ /_/g") # stored in the log-file @@ -102,7 +107,12 @@ ${scriptDir}/mergeNewsletterRom.py ${wmopsFilenameFlc}_PROM.csv ${wmopsFilenameF ${scriptDir}/parseNewsletterRom.py ${wmopsFilenameFlc}_PROM.csv ${wmopsFilenameFlc}_TROM.csv ${wmopsFilenameFlcLast}_ROM.csv ${commit_sha} ${shortDate} ${fullDate} >>${destDir}/wmops/log_rom_all.txt # generate javascript code from log files -python3 ci/complexity_measurements/genWebpageData.py ${destDir}/wmops/log_wmops_all.txt ${wmopsFilenameFlc}_WMOPS.csv ${destDir}/wmops/log_rom_all.txt ${destDir}/wmops/log_ram_all.txt +# pass the ref log for comparison only if arg is given +if [ "$wmops_ref_logfile" != "" ]; then + python3 ci/complexity_measurements/genWebpageData.py ${destDir}/wmops/log_wmops_all.txt ${wmopsFilenameFlc}_WMOPS.csv ${destDir}/wmops/log_rom_all.txt ${destDir}/wmops/log_ram_all.txt --wmops_per_op_log_for_comparison $wmops_ref_logfile +else + python3 ci/complexity_measurements/genWebpageData.py ${destDir}/wmops/log_wmops_all.txt ${wmopsFilenameFlc}_WMOPS.csv ${destDir}/wmops/log_rom_all.txt ${destDir}/wmops/log_ram_all.txt +fi python3 ${scriptDir}/check_for_changes.py ${destDir}/wmops/log_wmops_all.txt ${destDir}/wmops/log_ram_all.txt ${destDir}/wmops/log_rom_all.txt if [ "$?" != "0" ]; then -- GitLab