CMU Artificial Intelligence Repository
 
   
   
   
   
  
AUTOTEST: Prolog predicate auto-tester
lang/prolog/code/testing/autotest/
 
This program reads a file or files of Prolog goals, where each goal is
accompanied by a specification saying whether it should succeed, fail,
cause an error, or pass some tests on its bound variables.
For each goal/specification pair, the program calls the goal, and
compares its effect against the specification. If they differ, then a
warning message is displayed. This is useful for automatically testing
predicates against their expected outputs - the test files can be
kept, and re-run every time a predicate is changed.
As an example, a test file for 'functor', and good old 'append' and
'member' might contain these lines:
    append( [], [1,2,3], [1,2,3] ) :: succeeds.
    append( [1,2,3], [], [1,2,3] ) :: succeeds.
    append( [1,2], [3,4,5], [1,2,3,4,5] ) :: succeeds.
    member( any, [] ) :: fails.
    member( any, [a,b,c,d,e,any] ) :: succeeds.
    member( any, [a,b,c,d,e] ) :: fails.
    functor( f(1,2), F, A ) :: F = f, A = 2.
Origin:   
   src.doc.ic.ac.uk:packages/prolog-pd-software/ (146.169.2.1)
   as autotest.tar.Z
Version:      20-FEB-88
Ports:        Edinburgh-compatible Prologs
CD-ROM:       Prime Time Freeware for AI, Issue 1-1
Author(s):    Jocelyn Paine 
              Department of Experimental Psychology
              Oxford University
              South Parks Road
              Oxford OX1 3UD
              Tel: (0865) 271444
              Fax: (0865) 310447
Keywords:
   Authors!Paine, Autotest, Oxford, Prolog!Code, Prolog!Testing, 
   Testing
References:   ?
Last Web update on Mon Feb 13 10:34:01 1995 
AI.Repository@cs.cmu.edu