| 1 | package Log::Munger::App::Command::test_rule_file; | ||
| 2 | |||
| 3 | 16 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 16 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 16 | ▶ | use Log::Munger::App -command; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 16 | ▶ | use Log::Munger::RulesTest; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 16 | ▶ | use YAML::XS qw(Dump); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 1 | ▶ | sub opt_spec { |
|
Subroutine
opt_spec: called CC=1 SCAR=0.0
Pod
documented
| |||
| 10 | 1 | return ( [ 'f=s', 'Rule file to read.', { 'default' => 'base' } ], ); | |
| 11 | } | ||
| 12 | |||
| 13 | 0 | ▶ | sub abstract { "Run the built-in tests for one rule file" } |
|
Subroutine
abstract: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 14 | |||
| 15 | 0 | ▶ | sub description { |
|
Subroutine
description: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 16 | 0 | "Runs Log::Munger::RulesTest over a single rule file and dumps the whole result as YAML: a | |
| 17 | fatal load error if it would not load, then every error and warning found. | ||
| 18 | |||
| 19 | Use test_all instead for a pass/fail summary of every rule file. | ||
| 20 | "; | ||
| 21 | } | ||
| 22 | |||
| 23 | 1 | ▶ | sub validate { return 1 } |
|
Subroutine
validate: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 24 | |||
| 25 | 1 | ▶ | sub execute { |
|
Subroutine
execute: called CC=1 SCAR=0.0
Pod
documented
| |||
| 26 | 1 | my ( $self, $opts, $args ) = @_; | |
| 27 | |||
| 28 | 1 | my $rules = Log::Munger::RulesTest->test( 'file' => $opts->{'f'} ); | |
| 29 | |||
| 30 | 1 | print Dump($rules); | |
| 31 | |||
| 32 | } | ||
| 33 | |||
| 34 | 16 | 1; | |