• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..21-Aug-2018-

config/H21-Aug-2018-10051

lib/H21-Aug-2018-393274

vmips.misc-tests/H21-Aug-2018-1,233910

vmips.outcheck/H21-Aug-2018-1,148881

vmips.regcheck/H21-Aug-2018-3,0552,286

Makefile.amH A D15-Apr-20041.7 KiB4832

Makefile.inH A D20-Aug-201820 KiB666577

READMEH A D14-Aug-20185.2 KiB12192

README

1
214 Test Suite
3*************
4
5VMIPS has a test suite with a small number of regression tests.  It
6uses the DejaGNU test framework, which is written in the Expect
7language.  Expect was written by Don Libes, and is a dialect of Tcl,
8the Tool Command Language by Ousterhout et al.
9
1014.1 How to run the test suite
11==============================
12
13In order to run the test suite or add tests to it, you will need to have
14Expect and DejaGNU installed.  Any version of DejaGNU later than 1.3
15should work fine. We have mostly used Expect version 5.32 or later;
16older versions may have bugs that may lead to unexpected test failures.
17
18   The next step is to configure and build VMIPS from source. This is
19important, because currently, you can only run tests on a freshly built
20copy of VMIPS; no provision exists for testing a previously installed
21copy of VMIPS.  Simply run `./configure' and `make' from the top level
22source directory to build VMIPS. See the "Installation" section of the
23manual for more details.
24
25   To run the test suite, run `make check' from the top level source
26directory.  This will invoke the DejaGNU `runtest' command.  It will
27take a minute or so, and then you will get a count of tests that passed
28and failed.  If you want to see a more comprehensive listing from
29`runtest', pass it the appropriate options through the Makefile, by
30typing, for example: `make RUNTESTFLAGS=--verbose check'.
31
32   You can also run the test suite by changing into the `test_code'
33directory in the source tree and running `runtest --tool vmips'.
34
35   As a general rule, no tests should fail in a released version of
36VMIPS; however, CVS builds may have test failures from time to time.
37
3814.2 Test suite frameworks
39==========================
40
41VMIPS has two comprehensive testing frameworks: the `regcheck'
42framework, whose tests live in the `vmips.regcheck' directory, and the
43`outcheck' framework, whose tests live in the `vmips.outcheck'
44directory. The former looks at the final values of registers after a
45test case is run, and the latter looks at the output that VMIPS prints
46out when a test case is run.
47
48   Each of these main testing frameworks has its own `.exp' file that
49runs it.  You can easily run the subset of the test suite controlled by
50a given `.exp' file, by passing its name on the `runtest' command line.
51For example, if you want to run all the `regcheck' tests, you would
52type: `runtest --tool vmips regcheck.exp'.
53
54   There are a few test cases that do not use either of these
55frameworks, because they have special requirements of some kind or are
56otherwise unique in some inconvenient way. These test cases have their
57own Expect drivers (`.exp' files) and live in the `vmips.misc-tests'
58directory.
59
60   In addition, each test case is defined by a `.par' file that
61contains the parameters of the test.  If you only want to run a single
62test from among the `regcheck' tests, specify its `.par' file after an
63equal sign. For example, you might type: `runtest --tool vmips
64regcheck.exp=mumble.par' to run only the `mumble.par' `regcheck' test.
65
6614.3 How to add a test to the test suite
67========================================
68
69To write a new test case, first decide whether it is easier to have
70your test case print out something or to look at the `haltdumpcpu'
71option's output to verify it. This will tell you whether it should be
72an `outcheck' test (if it prints out something) or a `regcheck' case
73(if you look at the register values).  Then write up a `.par' file for
74the test case -- the best way to learn how to do this, for the time
75being, is to examine the examples in the `test_code' directory. Then
76move the `.par' file and the test code (assembly or C) to the
77appropriate subdirectory for the framework you chose, `vmips.regcheck'
78or `vmips.outcheck'. Now you can try to make sure that it passes (or
79fails, as the case may be), by running `runtest --tool vmips' on it.
80
81   Also, note that you shouldn't add another test to `vmips.misc-tests'
82unless you can't find a way to fit it into any of the existing testing
83frameworks. Adding a test to `vmips.misc-tests' is tricky - you may be
84able to make progress by looking at the other `.exp' files in that
85directory.
86
8714.4 Common problems
88====================
89
90You can get screenfuls of `endian_option was not set' errors if you run
91`runtest' without first making a DejaGNU `site.exp' configuration file
92first.  To make a `site.exp' file, just run `make site.exp' in the
93`test_code' directory.
94
9514.5 Additional test cases needed
96=================================
97
98Test cases should probably be added for the following categories of
99VMIPS behaviors. (This list is from 2002; it is probably a good start,
100but it may be out of date in the sense that it is unlikely to be
101exhaustive.)
102
103   * Vmipstool.
104
105   * The debugger interface.
106
107   * Exceptions: exception prioritizing, non-boot-time exception
108     vectors, all the TLB exceptions, Unimplemented Coprocessor
109     exceptions, Reserved Instruction exceptions, and exceptions due to
110     PC address translation.
111
112   * Check that the TLB does the right thing when you have a dirty entry
113     vs. a non-dirty one.
114
115   * dumpcpu, dumpcp0, haltdumpcp0, bootmsg options.
116
117   * tilde_expand() where it's not your own home directory.
118
119   * Address translations in KSEG0 or KSEG2 or KUSEG or User mode.
120
121