Re: [Development] Supporting helper functions in auto tests by providing throwing Qt Test macros

2019-04-05 Thread Matthew Woehlke
On 05/04/2019 10.49, Matthew Woehlke wrote: > IMNSHO, I think Qt would do well to take a close and careful look at > Google Test, which IMO has a much better design, at least as far as how > test assertions are handled. > > In particular, I miss having a distinction between fatal and non-fatal > a

Re: [Development] Supporting helper functions in auto tests by providing throwing Qt Test macros

2019-04-05 Thread Matthew Woehlke
On 02/04/2019 11.14, Mitch Curtis wrote: > As described in https://bugreports.qt.io/browse/QTBUG-66320, > currently Qt users are on their own if they want to call helper > functions that can fail a test. The reason is documented: > > Note: This macro can only be used in a test function that is in

Re: [Development] Supporting helper functions in auto tests by providing throwing Qt Test macros

2019-04-05 Thread Giuseppe D'Angelo via Development
Il 05/04/19 10:29, Mitch Curtis ha scritto: To take the obvious one first: anyone using their own custom macros in helpers shouldn't be affected (that's me, currently). But which custom macros, exactly? If your macros expand to private APIs usage, we can break that anytime we want. Anyone

Re: [Development] Supporting helper functions in auto tests by providing throwing Qt Test macros

2019-04-05 Thread Mitch Curtis
> -Original Message- > From: Giuseppe D'Angelo > Sent: Friday, 5 April 2019 12:39 AM > To: Mitch Curtis ; development@qt-project.org > Subject: Re: [Development] Supporting helper functions in auto tests by > providing throwing Qt Test macros > > Il 03

Re: [Development] Supporting helper functions in auto tests by providing throwing Qt Test macros

2019-04-04 Thread Giuseppe D'Angelo via Development
Il 03/04/19 13:58, Mitch Curtis ha scritto: I have a question regarding this particular implementation, that is, why adding dedicated testing functions? Can't you "simply" change the currently existing QVERIFY/QCOMPARE to throw exceptions in case of failure, instead of returning from the current

Re: [Development] Supporting helper functions in auto tests by providing throwing Qt Test macros

2019-04-04 Thread Edward Welbourne
Mitch Curtis (4 April 2019 11:01) > The nice thing about the exception solution is that users can decide > whether they want to wrap all helper calls in QCHECK_EXCEPTION to get > complete stack traces for failures, or if they don't want to use it at > all, resulting in neater code but slightly more

Re: [Development] Supporting helper functions in auto tests by providing throwing Qt Test macros

2019-04-04 Thread Mitch Curtis
> -Original Message- > From: Edward Welbourne > Sent: Thursday, 4 April 2019 10:51 AM > To: Mitch Curtis > Cc: development@qt-project.org; Joerg Bornemann > > Subject: Re: [Development] Supporting helper functions in auto tests by > providing throwing Qt Test macr

Re: [Development] Supporting helper functions in auto tests by providing throwing Qt Test macros

2019-04-04 Thread Edward Welbourne
Edward Welbourne (Wednesday, 3 April 2019 5:07 PM) >> It's probably worth having a macro with which to wrap code, that'll >> catch any exception it raises, add the current location to what'll be >> output to log the failure and then rethrows. This would give us the >> extra file/line information t

Re: [Development] Supporting helper functions in auto tests by providing throwing Qt Test macros

2019-04-03 Thread Mitch Curtis
> -Original Message- > From: Edward Welbourne > Sent: Wednesday, 3 April 2019 5:07 PM > To: Mitch Curtis > Cc: development@qt-project.org; Joerg Bornemann > > Subject: Re: [Development] Supporting helper functions in auto tests by > providing throwing Qt Test ma

Re: [Development] Supporting helper functions in auto tests by providing throwing Qt Test macros

2019-04-03 Thread Giuseppe D'Angelo via Development
Il 03/04/19 17:06, Edward Welbourne ha scritto: There is a whole world of difference between "can only be used in" and "is not recommended for use outside". The note is incorrect: if you use these macros inside a helper function, they do cause the test system to know the test has failed. They m

Re: [Development] Supporting helper functions in auto tests by providing throwing Qt Test macros

2019-04-03 Thread Edward Welbourne
On 4/2/19 5:14 PM, Mitch Curtis wrote: > >> As described in https://bugreports.qt.io/browse/QTBUG-66320, > >> currently Qt users are on their own if they want to call helper > >> functions that can fail a test. The reason is documented: > >> > >> Note: This macro can only be used in a test fun

Re: [Development] Supporting helper functions in auto tests by providing throwing Qt Test macros

2019-04-03 Thread Mitch Curtis
> -Original Message- > From: Development On Behalf Of > Robin Burchell > Sent: Wednesday, 3 April 2019 12:53 PM > To: development@qt-project.org > Subject: Re: [Development] Supporting helper functions in auto tests by > providing throwing Qt Test macros > > O

Re: [Development] Supporting helper functions in auto tests by providing throwing Qt Test macros

2019-04-03 Thread Mitch Curtis
Resending to the list... > -Original Message- > From: Mitch Curtis > Sent: Wednesday, 3 April 2019 1:58 PM > To: 'Giuseppe D'Angelo' > Subject: RE: [Development] Supporting helper functions in auto tests by > providing throwing Qt Test macros > >

Re: [Development] Supporting helper functions in auto tests by providing throwing Qt Test macros

2019-04-03 Thread Robin Burchell
On Wed, Apr 3, 2019, at 1:24 PM, Giuseppe D'Angelo via Development wrote: > I may like the overall approach. However, this would imply that such > tests require exceptions / RTTI turned on inside QtTestLib / user code; > is it "OK" in the grand scheme of things? Note that testcase.prf already en

Re: [Development] Supporting helper functions in auto tests by providing throwing Qt Test macros

2019-04-03 Thread Giuseppe D'Angelo via Development
Hi, Il 02/04/19 17:14, Mitch Curtis ha scritto: Quoting the commit message here: WIP: Add _THROW variants to testlib macros This allows using Qt Test macros in helper functions, avoiding the need to write a lot of boilerplate code as seen with alternative approaches. I may lik

Re: [Development] Supporting helper functions in auto tests by providing throwing Qt Test macros

2019-04-03 Thread Robin Burchell
On Tue, Apr 2, 2019, at 5:17 PM, Mitch Curtis wrote: > Quoting the commit message here: > > WIP: Add _THROW variants to testlib macros > > This allows using Qt Test macros in helper functions, avoiding the need > to write a lot of boilerplate code as seen with alternative approaches.

Re: [Development] Supporting helper functions in auto tests by providing throwing Qt Test macros

2019-04-03 Thread Mitch Curtis
> -Original Message- > From: Edward Welbourne > Sent: Wednesday, 3 April 2019 12:07 PM > To: Joerg Bornemann ; Mitch Curtis > > Cc: development@qt-project.org > Subject: Re: [Development] Supporting helper functions in auto tests by > providing throwing Qt Test ma

Re: [Development] Supporting helper functions in auto tests by providing throwing Qt Test macros

2019-04-03 Thread Edward Welbourne
On 4/2/19 5:14 PM, Mitch Curtis wrote: >> As described in https://bugreports.qt.io/browse/QTBUG-66320, currently >> Qt users are on their own if they want to call helper functions that >> can fail a test. The reason is documented: >> >> Note: This macro can only be used in a test function that

Re: [Development] Supporting helper functions in auto tests by providing throwing Qt Test macros

2019-04-03 Thread Christian Kandeler
On Tue, 2 Apr 2019 15:14:38 + Mitch Curtis wrote: > As described in https://bugreports.qt.io/browse/QTBUG-66320, currently Qt > users are on their own if they want to call helper functions that can fail a > test. The reason is documented: > > Note: This macro can only be used in a test

Re: [Development] Supporting helper functions in auto tests by providing throwing Qt Test macros

2019-04-03 Thread Mitch Curtis
> -Original Message- > From: Joerg Bornemann > Sent: Wednesday, 3 April 2019 9:55 AM > To: Mitch Curtis ; development@qt-project.org > Subject: Re: [Development] Supporting helper functions in auto tests by > providing throwing Qt Test macros > > On 4/2/19 5:1

Re: [Development] Supporting helper functions in auto tests by providing throwing Qt Test macros

2019-04-03 Thread Joerg Bornemann
On 4/2/19 5:14 PM, Mitch Curtis wrote: > As described in https://bugreports.qt.io/browse/QTBUG-66320, currently Qt > users are on their own if they want to call helper functions that can fail a > test. The reason is documented: > > Note: This macro can only be used in a test function that

[Development] Supporting helper functions in auto tests by providing throwing Qt Test macros

2019-04-02 Thread Mitch Curtis
As described in https://bugreports.qt.io/browse/QTBUG-66320, currently Qt users are on their own if they want to call helper functions that can fail a test. The reason is documented: Note: This macro can only be used in a test function that is invoked by the test framework. A common workar