RT 4.0.19
[freeside.git] / rt / t / 00-mason-syntax.t
1 use strict;
2 use warnings;
3
4 use RT::Test nodb => 1;
5
6
7 use File::Find;
8 find( {
9     no_chdir => 1,
10     wanted   => sub {
11         return if /(?:\.(?:jpe?g|png|gif|rej)|\~)$/i;
12         return if m{/\.[^/]+\.swp$}; # vim swap files
13         return unless -f $_;
14         local ($@);
15         ok( eval { compile_file($_) }, "Compiled $File::Find::name ok: $@");
16     },
17 }, RT::Test::get_relocatable_dir('../share/html'));
18
19 use HTML::Mason;
20 use HTML::Mason::Compiler;
21 use HTML::Mason::Compiler::ToObject;
22 BEGIN { require RT::Test; }
23 use Encode qw(decode_utf8);
24
25 sub compile_file {
26     my $file = shift;
27
28     my $text = decode_utf8(RT::Test->file_content($file));
29
30     my $compiler = new HTML::Mason::Compiler::ToObject;
31     $compiler->compile(
32         comp_source => $text,
33         name => 'my',
34         comp_path => 'my',
35     );
36     return 1;
37 }
38