File: 01_compile.t

package info (click to toggle)
libppi-perl 1.236-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,056 kB
  • ctags: 922
  • sloc: perl: 15,002; makefile: 8
file content (40 lines) | stat: -rwxr-xr-x 828 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/perl

# This test script only tests that the tree compiles

use lib 't/lib';
use PPI::Test::pragmas;
use Test::More tests => 17 + ($ENV{AUTHOR_TESTING} ? 1 : 0);


# Do the modules load
use_all_ok( qw{
	PPI
	PPI::Tokenizer
	PPI::Lexer
	PPI::Dumper
	PPI::Find
	PPI::Normal
	PPI::Util
	PPI::Cache
	} );

sub use_all_ok {
	my @modules = @_;

	# Load each of the classes
	foreach my $module ( @modules ) {
		use_ok( $module );
	}

	# Check that all of the versions match
	my $main_module = shift(@modules);
	my $expected    = $main_module->VERSION;
	ok( $expected, "Found a version for the main module ($expected)" );

	foreach my $module ( @modules ) {
		is( $module->VERSION, $expected, "$main_module->VERSION matches $module->VERSION ($expected)" );
	}
}

ok( ! $PPI::XS::VERSION, 'PPI::XS is correctly NOT loaded' );