Lines Matching +full:self +full:- +full:test
2 # Copyright 2015-2022 The OpenSSL Project Authors. All Rights Reserved.
32 my $recipesdir = catdir($srctop, "test", "recipes");
37 $ENV{OPENSSL_CONF_INCLUDE} = rel2abs(catdir($bldtop, "test"));
40 $ENV{CTLOG_FILE} = rel2abs(catfile($srctop, "test", "ct", "log_list.cnf"));
43 # set to a non-zero value. Can be helpful for detecting uninitialized reads in
50 switches => '-w',
65 # TAP::Harness->new(), they will be accessed directly, see the
89 # for parallel test runs, do slow tests first
91 $key =~ s/(\d+)-/01-/;
100 (my $x = basename($_)) =~ s|^[0-9][0-9]-(.*)\.t$|$1|;
109 } elsif ($arg =~ m/^(-?)(.*)/) {
111 my $test = $2;
112 my @matches = find_matching_tests($test);
114 # If '-foo' is the first arg, it's short for 'alltests -foo'
115 if ($sign eq '-' && $initial_arg) {
120 warn "Test $test found no match, skipping ",
121 ($sign eq '-' ? "removal" : "addition"),
124 foreach $test (@matches) {
125 if ($sign eq '-') {
126 delete $tests{$test};
128 $tests{$test} = 1;
140 my @preps = glob(catfile($recipesdir,"00-prep_*.t"));
141 foreach my $test (@preps) {
142 delete $tests{$test};
148 if ($glob =~ m|^[\d\[\]\?\-]+$|) {
149 return glob(catfile($recipesdir,"$glob-*.t"));
152 return glob(catfile($recipesdir,"*-$glob.t"));
156 # and Test::Harness, depending on what's available.
158 # HARNESS_TAP_COPY, while the Test::Harness hack can't, because the pre
159 # TAP::Harness Test::Harness simply doesn't have support for this sort of
169 use parent -norequire, 'TAP::Parser';
186 $callbacks{ALL} = sub { # on each line of test output
187 my $self = shift;
189 print $fh $self->as_string, "\n"
194 my $is_plan = $self->is_plan;
195 my $tests_planned = $is_plan && $self->tests_planned;
196 my $is_test = $self->is_test;
197 my $is_ok = $is_test && $self->is_ok;
199 # workaround for parser not coping with sub-test indentation
200 if ($self->is_unknown) {
205 if ($self->as_string =~ m/^$indent 1\.\.(\d+)/);
207 if ($self->as_string =~ m/^$indent(not )?ok /);
213 } elsif ($is_test) { # result of a test
214 pop @plans if @plans && --($plans[-1]) <= 0;
237 print "\n".$self->as_string
239 …print "\n# ------------------------------------------------------------------------------" if !$is…
241 } elsif ($self->as_string ne "") {
243 $output_buffer .= "\n".$self->as_string;
251 my $self = shift;
254 if (scalar $self->failed > 0 && @failure_output) {
271 return $class->SUPER::new({ %opts });
275 use parent -norequire, 'TAP::Harness';
288 use parent 'Test::Harness';
298 my $self = shift;
300 # Pre TAP::Harness Test::Harness doesn't support [ filename, name ]
302 my @args = map { ref($_) eq 'ARRAY' ? $_->[0] : $_ } @_;
305 if ($self->{switches}) {
306 push @switches, $self->{switches};
308 if ($self->{lib}) {
309 foreach (@{$self->{lib}}) {
316 push @switches, "-I$l";
320 $Test::Harness::switches = join(' ', @switches);
321 Test::Harness::runtests(@args);
335 my $harness = $package->new(\%tapargs);
337 $harness->runtests(map { [ abs2rel($_, rel2abs(curdir())), basename($_) ] }
340 if (ref($ret) ne "TAP::Parser::Aggregator" || !$ret->has_errors) {
342 $harness->runtests(map { [ abs2rel($_, rel2abs(curdir())), basename($_) ] }
346 # If this is a TAP::Parser::Aggregator, $ret->has_errors is the count of
350 exit 0 unless $ret->has_errors;
352 # On VMS, perl converts an exit 1 to SS$_ABORT (%SYSTEM-F-ABORT), which
364 # If this isn't a TAP::Parser::Aggregator, it's the pre-TAP test harness,
365 # which simply dies at the end if any test failed, so we don't need to bother