From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:47368) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSXN6-00051Z-V4 for qemu-devel@nongnu.org; Mon, 21 Nov 2011 12:09:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RSXN5-0006B2-U3 for qemu-devel@nongnu.org; Mon, 21 Nov 2011 12:09:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42044) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSXN5-0006Ay-Im for qemu-devel@nongnu.org; Mon, 21 Nov 2011 12:09:31 -0500 From: Luiz Capitulino Date: Mon, 21 Nov 2011 15:09:01 -0200 Message-Id: <1321895345-27959-1-git-send-email-lcapitulino@redhat.com> Subject: [Qemu-devel] [PATCH 1.1 0/4]: Improve QMP visitor unit-tests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mdroth@linux.vnet.ibm.com This series introduces two new test programs: test-qmp-output-visitor and test-qmp-input-visitor. As their names suggest, they contain unit-tests to check QMP's Visitor implementation. They supersede the test-visitor program (which is dropped by this series). Besides adding new unit-tests, I've _tried_ to follow these principles: - The tests don't print test result data to be manually checked by humans. Instead, all results are checked with g_assert()s and printed results are only OK or FAILED - Each test-case checks a single functionality - A test-case is only allowed to use a QAPI functionality after it has been tested - setup and teardown functions are used as much as possible to avoid duplication An important to do item I plan to work next is to measure test coverage. PS: The first patch is a fix unrelated to the QAPI. Makefile | 11 +- configure | 5 +- qapi-schema-test.json | 6 + test-qmp-input-visitor.c | 270 +++++++++++++++++++++++++++++ test-qmp-output-visitor.c | 423 +++++++++++++++++++++++++++++++++++++++++++++ test-visitor.c | 338 ------------------------------------ 6 files changed, 710 insertions(+), 343 deletions(-)