Received: from eggs.gnu.org ([2001:4830:134:3::10]:38176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byf5E-0007hu-9z for qemu-devel@nongnu.org; Mon, 24 Oct 2016 09:14:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1byf59-0004LS-8Z for qemu-devel@nongnu.org; Mon, 24 Oct 2016 09:14:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38030) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1byf59-0004LH-3B for qemu-devel@nongnu.org; Mon, 24 Oct 2016 09:14:27 -0400 Date: Mon, 24 Oct 2016 11:14:24 -0200 From: Eduardo Habkost Message-ID: <20161024131424.GQ5057@thinpad.lan.raisama.net> References: <1477078873-24143-1-git-send-email-ehabkost@redhat.com> <20161024133616.624547f1@nial.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161024133616.624547f1@nial.brq.redhat.com> 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: Igor Mammedov Cc: qemu-devel@nongnu.org, Paolo Bonzini , Richard Henderson 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). > > > + > > 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", > -- Eduardo