SWI-Prolog/roadmap

Packs could have a standardized layout for PLT (Tests)

TeamSPoon opened this issue · 1 comments

Test files in Packs might have a standard expected layout so can do things like:

?- pack_run_tests(some_pack,[....]).

or

?- pack_verify(some_pack,[....]).

Right now everyone uses: test/ tests/ t/ or your_mom/

Maybe a pathname or something could be added to the pack.pl file?

and/or a single file found someplace like pack_verify.plt

And maybe a way to globally test all packs (for all packs that conform to this standard) like:

?- pack_test_all([include([pack1,pack2...]),exclude(...). ...]). 

That makes a lot of sense. The internal test files use these conventions:

  • named test_*.pl
  • Have module that is equal to the file name (minus .pl)
  • Export a predicate that is equal to the file name (minus .pl) and has no arguments
  • Expect the predicate to succeed if there is no issue.
  • Often this calls run_tests([test1, test2. ...]).

Given a standard directory name, we are done in that case. That might be easier than extending pack.pl?