Commit 1780e6d9 authored by Richard Levitte's avatar Richard Levitte
Browse files

Add a method to list available tests

parent 187bad4c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -439,6 +439,10 @@ tests: rehash
	$(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf tests );
	OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a

list-tests:
	@(cd test && \
	        $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. list-tests)

report:
	@$(PERL) util/selftest.pl

+2 −0
Original line number Diff line number Diff line
@@ -153,6 +153,8 @@ tags:

tests:	exe apps
	TOP=$(TOP) PERL=$(PERL) $(PERL) run_tests.pl $(TESTS)
list-tests:
	@TOP=$(TOP) PERL=$(PERL) $(PERL) run_tests.pl list

apps:
	@(cd ..; $(MAKE) DIRS=apps all)
+10 −3
Original line number Diff line number Diff line
@@ -26,7 +26,8 @@ my @tests = ( "alltests" );
if (@ARGV) {
    @tests = @ARGV;
}
if (grep /^alltests$/, @tests) {
my $list_mode = scalar(grep /^list$/, @tests) != 0;
if (grep /^alltests|list$/, @tests) {
    @tests = grep {
	basename($_) =~ /^[0-9][0-9]-[^\.]*\.t$/
    } glob(catfile($recipesdir,"*.t"));
@@ -40,6 +41,12 @@ if (grep /^alltests$/, @tests) {
    @tests = @t;
}

if ($list_mode) {
    @tests = map { $_ = basename($_); $_ =~ s/^[0-9][0-9]-//; $_ =~ s/\.t$//;
                   $_ } @tests;
    print join("\n", @tests), "\n";
} else {
    @tests = map { abs2rel($_, rel2abs(curdir())); } @tests;

    runtests(sort @tests);
}