From 0cef163077e06ba210dc38ab08a1926c29914329 Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Tue, 21 Aug 2018 13:05:02 -0700 Subject: [PATCH] Incorporate the tests generated by AutoDoc into tst/testall.g --- README.md | 2 +- doc/makedoc.g | 5 ++++- maketest.g | 13 +++++++++++++ tst/AutoDoc_tests.g | 13 +++++++++++++ tst/testall.g | 14 +++++++++++--- 5 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 maketest.g create mode 100644 tst/AutoDoc_tests.g diff --git a/README.md b/README.md index 3582cf9..caf7d3f 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ your home directory. The authors of &RAQ; would like to acknowledge their debt to the creators of -&RIG;, an earlier package for Racks in &GAP;, chief among whom is Leandro +&RIG;, an earlier package for Racks in GAP; chief among whom is Leandro Vendramin. &RIG; was an inspiration for the creation of &RAQ;, and using and reading that package suggested many features needed in the development of &RAQ;. diff --git a/doc/makedoc.g b/doc/makedoc.g index 3fad619..706a238 100644 --- a/doc/makedoc.g +++ b/doc/makedoc.g @@ -2,5 +2,8 @@ # build the documentation for RAQ via AutoDoc LoadPackage("AutoDoc"); -AutoDoc(rec(autodoc := rec(files := ["README.md"]))); +AutoDoc(rec( + autodoc := rec(files := ["README.md"]), + maketest := rec(name := "tst/AutoDoc_tests.g") +)); QUIT; diff --git a/maketest.g b/maketest.g new file mode 100644 index 0000000..49878e6 --- /dev/null +++ b/maketest.g @@ -0,0 +1,13 @@ +## This file is automatically generated by AutoDoc. +## Changes will be discarded by the next call of the AutoDoc method. + + +AUTODOC_file_scan_list := [ "../PackageInfo.g", "../init.g", "../lib/byconj.gd", "../lib/byconj.gi", "../lib/bytable.gd", "../lib/bytable.gi", "../lib/constructions.gd", "../lib/constructions.gi", "../lib/structure.gd", "../lib/structure.gi", "../read.g" ]; + +LoadPackage( "GAPDoc" ); + +example_tree := ExtractExamples( Directory("./doc/"), "RAQ.xml", AUTODOC_file_scan_list, 500 ); + +RunExamples( example_tree, rec( compareFunction := "uptowhitespace" ) ); + +QUIT; diff --git a/tst/AutoDoc_tests.g b/tst/AutoDoc_tests.g new file mode 100644 index 0000000..c19234b --- /dev/null +++ b/tst/AutoDoc_tests.g @@ -0,0 +1,13 @@ +## This file is automatically generated by AutoDoc. +## Changes will be discarded by the next call of the AutoDoc method. + + +AUTODOC_file_scan_list := [ "../PackageInfo.g", "../init.g", "../lib/byconj.gd", "../lib/byconj.gi", "../lib/bytable.gd", "../lib/bytable.gi", "../lib/constructions.gd", "../lib/constructions.gi", "../lib/structure.gd", "../lib/structure.gi", "../maketest.g", "../read.g" ]; + +LoadPackage( "GAPDoc" ); + +example_tree := ExtractExamples( Directory("./doc/"), "RAQ.xml", AUTODOC_file_scan_list, 500 ); + +RunExamples( example_tree, rec( compareFunction := "uptowhitespace" ) ); + +QUIT; diff --git a/tst/testall.g b/tst/testall.g index 01ba21d..f4ddfe1 100644 --- a/tst/testall.g +++ b/tst/testall.g @@ -2,9 +2,17 @@ LoadPackage( "RAQ" ); -TestDirectory(DirectoriesPackageLibrary("RAQ","tst"), - rec(exitGAP := true, +tst_path := DirectoriesPackageLibrary("RAQ", "tst"); + +TestDirectory(tst_path, + rec(exitGAP := false, testOptions := rec(compareFunction := "uptowhitespace")) ); -FORCE_QUIT_GAP(1); # should be unreachable +auto_file := Filename(tst_path, "AutoDoc_tests.g"); + +if auto_file <> fail then + Read(auto_file); +else + Info(InfoWarning, 1, "Warning: Cannot find AutoDoc_tests.g. Run `gap doc/makedoc.g` in the RAQ package directory."); +fi;