2

I'm running a big unit test based on QTest and during the test process, it's stopping with error:

QSYSTEM: ClassXyzTest::xyzTest() Maximum amount of warnings exceeded. Use -maxwarnings to override.

I've got some debugs in the code to have more information about operation progress etc., but I don't see warnings during compilation.

I tried set in Project -> Command line arguments argument -maxwarnings 0 without success. 0 value should be unlimited - More details

kluszon
  • 375
  • 5
  • 19
  • 1
    Try to compile Qt example from: Welcome -> Examples -> Chapter 1: Writing a Unit Test. It should work when you set: Projects -> Run Settings -> Command line arguments to "-maxwarnings 0" – ololuki Jan 29 '22 at 20:17

1 Answers1

1

If you are using QTest::qExec function to run your test, make sure that you are passing arguments from your test app's main function to the QTest::qExec.

int main(argc, char **argv)
{
    MyTestObject test1;
    QTest::qExec(&test1, argc, argv);
}
ololuki
  • 377
  • 1
  • 7
  • 14