Enhanced test and syntax check scripts to add non-scrolling command line header

This commit is contained in:
John Wellbelove 2025-12-20 12:51:01 +00:00
parent d98c3ac903
commit 84f037b616
2 changed files with 88 additions and 6 deletions

View File

@ -5,11 +5,32 @@ echo -e
configuration_name="Configuration Name Not Set"
# Define colours
FailColour='\033[38;2;255;128;128m'
PassColour='\033[38;2;128;255;128m'
TitleColour='\033[38;2;107;210;255m'
HelpColour='\033[38;2;250;180;250m'
NoColour='\033[0m'
CommandColour='\033[38;2;255;255;128m'
# Save cursor position
tput sc
# Clear screen
tput clear
# Write fixed header on line 1
tput cup 0 0
echo $CommandColour "run-syntax-checks.sh" $1 $2 $3 $4 $5 $NoColour
# Define scrolling region from line 2 to bottom
tput csr 2 $(($(tput lines) - 1))
# Restore cursor position
tput rc
# Move cursor to start of scrollable area
tput cup 1 0
ParseGitBranch()
{
@ -81,6 +102,25 @@ ChecksCompleted()
echo "$NoColour"
}
cleanup()
{
# Reset scroll region to full screen
tput csr 0 $(($(tput lines) - 1))
# Move cursor to a safe line (bottom of terminal)
tput cup $(($(tput lines) - 1)) 0
}
ctrl_c()
{
# Reset scroll region to full screen
tput csr 0 $(($(tput lines) - 1))
# Move cursor to a safe line (bottom of terminal)
tput cup $(($(tput lines) - 1)) 0
}
trap ctrl_c INT
trap cleanup EXIT
cd syntax_check || exit 1
echo "" > log.txt

View File

@ -4,16 +4,37 @@ shopt -s xpg_echo
clear
export ASAN_OPTIONS=symbol_line=1
export ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-14/bin//llvm-symbolizer
configuration_name="Configuration Name Not Set"
# Define colours
FailColour='\033[38;2;255;128;128m'
PassColour='\033[38;2;128;255;128m'
TitleColour='\033[38;2;107;210;255m'
HelpColour='\033[38;2;250;180;250m'
NoColour='\033[0m'
CommandColour='\033[38;2;255;255;128m'
# Save cursor position
tput sc
# Clear screen
tput clear
# Write fixed header on line 1
tput cup 0 0
echo $CommandColour "run-tests.sh" $1 $2 $3 $4 $5 $NoColour
# Define scrolling region from line 2 to bottom
tput csr 2 $(($(tput lines) - 1))
# Restore cursor position
tput rc
# Move cursor to start of scrollable area
tput cup 1 0
export ASAN_OPTIONS=symbol_line=1
export ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-14/bin//llvm-symbolizer
configuration_name="Configuration Name Not Set"
ParseGitBranch()
{
@ -179,10 +200,31 @@ fi
etl_version_raw=$(cat ../version.txt)
etl_version=$(echo $etl_version_raw | sed -e 's/\r//g') # Remove trailing \r
cleanup()
{
# Reset scroll region to full screen
tput csr 0 $(($(tput lines) - 1))
# Move cursor to a safe line (bottom of terminal)
tput cup $(($(tput lines) - 1)) 0
}
ctrl_c()
{
# Reset scroll region to full screen
tput csr 0 $(($(tput lines) - 1))
# Move cursor to a safe line (bottom of terminal)
tput cup $(($(tput lines) - 1)) 0
}
trap ctrl_c INT
trap cleanup EXIT
cd syntax_check || exit 1
echo "" > log.txt
#******************************************************************************
# Get the compiler versions
#******************************************************************************
while read i ; do
CC=`echo $i | cut -d, -f1 | sed -e 's/ *$//'`
MSG=`echo $i | cut -d, -f2 | sed -e 's/ *$//'`