diff --git a/tst/template.tst b/tst/template.tst index 92ba089..fb10dd0 100644 --- a/tst/template.tst +++ b/tst/template.tst @@ -21,7 +21,7 @@ gap> tmpdir := Filename( DirectoryTemporary(), "packagemaker-template-tst" );; gap> if IsDirectoryPath( tmpdir ) then RemoveDirectoryRecursively( tmpdir ); fi; gap> AUTODOC_CreateDirIfMissing( tmpdir ); true -gap> olddir := AUTODOC_CurrentDirectory();; +gap> olddir := PKGMKR_CurrentDirectory();; gap> ChangeDirectoryCurrent( tmpdir );; gap> AUTODOC_CreateDirIfMissing( pkginfo.PackageName ); true diff --git a/tst/utils.g b/tst/utils.g index d8b6978..0715b21 100644 --- a/tst/utils.g +++ b/tst/utils.g @@ -35,6 +35,19 @@ BindGlobal( "PKGMKR_ExpectedDir", function( name ) Concatenation( "tst/", name, ".expected" ) ); end ); +BindGlobal( "PKGMKR_CurrentDirectory", +function(args...) + local pwd, result, out; + pwd := Filename( DirectoriesSystemPrograms(), "pwd" ); + if pwd = fail then + Error("failed to locate 'pwd' tool"); + fi; + result := ""; + out := OutputTextString( result, true ); + Process( DirectoryCurrent(), pwd, InputTextNone(), out, []) ; + return Chomp( result ); +end ); + BindGlobal( "PKGMKR_GenerateFixture", function( name, answers ) local tempdir, olddir, actualdir; @@ -45,7 +58,7 @@ BindGlobal( "PKGMKR_GenerateFixture", function( name, answers ) fi; AUTODOC_CreateDirIfMissing( tempdir ); - olddir := AUTODOC_CurrentDirectory(); + olddir := PKGMKR_CurrentDirectory(); ChangeDirectoryCurrent( tempdir ); PackageWizardGenerate( answers : skipGitRepositorySetup := true ); ChangeDirectoryCurrent( olddir );