source: git/Tst/README @ 19fbf0

spielwiese
Last change on this file since 19fbf0 was 779b9b7, checked in by Olaf Bachmann <obachman@…>, 26 years ago
* how to pack and unpack git-svn-id: file:///usr/local/Singular/svn/trunk@1798 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 3.9 KB
Line 
1README file for Singular test-suite
2===================================
3
4This is the test-suite for Singular. This directory contains
5
6regress.cmd     -- perl script which drives tests
7Short           -- directory containing "short" tests
8Long            -- directory containing "long" tests
9Old             -- directory containing "old" (TST) tests
10
11To run Singular test(s):
12------------------------
131.) Put the Singular binary in this directory
142.) cd to one of the directories above
153.) run
16     ../regress.cmd [*.tst] [*.lst]
17    with the desired tst (i.e., Singular test scripts) or lst (list
18    of tst files) file(s).
194.) For each file xx.tst,
20      ../Singular -tqr12345678 xx.tst > xx.new.tst
21      diff xx.res xx.new.res | tee xx.diff
22    is run.
235.) If no diffs were found, xx.diff and xx.new.res are rm'ed and
24    xx.res is gzip'ed and uuencoded. Otherwise (i.e., diffs were
25    found), xx.diff and xx.new.res are kept, diffs are printed to
26    stdout, and regress.cmd exits with exit status != 0.
27
28Do also
29   ../regress.cmd -h
30and see the source code of ../regress.cmd for some more details on
31regress.cmd.
32
33Note:
34(1) You should use regress.cmd -g to generate a result file!
35(2) You need the (GNU) uuencode for regress.cmd to work
36
37To unpack a result file (say, xx)
38----------------------------------
39uudecode -o xx.res.gz xx.res.gz.uu; gunzip -f xx.res.gz
40
41To pack a result file (say, xx)
42--------------------------------
43gzip -f xx.res; uuencode xx.res.gz xx.res.gz > xx.res.gz.uu; rm -rf xx.res.gz
44
45
46To add a new test for a library/commando to the test-suite:
47-----------------------------------------------------------
48* The following files need to be provided:
49        short/xx_s.tst : Singular code for short and basic tests
50        long/xx_l.tst : Singular code for long and extended tests
51        short/xx_s.res.gz.uu : Result output of xx_s.tst
52        long/xx_l.resres.gz.uu : Result output of xx_l.tst
53  or, alternatively:
54        short/xx.tst: Singular code for short tests, only
55        short/xx.res : Result output of xx.tst
56
57* xx_s.tst should test the essential functionality of the
58  library/commando in a relatively short time (say, in no more than
59  30s).
60
61* xx_l.tst should test the functionality of the
62  library/commando in detail so that, if possible, all relevant
63  cases/results are tested. Nevertheless, such a test should not run
64  longer than, say, 10 minutes.
65
66* If useful tests do generally execute in a short time, have xx.tst,
67  only.
68
69* Rules for providing tst files:
70  1.) tst files always start with the following three commandos as
71  preamble:
72         LIB "tst.lib";
73         tst_init();
74         tst_ignore("CVS ID $Id:$");
75  tst_init() writes some general info to stdout (like date,
76  uname, hostname, version, etc.). The library tst.lib (appended
77  below) provides, among others, the routines tst_init() and
78  tst_ignore().
79
80  2.) All system-dependent output (like run-times, memory usages,
81  pathnames, dates, etc.) must be output by means of the routine
82  tst_ignore(...):
83  tst_ignore(val [, keyword]): 'val' can have arbitrary type for which
84                               a string conversion exists;
85                               if present, keyword must be one of the
86                               following strings: "time", "memory"
87  tst_ignore() outputs 'val' by prepending the following prefix:
88  no keyword --       // ignore:
89  "time" keyword --   // ignore: time:
90  "memory" keyword -- // ignore: memory:
91  which causes automatic tests to ignore these lines when doing a diff
92  on result files.
93 
94  3.) Time and/or memory-intensive tests should be followed by
95  (tst_ignore'd) time (resp. memory) output, so that we can keep track
96  of the timing (resp. memory) behaviour of Singular. This could be
97  accomplished as shown below:
98  int mytime = timer;
99  /* time/memory intesive computations */
100  tst_ignore("time", timer - mytime);
101  tst_ignore("memory", memory(0));
102
103* Command for generating *.res.gz.uu files:
104  cd <directopry where xx.tst should reside>; ../regress.cmd -g xx.tst
105
106
Note: See TracBrowser for help on using the repository browser.