[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] target-i386: Print warning when mixing [+-]f
From: |
Igor Mammedov |
Subject: |
Re: [Qemu-devel] [PATCH v2] target-i386: Print warning when mixing [+-]foo and foo=(on|off) |
Date: |
Mon, 24 Oct 2016 15:35:23 +0200 |
On Mon, 24 Oct 2016 11:14:24 -0200
Eduardo Habkost <address@hidden> 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",
> >
>