Go to the first, previous, next, last section, table of contents.

## Test suite

The test suite is kind of lame for most processors. Often it only checks to see if a couple of files can be assembled without the assembler reporting any errors. For more complete testing, write a test which either examines the assembler listing, or runs `objdump` and examines its output. For the latter, the TCL procedure `run_dump_test` may come in handy. It takes the base name of a file, and looks for ``file.d'`. This file should contain as its initial lines a set of variable settings in ``#'` comments, in the form:

            #varname: value

The varname may be `objdump`, `nm`, or `as`, in which case it specifies the options to be passed to the specified programs. Exactly one of `objdump` or `nm` must be specified, as that also specifies which program to run after the assembler has finished. If varname is `source`, it specifies the name of the source file; otherwise, ``file.s'` is used. If varname is `name`, it specifies the name of the test to be used in the `pass` or `fail` messages.

The non-commented parts of the file are interpreted as regular expressions, one per line. Blank lines in the `objdump` or `nm` output are skipped, as are blank lines in the `.d` file; the other lines are tested to see if the regular expression matches the program output. If it does not, the test fails.

Note that this means the tests must be modified if the `objdump` output style is changed.

Go to the first, previous, next, last section, table of contents.