Skip to content

Commit

Permalink
Test ExtendRootDirectories and SetPackagePath
Browse files Browse the repository at this point in the history
Move mockpkg to subdirectory pkg for this.
  • Loading branch information
zickgraf committed Nov 3, 2022
1 parent 82d700a commit e64f523
Show file tree
Hide file tree
Showing 26 changed files with 21 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dev/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ GAPInput
ln -s $SRCDIR/pkg $GAPPREFIX/share/gap/pkg

# test building and loading package kernel extension
cd "$SRCDIR/tst/mockpkg"
cd "$SRCDIR/tst/pkg/mockpkg"
testmockpkg "$GAPPREFIX/bin/gap" "$GAPPREFIX/lib/gap"

# run testsuite for the resulting GAP
Expand Down Expand Up @@ -314,7 +314,7 @@ GAPInput
cat "$BUILDDIR/sysinfo.gap"

# test building and loading a package kernel extension
cd "$SRCDIR/tst/mockpkg"
cd "$SRCDIR/tst/pkg/mockpkg"
testmockpkg "$GAP --cover $COVDIR/testmockpkg.coverage" "$BUILDDIR"
;;

Expand Down
1 change: 0 additions & 1 deletion tst/mockpkg/Makefile.gappkg

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions tst/pkg/mockpkg/Makefile.gappkg
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 17 additions & 1 deletion tst/testinstall/package.tst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#@local entry,equ,pair,sml,oldTermEncoding,pkginfo,info,mockpkgpath,p,n
#@local entry,equ,pair,sml,oldTermEncoding,pkginfo,info,mockpkgpath,tstpath,p,n
gap> START_TEST("package.tst");

# CompareVersionNumbers( <supplied>, <required>[, \"equal\"] )
Expand Down Expand Up @@ -640,5 +640,21 @@ false
gap> IsPackageLoaded("mockpkg", ">=2.0");
false

# now add `tst` as a new root directory
gap> tstpath := DirectoriesLibrary("tst")[1];;
gap> ExtendRootDirectories( [ Filename( tstpath, "" ) ] );

# make sure that the newly discovered installation path matches
# the path from which mockpkg was loaded above
gap> Last( GAPInfo.PackagesInfo.mockpkg ).InstallationPath =
> GAPInfo.PackagesLoaded.mockpkg[1];
true

#
gap> SetPackagePath( "mockpkg", Filename( tstpath, "pkg/mockpkg" ) );
gap> SetPackagePath( "mockpkg", Filename( tstpath, "pkg/mockpkg/" ) );
gap> SetPackagePath( "mockpkg", "/some/other/directory" );
Error, another version of package mockpkg is already loaded

#
gap> STOP_TEST( "package.tst", 1);
2 changes: 1 addition & 1 deletion tst/teststandard/helptools.tst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ gap> PrintRenderedText:=function( chapter, section, key... )

# Load the help book for the mockpkg package
#
gap> HELP_ADD_BOOK("mockpkg","mockpkg",DirectoriesLibrary("tst/mockpkg/doc")[1]);
gap> HELP_ADD_BOOK("mockpkg","mockpkg",DirectoriesLibrary("tst/pkg/mockpkg/doc")[1]);

# First we test calling HELP_PRINT_SECTION_TEXT with three arguments
#
Expand Down

0 comments on commit e64f523

Please sign in to comment.