1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-09-30 17:44:21 +03:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Marian Csontos
509327e8ec test: Stacktrace on skip if message is empty 2015-11-19 12:11:58 +01:00
Marian Csontos
ce7557ab09 test: Add missing --skip option and S env.variable 2015-11-19 10:48:17 +01:00
2 changed files with 45 additions and 10 deletions

View File

@@ -675,7 +675,7 @@ bool interrupt = false;
struct Options {
bool verbose, batch, interactive, cont, fatal_timeouts, kmsg;
std::string testdir, outdir, workdir, heartbeat;
std::vector< std::string > flavours, filter, watch;
std::vector< std::string > flavours, filter, skip, watch;
std::string flavour_envvar;
int timeout;
Options() : verbose( false ), batch( false ), interactive( false ),
@@ -986,6 +986,7 @@ struct Main {
Cases cases;
void setup() {
bool filter;
Listing l = listdir( options.testdir, true );
std::sort( l.begin(), l.end() );
@@ -997,15 +998,33 @@ struct Main {
continue;
if ( i->substr( 0, 4 ) == "lib/" )
continue;
bool filter = !options.filter.empty();
for ( std::vector< std::string >::iterator filt = options.filter.begin();
filt != options.filter.end(); ++filt ) {
if ( i->find( *filt ) != std::string::npos )
filter = false;
if (!options.filter.empty()) {
filter = true;
for ( std::vector< std::string >::iterator filt = options.filter.begin();
filt != options.filter.end(); ++filt ) {
if ( i->find( *filt ) != std::string::npos ) {
filter = false;
break;
}
}
if ( filter )
continue;
}
if ( filter )
continue;
if (!options.skip.empty()) {
filter = false;
for ( std::vector< std::string >::iterator filt = options.skip.begin();
filt != options.skip.end(); ++filt ) {
if ( i->find( *filt ) != std::string::npos ) {
filter = true;
break;
}
}
if ( filter )
continue;
}
cases.push_back( TestCase( journal, options, options.testdir + *i, *i, *flav ) );
cases.back().options = options;
}
@@ -1215,6 +1234,11 @@ static int run( int argc, const char **argv, std::string fl_envvar = "TEST_FLAVO
else if ( hasenv( "T" ) )
split( getenv( "T" ), opt.filter );
if ( args.has( "--skip" ) )
split( args.opt( "--skip" ), opt.skip );
else if ( hasenv( "S" ) )
split( getenv( "S" ), opt.skip );
if ( args.has( "--fatal-timeouts" ) )
opt.fatal_timeouts = true;

View File

@@ -107,7 +107,7 @@ grep1_() {
awk -v pattern="${1}" 'NR==1 || $0~pattern' "${@:2}"
}
STACKTRACE() {
stacktrace() {
trap - ERR
local i=0
@@ -116,6 +116,13 @@ STACKTRACE() {
echo "## $i ${FUNC}() called from ${BASH_SOURCE[$i]}:${BASH_LINENO[$i]}"
i=$(($i + 1))
done
}
STACKTRACE() {
trap - ERR
local i=0
stacktrace
test "${LVM_TEST_PARALLEL:-0}" -eq 1 -o -n "$RUNNING_DMEVENTD" -o -f LOCAL_DMEVENTD || {
pgrep dmeventd &>/dev/null && \
@@ -211,7 +218,11 @@ dm_table() {
}
skip() {
test "$#" -eq 0 || echo "TEST SKIPPED: $@"
if test "$#" -eq 0; then
stacktrace
else
echo "TEST SKIPPED: $@"
fi
touch SKIP_THIS_TEST
exit 200
}