hvm/hpet: Add manual unit test code.
authorDon Slutz <dslutz@verizon.com>
Fri, 2 May 2014 20:17:59 +0000 (16:17 -0400)
committerTim Deegan <tim@xen.org>
Thu, 8 May 2014 11:03:53 +0000 (12:03 +0100)
commit864fec3f363c79c76575502f9fb588826e7c6b3b
treebef8c5a6c85dd875ac105456175adc13b2367d7c
parent8a158bc59cfb4c51a355cefb0a6b565b83ad5028
hvm/hpet: Add manual unit test code.

Add the code at tools/tests/vhpet.

See comment in tools/tests/vhpet/main.c for details on running
either in a xen source tree or elsewhere.

A basic in source tree usage is:

make -C tools/tests/vhpet run

Does repro the bug:

..MP-BIOS bug: 8254 timer not connected to IO-APIC

The make file includes coping hpet.c and hpet.h from the source
tree.  hpet.c is then modifed to remove all include file and add the
emul.h include file.

The manual test code has only a few automatic checks that output
messages to stderr:

1) Possible ..MP-BIOS bug: 8254 timer...
   if 1st period is not <= the expected value

2) hpet_set_mode(%ld): T%d Error: Set ...
   if read of comparator != write of comparator in

3) hpet_check_stopped(%ld): T%d Error: Set ...
   if read != write

4) main(%ld): With clock stopped mc64 changed: ...
   if hpet_save returns different master clock values when called
   more then once.

It also generates a lot of output, which is why the sugested way to
use includes a redirect of stdout to a file.

Signed-off-by: Don Slutz <dslutz@verizon.com>
Acked-by: Tim Deegan <tim@xen.org>
tools/tests/vhpet/.gitignore [new file with mode: 0644]
tools/tests/vhpet/Makefile [new file with mode: 0644]
tools/tests/vhpet/emul.h [new file with mode: 0644]
tools/tests/vhpet/main.c [new file with mode: 0644]