1
- pkgName := " SmallClassNr" ;
2
-
3
- tst := DirectoriesPackageLibrary( pkgName, " tst" )[ 1 ] ;
4
- info := PackageInfo( pkgName )[ 1 ] ;
1
+ Read( " PackageInfo.g" );
2
+ info := GAPInfo.PackageInfoCurrent;
3
+ pkgName := info.PackageName;
5
4
6
5
if (
7
6
LoadPackage( pkgName, false ) = fail or
@@ -20,57 +19,41 @@ if IsBound( info.Extensions ) then
20
19
fi ;
21
20
22
21
AutoDoc( rec (
23
- autodoc := rec (
24
- files := [ " doc/manual.gd" ]
25
- ),
26
- scaffold := rec (
27
- bib := " manual.bib"
28
- ),
22
+ autodoc := rec ( scan_dirs := [ " doc" ] ),
29
23
gapdoc := rec (
30
- main := " manual.xml" ,
31
- LaTeXOptions := rec (
32
- LateExtraPreamble := " \\ usepackage{amsmath}"
33
- )
24
+ LaTeXOptions := rec ( LateExtraPreamble := " \\ usepackage{amsmath}" )
34
25
),
35
- extract_examples := rec (
36
- units := " Chapter"
37
- )
26
+ extract_examples := rec ( units := " File" )
38
27
));
39
28
40
- if not ValidatePackageInfo( " PackageInfo.g" ) then
29
+ if not ForAll(
30
+ [ " doc/manual.six" , " doc/manual.pdf" , " doc/chap0.html" ] ,
31
+ IsReadableFile
32
+ ) then
41
33
Info ( InfoGAPDoc, 1 , " #I One or more files could not be created.\n " );
42
34
ForceQuitGap( 1 );
43
35
else
44
36
Info ( InfoGAPDoc, 1 , " #I Manual files sucessfully created.\n " );
45
37
fi ;
46
38
47
- correct := true ;
48
- Info ( InfoGAPDoc, 1 , " #I Testing examples found in manual.\n " );
49
-
50
- lpkgName := LowercaseString( pkgName );
51
- lpkgName := ReplacedString( lpkgName, " " , " _" );
52
-
53
- for file in AsSortedList( DirectoryContents( tst ) ) do
54
- if (
55
- StartsWith( file, lpkgName ) and
56
- EndsWith( file, " .tst" ) and
57
- Length( file ) - Length( lpkgName ) >= 6 and
58
- ForAll( file{[ 1 + Length( lpkgName ) .. Length( file ) - 4 ]} , IsDigitChar )
59
- ) then
60
- Info ( InfoGAPDoc, 1 , Concatenation( " #I Now testing file " , file, " \n " ) );
61
- correct := correct and Test(
62
- Filename( tst, file ),
63
- rec ( compareFunction := " uptowhitespace" )
64
- );
65
- RemoveFile( Filename( tst, file ) );
39
+ tstFile := Concatenation(
40
+ " tst/" ,
41
+ ReplacedString( LowercaseString( pkgName ), " " , " _" ),
42
+ " 01.tst"
43
+ );
44
+
45
+ if IsReadableFile( tstFile ) then
46
+ Info ( InfoGAPDoc, 1 , " #I Testing examples found in manual.\n " );
47
+ correct := Test( tstFile, rec ( compareFunction := " uptowhitespace" ) );
48
+ RemoveFile( tstFile );
49
+ if correct then
50
+ Info ( InfoGAPDoc, 1 , " #I All examples are correct.\n " );
51
+ else
52
+ Info ( InfoGAPDoc, 1 , " #I One or more examples are incorrect.\n " );
53
+ ForceQuitGap( 1 );
66
54
fi ;
67
- od ;
68
-
69
- if not correct then
70
- Info ( InfoGAPDoc, 1 , " #I One or more examples are incorrect.\n " );
71
- ForceQuitGap( 1 );
72
55
else
73
- Info ( InfoGAPDoc, 1 , " #I All tests passed - manual should be correct .\n " );
56
+ Info ( InfoGAPDoc, 1 , " #I No examples found in manual.\n " );
74
57
fi ;
75
58
76
59
Info ( InfoGAPDoc, 1 , " #I Documentation successfully created.\n " );
0 commit comments