Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions lib/test.gi
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,11 @@ InstallGlobalFunction("Test", function(arg)

# split input into GAP input, GAP output and comments
pf := ParseTestInput(full, opts.ignoreComments);

# Warn if we have not found any tests in the file
if IsEmpty(pf[1]) then
Info(InfoWarning, 1, "Test: File does not contain any tests!");
fi;

# run the GAP inputs and collect the outputs and the timings
RunTests(pf, rec(breakOnError := opts.breakOnError,
Expand Down
8 changes: 8 additions & 0 deletions tst/testinstall/files/invalidtestfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file contains some valid GAP code which is not
# a valid tst file, to check error reporting.
#
# It has a ".txt" extension to avoid it being found by
# Any code which looks through testinstall for .g or .tst files

x := 3;
g := SymmetricGroup(5);
10 changes: 10 additions & 0 deletions tst/testinstall/files/test.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
gap> START_TEST("test.tst");
gap> dir := DirectoriesLibrary("tst/testinstall/files");;
gap> Test(Filename(dir,"empty.txt"));
#I Test: File does not contain any tests!
true
gap> Test(Filename(dir,"invalidtestfile.txt"));
Error, Invalid data in test file
gap> Test(Filename(dir, "tinytest.txt"));
true
gap> STOP_TEST("test.tst");
1 change: 1 addition & 0 deletions tst/testinstall/files/tinytest.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gap> 1;;