Commit c346a8e0 authored by Andrew Jones's avatar Andrew Jones Committed by Radim Krčmář
Browse files

errata: add ERRATA_FORCE



Provide an easy way for test runners to run all tests, even those
guarded by an erratum. Setting ERRATA_FORCE forces errata() and
errata_relaxed() to always return true. ./run_tests.sh -a is
also updated to set it.
Signed-off-by: Andrew Jones's avatarAndrew Jones <drjones@redhat.com>
Reviewed-by: default avatarLaurent Vivier <lvivier@redhat.com>
Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
parent 1ea4709c
......@@ -13,16 +13,33 @@
#define _ERRATA_RELAXED(erratum) errata_relaxed("ERRATA_" # erratum)
#define ERRATA_RELAXED(erratum) _ERRATA_RELAXED(erratum)
static inline bool errata_force(void)
{
char *s = getenv("ERRATA_FORCE");
return s && (*s == '1' || *s == 'y' || *s == 'Y');
}
static inline bool errata(const char *erratum)
{
char *s = getenv(erratum);
char *s;
if (errata_force())
return true;
s = getenv(erratum);
return s && (*s == '1' || *s == 'y' || *s == 'Y');
}
static inline bool errata_relaxed(const char *erratum)
{
char *s = getenv(erratum);
char *s;
if (errata_force())
return true;
s = getenv(erratum);
return !(s && (*s == '0' || *s == 'n' || *s == 'N'));
}
......
......@@ -19,6 +19,7 @@ Usage: $0 [-h] [-v] [-a] [-g group] [-j NUM-TASKS]
-h: Output this help text
-v: Enables verbose mode
-a: Run all tests, including those flagged as 'nodefault'
and those guarded by errata.
-g: Only execute tests in the given group
-j: Execute tests in parallel
......@@ -35,6 +36,7 @@ while getopts "ag:hj:v" opt; do
case $opt in
a)
run_all_tests="yes"
export ERRATA_FORCE=y
;;
g)
only_group=$OPTARG
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment