| 1 | # Licensed to the Apache Software Foundation (ASF) under one or more | ||
| 2 | # contributor license agreements. See the NOTICE file distributed with | ||
| 3 | # this work for additional information regarding copyright ownership. | ||
| 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| 5 | # (the "License"); you may not use this file except in compliance with | ||
| 6 | # the License. You may obtain a copy of the License at | ||
| 7 | # | ||
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | # | ||
| 10 | # Unless required by applicable law or agreed to in writing, software | ||
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | # See the License for the specific language governing permissions and | ||
| 14 | # limitations under the License. | ||
| 15 | # | ||
| 16 | package Apache::TestRunParrot; | ||
| 17 | |||
| 18 | use strict; | ||
| 19 | use warnings FATAL => 'all'; | ||
| 20 | |||
| 21 | use File::Spec::Functions qw(catfile canonpath); | ||
| 22 | |||
| 23 | use Apache::TestRun (); | ||
| 24 | use Apache::TestConfigParse (); | ||
| 25 | use Apache::TestTrace; | ||
| 26 | use Apache::TestConfigParrot (); | ||
| 27 | |||
| 28 | use vars qw($VERSION); | ||
| 29 | $VERSION = '1.00'; # make CPAN.pm's r() version scanner happy | ||
| 30 | |||
| 31 | use File::Spec::Functions qw(catfile); | ||
| 32 | |||
| 33 | # subclass of Apache::TestRun that configures parrot things | ||
| 34 | use vars qw(@ISA); | ||
| 35 | @ISA = qw(Apache::TestRun); | ||
| 36 | |||
| 37 | sub new_test_config { | ||
| 38 | my $self = shift; | ||
| 39 | |||
| 40 | Apache::TestConfigParrot->new($self->{conf_opts}); | ||
| 41 | } | ||
| 42 | |||
| 43 | sub configure_parrot { | ||
| 44 | my $self = shift; | ||
| 45 | |||
| 46 | my $test_config = $self->{test_config}; | ||
| 47 | |||
| 48 | $test_config->postamble_register(qw(configure_parrot_tests)); | ||
| 49 | } | ||
| 50 | |||
| 51 | sub configure { | ||
| 52 | my $self = shift; | ||
| 53 | |||
| 54 | $self->configure_parrot; | ||
| 55 | |||
| 56 | $self->SUPER::configure; | ||
| 57 | } | ||
| 58 | |||
| 59 | #if Apache::TestRun refreshes config in the middle of configure | ||
| 60 | #we need to re-add parrotconfigure hooks | ||
| 61 | sub refresh { | ||
| 62 | my $self = shift; | ||
| 63 | $self->SUPER::refresh; | ||
| 64 | $self->configure_parrot; | ||
| 65 | } | ||
| 66 | |||
| 67 | 1; | ||
| 68 | __END__ |