1 | README file for Singular test-suite |
---|
2 | =================================== |
---|
3 | |
---|
4 | This is the test-suite for Singular. This directory contains |
---|
5 | |
---|
6 | regress.cmd -- perl script which drives tests |
---|
7 | Short -- directory containing "short" tests |
---|
8 | Long -- directory containing "long" tests |
---|
9 | Old -- directory containing "old" (TST) tests |
---|
10 | |
---|
11 | To run Singular test(s): |
---|
12 | ------------------------ |
---|
13 | 1.) Put the Singular binary in this directory |
---|
14 | 2.) cd to one of the directories above |
---|
15 | 3.) 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). |
---|
19 | 4.) 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. |
---|
23 | 5.) If no diffs were found, xx.diff and xx.new.res are rm'ed and |
---|
24 | xx.res is gzip'ed. Otherwise (i.e., diffs were found), xx.diff and |
---|
25 | xx.new.res are kept, diffs are printed to stdout, and regress.cmd |
---|
26 | exits with exit status != 0. |
---|
27 | |
---|
28 | Do also |
---|
29 | ../regress.cmd -h |
---|
30 | for some more details on regress.cmd. |
---|
31 | |
---|
32 | To add a new test for a library/commando to the test-suite: |
---|
33 | ----------------------------------------------------------- |
---|
34 | * The following files need to be provided: |
---|
35 | short/xx_s.tst : Singular code for short and basic tests |
---|
36 | long/xx_l.tst : Singular code for long and extended tests |
---|
37 | short/xx_s.res : Result output of xx_s.tst |
---|
38 | long/xx_l.res : Result output of xx_l.tst |
---|
39 | or, alternatively: |
---|
40 | short/xx.tst: Singular code for short tests, only |
---|
41 | short/xx.res : Result output of xx.tst |
---|
42 | |
---|
43 | * xx_s.tst should test the essential functionality of the |
---|
44 | library/commando in a relatively short time (say, in no more than |
---|
45 | 30s). |
---|
46 | |
---|
47 | * xx_l.tst should test the functionality of the |
---|
48 | library/commando in detail so that, if possible, all relevant |
---|
49 | cases/results are tested. Nevertheless, such a test should not run |
---|
50 | longer than, say, 10 minutes. |
---|
51 | |
---|
52 | * If useful test do generally execute in a short time, have xx.tst, |
---|
53 | only. |
---|
54 | |
---|
55 | * Rules for providing tst files: |
---|
56 | 1.) tst files always start with the following three commandos as |
---|
57 | preamble: |
---|
58 | LIB "tst.lib"; |
---|
59 | tst_init(); |
---|
60 | tst_ignore("CVS ID $Id:$"); |
---|
61 | tst_init() writes some general info to stdout (like date, |
---|
62 | uname, hostname, version, etc.). The library tst.lib (appended |
---|
63 | below) provides, among others, the routines tst_init() and |
---|
64 | tst_ignore(). |
---|
65 | |
---|
66 | 2.) All system-dependent output (like run-times, memory usages, |
---|
67 | pathnames, dates, etc.) must be output by means of the routine |
---|
68 | tst_ignore(...): |
---|
69 | tst_ignore(val [, keyword]): 'val' can have arbitrary type for which |
---|
70 | a string conversion exists; |
---|
71 | if present, keyword must be one of the |
---|
72 | following strings: "time", "memory" |
---|
73 | tst_ignore() outputs 'val' by prepending the following prefix: |
---|
74 | no keyword -- // ignore: |
---|
75 | "time" keyword -- // ignore: time: |
---|
76 | "memory" keyword -- // ignore: memory: |
---|
77 | which causes automatic tests to ignore these lines when doing a diff |
---|
78 | on result files. If possible, short tests should not contain |
---|
79 | system-dependent output. |
---|
80 | |
---|
81 | * Command for generating *.res files: |
---|
82 | cd <directopry where xx.tst should reside>; ../regress.cmd -g xx.tst |
---|
83 | |
---|
84 | |
---|