Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

update run_tests.sh #13

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 35 additions & 3 deletions run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,38 @@ if [[ -z $NO_COVERAGE ]]; then
GAP="$GAP --cover ${COVDIR-coverage}/$(mktemp XXXXXX).coverage"
fi

# TODO: honor TestFile from PackageInfo record, but make sure that it
# is for the package in the current directory
$GAP ${GAP_TESTFILE:-tst/testall.g}
$GAP $GAP_FLAGS <<GAPInput
info := "PackageInfo.g";
if IsReadableFile( info ) then
Unbind( GAPInfo.PackageInfoCurrent );
Read( info );
if IsBound( GAPInfo.PackageInfoCurrent ) then
record := GAPInfo.PackageInfoCurrent;
Unbind( GAPInfo.PackageInfoCurrent );
else
Error( "Something is wrong with PackageInfo.g" );
fi;
else
Error( "PackageInfo.g is not readable" );
fi;

# Decide which packages should be loaded
# Default is all necessary & suggested packages
if $ALL_PACKAGES then
LoadAllPackages();
elif $ONLY_NEEDED then
LoadPackage( record.PackageName : OnlyNeeded );
else
LoadPackage( record.PackageName );
fi;

# Decide which test file should be used
# Default is test file listed in PackageInfo.g
if IsEmpty("${GAP_TESTFILE}") then
testFile := record.TestFile;
else
testFile := "${GAP_TESTFILE}";
fi;

Read( testFile );
GAPInput