adding unit test for vx_malloc
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user