Commit Graph

81 Commits

Author SHA1 Message Date
Markus Armbruster 0e8a8c8f6d qtest: Add hard disk geometry test
So far covers only IDE and tests only CMOS contents.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-07-17 16:48:30 +02:00
Anthony Liguori 23797df3d9 Merge remote-tracking branch 'mjt/mjt-iov2' into staging
* mjt/mjt-iov2:
  rewrite iov_send_recv() and move it to iov.c
  cleanup qemu_co_sendv(), qemu_co_recvv() and friends
  export iov_send_recv() and use it in iov_send() and iov_recv()
  rename qemu_sendv to iov_send, change proto and move declarations to iov.h
  change qemu_iovec_to_buf() to match other to,from_buf functions
  consolidate qemu_iovec_copy() and qemu_iovec_concat() and make them consistent
  allow qemu_iovec_from_buffer() to specify offset from which to start copying
  consolidate qemu_iovec_memset{,_skip}() into single function and use existing iov_memset()
  rewrite iov_* functions
  change iov_* function prototypes to be more appropriate
  virtio-serial-bus: use correct lengths in control_out() message

Conflicts:
	tests/Makefile

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-07-09 12:35:06 -05:00
Michael Roth 2d49610539 qapi: Unit tests for visitor-based serialization
Currently we test our visitors individually, and seperately for input
vs. output. This is useful for validating internal representations
against the native C types and vice-versa, and other visitor-specific
testing, but it doesn't cover the potential use-case of using visitor
pairs for serialization/deserialization very well, and makes it
hard to easily extend the coverage for different C types / boundary
conditions.

To cover that we add a set of unit tests that takes a number of native C
values, passes them into an output visitor, extracts the values with an
input visitor, then compares the result to the original.

Plugging in new visitors to the test harness only requires a user to
implement the SerializeOps interface and add it to a list.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-06-08 16:11:14 +02:00
Michael Tokarev 2278a69e70 rewrite iov_* functions
This changes implementations of all iov_*
functions, completing the previous step.

All iov_* functions now ensure that this offset
argument is within the iovec (using assertion),
but lets to specify `bytes' value larger than
actual length of the iovec - in this case they
stops at the actual end of iovec.  It is also
suggested to use convinient `-1' value as `bytes'
to mean just this -- "up to the end".

There's one very minor semantic change here: new
requiriment is that `offset' points to inside of
iovec.  This is checked just at the end of functions
(assert()), it does not actually need to be enforced,
but using any of these functions with offset pointing
past the end of iovec is wrong anyway.

Note: the new code in iov.c uses arithmetic with
void pointers.  I thought this is not supported
everywhere and is a GCC extension (indeed, the C
standard does not define void arithmetic).  However,
the original code already use void arith in
iov_from_buf() function:
  (memcpy(..., buf + buf_off,...)
which apparently works well so far (it is this
way in qemu 1.0).  So I left it this way and used
it in other places.

While at it, add a unit-test file test-iov.c,
to check various corner cases with iov_from_buf(),
iov_to_buf() and iov_memset().

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2012-06-07 21:09:46 +04:00
Paolo Bonzini 4115852bb0 build: do not sprinkle around GENERATED_HEADERS dependencies
Keeping GENERATED_HEADERS dependencies up-to-date everywhere is complex.
We can simply make the Makefile depend on them, and they will be built
before all other targets.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-06-07 07:17:26 +02:00
Stefan Weil fba0c40bb7 tests: Add rtc-test (fix test regression)
Commit 93e9eb6808 added fdc-test,
but accidentally removed rtc-test because check-qtest-i386-y was
not enhanced but set twice.

This patch adds rtc-test again (and sorts both tests alphabetically).

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-05-21 15:31:06 -05:00
Stefan Weil fd4567d9a6 tests: Fix linker failure for fdc-test
When QEMU was built with the simple trace backend, linking failed:

  LINK  tests/fdc-test
oslib-posix.o: In function `trace_qemu_memalign':
qemu/bin/debug/x86/./trace.h:31: undefined reference to `trace3'
oslib-posix.o: In function `trace_qemu_vmalloc':
qemu/bin/debug/x86/./trace.h:35: undefined reference to `trace2'
oslib-posix.o: In function `trace_qemu_vfree':
qemu/bin/debug/x86/./trace.h:39: undefined reference to `trace1'
collect2: error: ld returned 1 exit status
make: *** [tests/fdc-test] Fehler 1

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-05-19 15:53:28 +00:00
Kevin Wolf 6c806637fa tests/Makefile: Add missing $(EXESUF)
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-05-10 11:01:59 +02:00
Kevin Wolf 93e9eb6808 qtest: Add floppy test
Let's start with testing media change.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2012-05-10 10:32:12 +02:00
Blue Swirl f91837a7f1 qtest: add m48t59 tests for Sparc
Add simple m48t59 qtests, enable test only for Sparc32
and Sparc64. On PPC, the device is behind PCI bus.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-04-21 07:10:25 +00:00
Paolo Bonzini 2ad596079e tests: remove .SECONDARY special target
The special target should not be needed anymore, and caused (perhaps
due to a Make bug) a failure with "make -j2".  In any case, the
main makefile is a better place for such special targets rather
than an included makefile.

Reported-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-04-14 16:19:50 +00:00
Blue Swirl d2a16f74f2 qtest: fix out of tree build
Trace objects are also needed if tracing is enabled.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-03-30 17:39:33 +00:00
Anthony Liguori d1aaf543a7 qtest: add rtc-test test-case
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-30 08:14:12 -05:00
Anthony Liguori 49ee359077 qtest: add C version of test infrastructure
This also includes a qtest wrapper script to make it easier to launch qtest
tests directly.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-30 08:14:11 -05:00
Paolo Bonzini b93b63f574 test makefile overhaul
This introduces new test reporting infrastructure based on
gtester and gtester-report.

Also, all existing tests are moved to tests/, and tests/Makefile
is reorganized to factor out the commonalities in the rules.

Signed-off-by: Anthony Liguori <aliguori@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-30 08:14:11 -05:00
Paolo Bonzini e38ac9621c qapi: add strict mode to input visitor
While QMP in general is designed so that it is possible to ignore
unknown arguments, in the case of the QMP server it is better to
reject them to detect bad clients.  In fact, we're already doing
this at the top level in the argument checker.  To extend this to
complex structures, add a mode to the input visitor where it checks
for unvisited keys and raises an error if it finds one.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2012-03-27 09:15:13 -03:00
Michael Roth 2db5b068ac test: add test-qmp-commands to make check
All the deps are here but the test was never added to the list of tests
for make check

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-03-26 11:28:38 +01:00
Michael Roth 3ac805d922 test: remove qemu-ga reference
This was added by mistake a while back.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-03-26 11:28:37 +01:00
Kevin Wolf b8c6f29eb8 Add 'make check-block'
Runs the full qemu-iotests suite for various image formats.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-03-12 15:14:07 +01:00
Kevin Wolf 8959449bb9 make check: Add qemu-iotests subset
Run the 'quick' group from qemu-iotests during 'make check'.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-03-12 15:14:07 +01:00
Paolo Bonzini 2d7799f2cc qapi: add tests for string-based visitors
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-21 10:21:05 +01:00
Stefan Weil 3c941c613a tests: Silence gtester in Makefile
This prettifies make output a little by avoiding a very long line.
As gtester prints the checks when they are run, no information is lost.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-01-19 08:14:33 +00:00
Anthony Liguori ad65aa882c test: eliminate libcheck tests and have make check use gtester
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-12 10:34:11 -06:00
Anthony Liguori dbfe06c62c build: split unit test builds to a separate makefile fragment
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-12 10:05:37 -06:00
Anthony Liguori c09015dd04 tests: mv tests/* -> tests/tcg
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-12 10:03:28 -06:00
Chen Wei-Ren e7764a4658 tests/Makefile: Remove qruncom target
Remove qruncom target from the Makefile file.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Chen Wei-Ren <chenwj@iis.sinica.edu.tw>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-12-09 10:09:51 +00:00
Michael Walle d65f083146 lm32: opcode testsuite
This patch creates tests/lm32 directory and adds tests for every
LatticeMico32 opcode.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-03-07 13:42:37 +01:00
Paolo Bonzini f9728943ff do not pass bogus $(SRC_PATH) include paths to cc during configure
Non-existent -I paths are dropped silently by the compiler, but still
it is not polite to pass bogus options.  Configure-time tests do not
need any include files from the source path, so only include -I flags
at make time (when they're properly expanded).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-14 16:11:58 +00:00
Paolo Bonzini 2b2e59e6c9 rewrite i386 tests Makefile
1) compute path to i386 compiler from configure.  If it is found, run
the i386 tests.  I use macros so that this approach could be applied
for other arches as well.

2) provide an easily extensible way to add tests

Most tests fail, but at least "make test" does something meaningful.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-23 14:47:13 +00:00
Paolo Bonzini 48118b0205 fix test_path
path.c grew quite a few new dependencies (mostly via cutils.c),
include them.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-23 14:47:06 +00:00
Paolo Bonzini 9517a9e6a5 unbreak "make" from vpath-built tests directory
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-10-23 14:46:54 +00:00
Paolo Bonzini 076d247142 Use vpath directive
The vpath directive has two advantages over the VPATH variable:
1) it allows to skip searching of .o files; 2) the default semantics
are to append to the vpath, so there is no confusion between "VPATH=xyz"
and "VPATH+=xyz".

Since "vpath %.c %.h PATH" is not valid, I'm introducing a wrapper
macro to append one or more directories to the vpath.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-08 09:58:40 -06:00
Isaku Yamahata 5f65049560 consolidate user cpu_{in, out}[bwl] into ioport-user.c
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09 16:06:40 -05:00
malc e5fd43a926 Support out-of-the-tree building of tests
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5288 c046a42c-6fe2-441c-8c8c-71466251a162
2008-09-22 01:39:29 +00:00
bellard 6f7044faab update
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4602 c046a42c-6fe2-441c-8c8c-71466251a162
2008-05-28 12:35:42 +00:00
edgar_igl e1ffb0f18f Add a tests for user-mode mmap
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4006 c046a42c-6fe2-441c-8c8c-71466251a162
2008-03-01 22:23:17 +00:00
bellard a44c7c15ac compilation fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3939 c046a42c-6fe2-441c-8c8c-71466251a162
2008-01-31 15:19:24 +00:00
bellard 9b0b82037a removed obsolete test2 target
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3640 c046a42c-6fe2-441c-8c8c-71466251a162
2007-11-14 10:34:57 +00:00
bellard 7aaabde7d7 use -fno-strict-aliasing
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3598 c046a42c-6fe2-441c-8c8c-71466251a162
2007-11-11 17:26:21 +00:00
ths e7daa60575 Add CRIS configuration bits, by Edgar E. Iglesias.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3368 c046a42c-6fe2-441c-8c8c-71466251a162
2007-10-08 13:38:27 +00:00
balrog 18c9b56060 Implement iwMMXt instruction set for the PXA270 cpu.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2752 c046a42c-6fe2-441c-8c8c-71466251a162
2007-04-30 02:02:17 +00:00
bellard 2afbeee757 update path
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2395 c046a42c-6fe2-441c-8c8c-71466251a162
2007-02-05 20:51:14 +00:00
pbrook 57be54bb3e Fix "make test2".
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2339 c046a42c-6fe2-441c-8c8c-71466251a162
2007-01-20 16:52:55 +00:00
ths e4630047e1 Simple test for mips/mipsel, based on a test by Alexander Voropay.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2246 c046a42c-6fe2-441c-8c8c-71466251a162
2006-12-14 14:48:11 +00:00
bellard 3b42c9794c sse2 comment
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2017 c046a42c-6fe2-441c-8c8c-71466251a162
2006-06-25 18:02:38 +00:00
bellard 2d7a3b9d7b qruncom compile fixes (initial patch by Even Rouault)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1722 c046a42c-6fe2-441c-8c8c-71466251a162
2005-12-18 19:28:08 +00:00
bellard 56902eee82 more targets
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1702 c046a42c-6fe2-441c-8c8c-71466251a162
2005-12-06 21:44:55 +00:00
bellard cc4adeef98 added MIPS user in automatic tests
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1696 c046a42c-6fe2-441c-8c8c-71466251a162
2005-12-05 21:04:50 +00:00
bellard 11650e3638 clean target update
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1410 c046a42c-6fe2-441c-8c8c-71466251a162
2005-04-26 21:39:25 +00:00
bellard 776f2227f6 x86_64 test program
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1321 c046a42c-6fe2-441c-8c8c-71466251a162
2005-03-02 22:19:12 +00:00