adding unit test for vx_malloc

This commit is contained in:
Blaise Tine
2022-01-30 05:57:18 -05:00
parent 3750c672a7
commit e3e2609f7e
8 changed files with 298 additions and 168 deletions

View File

@@ -144,16 +144,20 @@ if [ $DEBUG -eq 1 ]
then
if [ $SCOPE -eq 1 ]
then
echo "running: DEBUG=$DEBUG_LEVEL SCOPE=1 CONFIGS="$CONFIGS" make -C $DRIVER_PATH"
DEBUG=$DEBUG_LEVEL SCOPE=1 CONFIGS="$CONFIGS" make -C $DRIVER_PATH
else
echo "running: DEBUG=$DEBUG_LEVEL CONFIGS="$CONFIGS" make -C $DRIVER_PATH"
DEBUG=$DEBUG_LEVEL CONFIGS="$CONFIGS" make -C $DRIVER_PATH
fi
if [ $HAS_ARGS -eq 1 ]
then
echo "running: OPTS=$ARGS make -C $APP_PATH run-$DRIVER > run.log 2>&1"
OPTS=$ARGS make -C $APP_PATH run-$DRIVER > run.log 2>&1
status=$?
else
echo "running: make -C $APP_PATH run-$DRIVER > run.log 2>&1"
make -C $APP_PATH run-$DRIVER > run.log 2>&1
status=$?
fi
@@ -163,18 +167,24 @@ then
mv -f $APP_PATH/trace.vcd .
fi
else
echo "driver initialization..."
if [ $SCOPE -eq 1 ]
then
echo "running: SCOPE=1 CONFIGS="$CONFIGS" make -C $DRIVER_PATH"
SCOPE=1 CONFIGS="$CONFIGS" make -C $DRIVER_PATH
else
echo "running: CONFIGS="$CONFIGS" make -C $DRIVER_PATH"
CONFIGS="$CONFIGS" make -C $DRIVER_PATH
fi
echo "running application..."
if [ $HAS_ARGS -eq 1 ]
then
echo "running: OPTS=$ARGS make -C $APP_PATH run-$DRIVER"
OPTS=$ARGS make -C $APP_PATH run-$DRIVER
status=$?
else
echo "running: make -C $APP_PATH run-$DRIVER"
make -C $APP_PATH run-$DRIVER
status=$?
fi

View File

@@ -6,6 +6,11 @@ set -e
# ensure build
make -s
unittest()
{
make -C tests/unittest run
}
coverage()
{
echo "begin coverage tests..."
@@ -156,11 +161,13 @@ echo "stress1 tests done!"
usage()
{
echo "usage: regression [-coverage] [-tex] [-cluster] [-debug] [-config] [-stress[#n]] [-all] [-h|--help]"
echo "usage: regression [-unittest] [-coverage] [-tex] [-cluster] [-debug] [-config] [-stress[#n]] [-all] [-h|--help]"
}
while [ "$1" != "" ]; do
case $1 in
-unittest ) unittest
;;
-coverage ) coverage
;;
-tex ) tex

View File

@@ -4,19 +4,22 @@ import time
import threading
import subprocess
PingInterval = 15
# This script executes a long-running command while outputing "still running ..." periodically
# to notify Travis build system that the program has not hanged
def PingCallback(stop):
PING_INTERVAL=15
def monitor(stop):
wait_time = 0
while True:
time.sleep(PingInterval)
wait_time += PingInterval
time.sleep(PING_INTERVAL)
wait_time += PING_INTERVAL
print(" + still running (" + str(wait_time) + "s) ...")
sys.stdout.flush()
if stop():
break
def run_command(command):
def execute(command):
process = subprocess.Popen(command, stdout=subprocess.PIPE)
while True:
output = process.stdout.readline()
@@ -24,18 +27,23 @@ def run_command(command):
break
if output:
print output.strip()
sys.stdout.flush()
return process.returncode
def main(argv):
stop_threads = False
t = threading.Thread(target = PingCallback, args =(lambda : stop_threads, ))
# start monitoring thread
stop_monitor = False
t = threading.Thread(target = monitor, args =(lambda : stop_monitor, ))
t.start()
exitcode = run_command(argv)
# execute command
exitcode = execute(argv)
print(" + exitcode="+str(exitcode))
stop_threads = True
sys.stdout.flush()
# terminate monitoring thread
stop_monitor = True
t.join()
sys.exit(exitcode)