https://issues.apache.org/SpamAssassin/show_bug.cgi?id=5938

           Summary: create a rules test suite
           Product: Spamassassin
           Version: SVN Trunk (Latest Devel Version)
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: Regression Tests
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


I've come up with a pretty simple, but working concept for a rule test suite
based on sample messages.

at top level, we add a dir, "t.rules".  In there, there are subdirs named for
each tested rule: BOUNCE_MESSAGE, FORGED_MUA_OUTLOOK, etc.   In each subdir,
there's a collection of files, each containing 1 message.

It's expected that each message should fire the named rule.  However if the
filename starts with "fp", ie. it's a sample of a false positive, the message
should NOT fire that rule.

at top-level there's a driver script, "t.rules/run", which iterates through
this list running "spamassassin -Lt < msg" and validates that the rules hit (or
don't hit).

Commentary about the test case, the bug it's related to, etc. can appear in the
filename, or in a synthetic header at the top of the message sample like this:

  Comment: this is a test case from bug 9458 blah blah.

I've been using this recently with good results -- it works quite nicely.


TODO: symlinks?  can we check in symbolic links to use the same sample message
for multiple rules? if not we may need to define a link mechanism.

TODO: do we need a way to specify SA user_prefs configuration to go with a test
message?  so far it hasn't been necessary but it might be.  a synthetic header
would be a good way to do this too.


-- 
Configure bugmail: 
https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Reply via email to