From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43355) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byfPX-0007g9-UM for qemu-devel@nongnu.org; Mon, 24 Oct 2016 09:35:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1byfPT-0002Fk-PF for qemu-devel@nongnu.org; Mon, 24 Oct 2016 09:35:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57474) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1byfPT-0002FH-JC for qemu-devel@nongnu.org; Mon, 24 Oct 2016 09:35:27 -0400 Date: Mon, 24 Oct 2016 15:35:23 +0200 From: Igor Mammedov Message-ID: <20161024153523.41085107@nial.brq.redhat.com> In-Reply-To: <20161024131424.GQ5057@thinpad.lan.raisama.net> References: <1477078873-24143-1-git-send-email-ehabkost@redhat.com> <20161024133616.624547f1@nial.brq.redhat.com> <20161024131424.GQ5057@thinpad.lan.raisama.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] target-i386: Print warning when mixing [+-]foo and foo=(on|off) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: qemu-devel@nongnu.org, Paolo Bonzini , Richard Henderson On Mon, 24 Oct 2016 11:14:24 -0200 Eduardo Habkost wrote: > On Mon, Oct 24, 2016 at 01:36:16PM +0200, Igor Mammedov wrote: > [...] > > > +#ifdef CONFIG_HAS_GLIB_SUBPROCESS_TESTS > > > +static void test_plus_minus(void) > > > +{ > > > + g_test_trap_subprocess("/x86/cpuid/parsing-plus-minus/subprocess", 0, 0); > > > + g_test_trap_assert_passed(); > > > + g_test_trap_assert_stderr("*Ambiguous CPU model string. " > > > + "Don't mix both \"-mce\" and \"mce=on\"*"); > > > + g_test_trap_assert_stderr("*Ambiguous CPU model string. " > > > + "Don't mix both \"+cx8\" and \"cx8=off\"*"); > > > + g_test_trap_assert_stdout(""); > > > +} > > > +#endif > > Are there any reason to keep both subprocess and inprocess variants? > > Because g_test_trap_subprocess() needs it. It takes a test path > as argument and runs another test case in a subprocess. Tests > containing "subprocess" as a path component are skipped by > default (so test_plus_minus_subprocess() is only run in a > subprocess). Ah I see, you are using subprocess to trap warnings on stderr > > > > > + > > > int main(int argc, char **argv) > > > { > > > g_test_init(&argc, &argv, NULL); > > > > > > - qtest_add_func("x86/cpuid/parsing-plus-minus", test_plus_minus); > > > + g_test_add_func("/x86/cpuid/parsing-plus-minus/subprocess", > > > + test_plus_minus_subprocess); > > > +#ifdef CONFIG_HAS_GLIB_SUBPROCESS_TESTS > > > + g_test_add_func("/x86/cpuid/parsing-plus-minus", test_plus_minus); > > > +#endif > > > > > > /* Original level values for CPU models: */ > > > add_cpuid_test("x86/cpuid/phenom/level", > > >