File: basic_lint_without_sandbox.t

package info (click to toggle)
spamassassin 4.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 25,724 kB
  • sloc: perl: 89,143; ansic: 5,193; sh: 3,737; javascript: 339; sql: 295; makefile: 209; python: 49
file content (37 lines) | stat: -rwxr-xr-x 944 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/perl -T
#
# ensure the rules files work without rules/70_sandbox.cf

use lib '.'; use lib 't';
use SATest; sa_t_init("basic_lint_without_sandbox");
use Test::More tests => 3;

# ---------------------------------------------------------------------------

%patterns = (
  qr/^/, 'anything',
);

tstpre ("
  loadplugin Mail::SpamAssassin::Plugin::AWL
");

# override locale for this test!
$ENV{'LANGUAGE'} = $ENV{'LC_ALL'} = 'C';

my $scoresfile  = "$localrules/50_scores.cf";
my $sandboxfile = "$localrules/70_sandbox.cf";

# when running from the built tarball or make disttest, we will not have a full
# rules dir -- therefore no 70_sandbox.cf.  We will also have no 50_scores.cf,
# so we can use that to tell if this is the case
SKIP: {
    skip( "Not on a sandbox", 2 ) unless -f $scoresfile;
    ok -f $sandboxfile;
    unlink $sandboxfile;
    ok !-f $sandboxfile;
}

sarun ("-L --lint", \&patterns_run_cb);
ok_all_patterns();