Received: from eggs.gnu.org ([208.118.235.92]:55028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StP17-0007LJ-Bm for qemu-devel@nongnu.org; Mon, 23 Jul 2012 16:14:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1StP16-0008JE-6Y for qemu-devel@nongnu.org; Mon, 23 Jul 2012 16:14:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62384) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StP15-0008J8-Tm for qemu-devel@nongnu.org; Mon, 23 Jul 2012 16:14:08 -0400 Date: Mon, 23 Jul 2012 17:14:46 -0300 From: Eduardo Habkost Message-ID: <20120723201446.GX13029@otherpad.lan.raisama.net> References: <1341951743-2285-7-git-send-email-ehabkost@redhat.com> <20120713185133.GD13029@otherpad.lan.raisama.net> <20120716174258.GA18479@otherpad.lan.raisama.net> <20120723185958.GT13029@otherpad.lan.raisama.net> <20120723192845.GV13029@otherpad.lan.raisama.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [QEMU RFC PATCH 6/7] i386: topology & APIC ID utility functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: Anthony Liguori , Igor Mammedov , seabios@seabios.org, qemu-devel@nongnu.org, Gleb Natapov On Mon, Jul 23, 2012 at 07:44:44PM +0000, Blue Swirl wrote: > On Mon, Jul 23, 2012 at 7:28 PM, Eduardo Habkost wrote: > > On Mon, Jul 23, 2012 at 07:11:11PM +0000, Blue Swirl wrote: > >> On Mon, Jul 23, 2012 at 6:59 PM, Eduardo Habkost wrote: > >> > On Mon, Jul 23, 2012 at 04:49:07PM +0000, Blue Swirl wrote: > >> >> On Mon, Jul 16, 2012 at 5:42 PM, Eduardo Habkost wrote: > >> >> > On Sat, Jul 14, 2012 at 09:14:30AM +0000, Blue Swirl wrote: > >> >> > [...] > >> >> >> >> > diff --git a/tests/Makefile b/tests/Makefile > >> >> >> >> > index b605e14..89bd890 100644 > >> >> >> >> > --- a/tests/Makefile > >> >> >> >> > +++ b/tests/Makefile > >> >> >> >> > @@ -15,6 +15,7 @@ check-unit-y += tests/test-string-output-visitor$(EXESUF) > >> >> >> >> > check-unit-y += tests/test-coroutine$(EXESUF) > >> >> >> >> > check-unit-y += tests/test-visitor-serialization$(EXESUF) > >> >> >> >> > check-unit-y += tests/test-iov$(EXESUF) > >> >> >> >> > +check-unit-y += tests/test-x86-cpuid$(EXESUF) > >> >> >> >> > >> >> >> >> This probably tries to build the cpuid test also for non-x86 targets > >> >> >> >> and break them all. > >> >> >> > > >> >> >> > I don't think there's any concept of "targets" for the check-unit tests. > >> >> >> > >> >> >> How about: > >> >> >> check-qtest-i386-y = tests/test-x86-cpuid$(EXESUF) > >> >> > > >> >> > test-x86-cpuid is not a qtest test case. > >> >> > >> >> Why not? I don't think it is a unit test either, judging from what the > >> >> other unit tests do. > >> > > >> > It is absolutely a unit test. I don't know why you don't think so. It > >> > simply checks the results of the APIC ID calculation functions. > >> > >> Yes, but the other 'unit tests' (the names used here are very > >> confusing, btw) check supporting functions like coroutines, not > >> hardware. Hardware tests (qtest) need to bind to an architecture, in > >> this case x86. > > > > test-x86-cpuid doesn't check hardware, either. It just checks the simple > > functions that calculate APIC IDs (to make sure the math is correct). > > Those functions aren't even used by any hardware emulation code until > > later in the patch series (when the CPU initialization code gets changed > > to use the new function). > > By that time the function is clearly x86 HW and the check is an x86 > hardware check. QEMU as whole consists of simple functions that > calculate something. It's useful onily for a specific architecture, yes, but it surely doesn't make libqtest necessary. That's the difference between the unit tests and qtest test cases: unit tests simply test small parts of the code (that may or may not be hardware-specific), and qtest tests hardware emulation after starting up a whole qemu process. It's a different kind of testing, with different sets of goals. I suppose you are not arguing that no function inside target-* would be ever allowed to have a unit test written for it. That would be a very silly constraint for people writing tests. -- Eduardo