Diff report is now written to file.

This commit is contained in:
Tobias Reinhard 2022-12-12 10:01:53 -05:00
parent 114fd0fcf0
commit c50e8bd5b3
4 changed files with 43 additions and 8 deletions

View file

@ -24,8 +24,6 @@ echo $VF_PROOF_BASE_DIR
. "`pp_script_dir $REPO_BASE_DIR`/pp_flags.sh" "$REPO_BASE_DIR" "$VF_PROOF_BASE_DIR"
PROD_HEADER_DIR=`prod_header_dir $REPO_BASE_DIR`
ls PROD_HEADER_DIR
ls $PROD_HEADER_DIR
# Relevant clang flags:

View file

@ -21,16 +21,29 @@ VF_PROOF_DIR=`vf_proof_base_dir $REPO_BASE_DIR`
PP_SCRIPT_DIR=`pp_script_dir $REPO_BASE_DIR`
PP="$PP_SCRIPT_DIR/preprocess_file_for_diff.sh"
LOG_DIR=`pp_log_dir $REPO_BASE_DIR`
STATS_DIR=`stats_dir $REPO_BASE_DIR`
# Unpreprocessed verions of tasks.c
PROD_TASKS_C=`prod_tasks_c $REPO_BASE_DIR`
VF_TASKS_C=`vf_annotated_tasks_c $REPO_BASE_DIR`
# Preprocessed versions of tasks.c
PP_OUT_DIR=`pp_out_dir $REPO_BASE_DIR`
PP_PROD_TASKS_C=`pp_prod_tasks_c $REPO_BASE_DIR`
PP_VF_TASKS_C=`pp_vf_tasks_c $REPO_BASE_DIR`
mkdir "$LOG_DIR"
DIFF_REPORT=`diff_report $REPO_BASE_DIR`
# Ensure that all output directories exist
if [ ! -d "$LOG_DIR" ]; then
mkdir "$LOG_DIR"
fi
if [ ! -d "$STATS_DIR" ]; then
mkdir "$STATS_DIR"
fi
if [ ! -d "$PP_OUT_DIR" ]; then
mkdir "$PP_OUT_DIR"
fi
echo preprocessing production version of 'tasks.c'
$PP $PROD_TASKS_C $PP_PROD_TASKS_C \
@ -51,8 +64,8 @@ $PP $VF_TASKS_C $PP_VF_TASKS_C \
printf "\n\n\n"
echo Diff:
echo -----------------------------------------------------
echo
git diff --no-index --ignore-all-space $PP_PROD_TASKS_C $PP_VF_TASKS_C
echo Computing diff. Output written to:
echo \"$DIFF_REPORT\"
git diff --no-index --ignore-all-space $PP_PROD_TASKS_C $PP_VF_TASKS_C \
> "$DIFF_REPORT"

View file

@ -183,3 +183,27 @@ function smp_demo_dir() {
}
# Returns the absolute path to directory where the statistic reports are stored.
#
# Expected arguments:
# $1 : Absolute path to the repository's base
function stats_dir() {
REPO_BASE_DIR="$1"
VF_PROOF_DIR=`vf_proof_base_dir $REPO_BASE_DIR`
echo "$VF_PROOF_DIR/stats"
}
# Returns the absolute path to diff report.
#
# Expected arguments:
# $1 : Absolute path to the repository's base
function diff_report() {
REPO_BASE_DIR="$1"
STATS_DIR=`stats_dir $REPO_BASE_DIR`
echo "$STATS_DIR/diff_report.txt"
}