tests: make tests less make dependent

Implement command line argument parsing instead of passing arguments via
environment variables. Add script for running tests without having to
invoke make. Deprecate running tests via make.

Type: improvement
Change-Id: I2e3054a61a2ae25d460e9be00be7d7705fbf943e
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
This commit is contained in:
Klement Sekera
2021-05-31 16:08:53 +02:00
committed by Andrew Yourtchenko
parent 8ccc6b3507
commit b23ffd7ef2
48 changed files with 805 additions and 516 deletions

View File

@ -4,6 +4,8 @@ import sys
import os
import logging
from config import config
""" @var formatting delimiter consisting of '=' characters """
double_line_delim = '=' * 78
""" @var formatting delimiter consisting of '-' characters """
@ -24,15 +26,12 @@ class ColorFormatter(logging.Formatter):
if hasattr(record, 'color'):
message = colorize(message, record.color)
return message
try:
verbose = int(os.getenv("V", 0))
except:
verbose = 0
# 40 = ERROR, 30 = WARNING, 20 = INFO, 10 = DEBUG, 0 = NOTSET (all messages)
if verbose >= 2:
if config.verbose >= 2:
log_level = 10
elif verbose == 1:
elif config.verbose == 1:
log_level = 20
else:
log_level = 40
@ -66,6 +65,7 @@ def get_parallel_logger(stream):
logger.addHandler(handler)
return logger
# Static variables to store color formatting strings.
#
# These variables (RED, GREEN, YELLOW and LPURPLE) are used to configure