Dear Gap Forum,
We are using Gap as a programming language in a course on Applied Algebra.
Our students have to write several programs and then we check if the
programs' performance is all right. Since the number of students is high,
it is not advisable to open a Gap session and check the programs student
by student. Instead, we have thought to write a test file "programs.tst"
in which we ask Gap for comparisson of the results of the students'
functions, when applied to some specific arguments, with the correct
results. We keep the results of the test in a file "programs.rsl", by
including in "programs.tst" the sentence LogTo("programs.rsl") as its
first line.
More specifically, we have written a shell (we are working under UNIX),
that runs through the students' directories and executes silently the file
"programs.tst" under Gap by means of:
gap -q < programs.tst > /dev/null (*)
In this way, we only have to run this shell and then check if the results
logged to the "programs.rsl" file in each directory are always "true".
The problem comes when a badly written function, when applied to our test
arguments, causes Gap to enter a break loop. Then, the Gap session begun
by (*) will not finish, since we are not working interactively, and the
statements appearing from that point on will not be evaluated nor logged
to the "programs.rsl" file.
This problem could be fixed if there were some way to tell Gap, when
opening a session, that break loops should be quitted automatically.
I suspect this cannot be done, since the behaviour of break loops is
probably implemented in the kernel, but there is no harm in asking!
If you can give a positive answer to this question or can suggest another
way of getting what we want, please let us know. It is important to us to
find some way of automating this heavy task.
################################################################## # Gustavo Fernandez Alcober # # Matematika Saila Voice: 34 4 4647700 # # Zientzi Fakultatea Fax: 34 4 4858147 # # Euskal Herriko Unibertsitatea e-mail: mtpfealg@lg.ehu.es # # 644 Posta kutxatila # # 48080 BILBO (Spain) # ##################################################################