Interest in a C++20 Unit Testing Framework?

classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|

Interest in a C++20 Unit Testing Framework?

Boost - Users mailing list
Hi,

I was wondering whether there is any interest in exploring a C++20 single header/single module, macro-free Unit Testing Framework with no dependencies?


Additional links:
- Try it online: https://godbolt.org/z/uVDxkW 

Thanks, Kris

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Interest in a C++20 Unit Testing Framework?

Boost - Users mailing list
On 11/21/2019 10:23 AM, Krzysztof Jusiak via Boost-users wrote:

> Hi,
>
> I was wondering whether there is any interest in exploring a C++20
> single header/single module, macro-free Unit Testing Framework with no
> dependencies?
>
> Github: https://github.com/boost-experimental/ut
>
> Additional links:
> - Try it online: https://godbolt.org/z/uVDxkW
> - Benchmarks: https://github.com/boost-experimental/ut#benchmarks
> - How it works?: https://github.com/boost-experimental/ut#how-it-works

Actual documentation, rather than a huge bunch of examples, is always
welcome for this programmer. Otherwise I have no idea what your code is
about or how to use it.

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Interest in a C++20 Unit Testing Framework?

Boost - Users mailing list
On 11/21/19 10:49 AM, Edward Diener via Boost-users wrote:

> On 11/21/2019 10:23 AM, Krzysztof Jusiak via Boost-users wrote:
>> Hi,
>>
>> I was wondering whether there is any interest in exploring a C++20
>> single header/single module, macro-free Unit Testing Framework with no
>> dependencies?
>>
>> Github: https://github.com/boost-experimental/ut
>>
>> Additional links:
>> - Try it online: https://godbolt.org/z/uVDxkW
>> - Benchmarks: https://github.com/boost-experimental/ut#benchmarks
>> - How it works?: https://github.com/boost-experimental/ut#how-it-works
>
> Actual documentation, rather than a huge bunch of examples, is always
> welcome for this programmer. Otherwise I have no idea what your code is
> about or how to use it.

Hmmm - what constitutes actual documentation in your mind as opposed to
a "huge bunch of examples".  Sounds like you consider the examples
unnecessary.

Robert Ramey
>
> _______________________________________________
> Boost-users mailing list
> [hidden email]
> https://lists.boost.org/mailman/listinfo.cgi/boost-users


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Interest in a C++20 Unit Testing Framework?

Boost - Users mailing list
On 11/21/2019 4:51 PM, Robert Ramey via Boost-users wrote:

> On 11/21/19 10:49 AM, Edward Diener via Boost-users wrote:
>> On 11/21/2019 10:23 AM, Krzysztof Jusiak via Boost-users wrote:
>>> Hi,
>>>
>>> I was wondering whether there is any interest in exploring a C++20
>>> single header/single module, macro-free Unit Testing Framework with
>>> no dependencies?
>>>
>>> Github: https://github.com/boost-experimental/ut
>>>
>>> Additional links:
>>> - Try it online: https://godbolt.org/z/uVDxkW
>>> - Benchmarks: https://github.com/boost-experimental/ut#benchmarks
>>> - How it works?: https://github.com/boost-experimental/ut#how-it-works
>>
>> Actual documentation, rather than a huge bunch of examples, is always
>> welcome for this programmer. Otherwise I have no idea what your code
>> is about or how to use it.
>
> Hmmm - what constitutes actual documentation in your mind as opposed to
> a "huge bunch of examples".  Sounds like you consider the examples
> unnecessary.

I did not find a single line of explanation in the docs of ut. Examples
are fine but if the entire documentation consists of examples I do not
think that is nearly enough to understand a library and what it is about.

I was hoping my comment would get the developer of ut to consider docs
that explain what his library is about, how to use it, and of what the
individual constructs of the library consists. But that is solely up to
the developer and if others find the docs adequate I wish them well in
using it.

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Interest in a C++20 Unit Testing Framework?

Boost - Users mailing list
In reply to this post by Boost - Users mailing list
It looks very interesting. The idea of not using macros is very appealing to me.

From looking at the examples, I get the feeling of "I could probably use this".

However, as the other commenters have mentioned, without a tutorial and full reference it's difficult to judge whether it's ready for use in production.

Are there plans to develop this?




On Thu, 21 Nov 2019 at 16:24, Krzysztof Jusiak via Boost-users <[hidden email]> wrote:
Hi,

I was wondering whether there is any interest in exploring a C++20 single header/single module, macro-free Unit Testing Framework with no dependencies?


Additional links:
- Try it online: https://godbolt.org/z/uVDxkW 

Thanks, Kris
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users


--
Richard Hodges
office: +442032898513
home: +376841522
mobile: +376380212


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Interest in a C++20 Unit Testing Framework?

Boost - Users mailing list
On Fri, Nov 22, 2019 at 9:18 AM Richard Hodges via Boost-users <[hidden email]> wrote:
It looks very interesting. The idea of not using macros is very appealing to me.

Indeed. What surprised me, given the announcement on the Boost ML, was the lack
of comparison to Boost's own Boost.Test library (and its other single-header lightweight one,
which AFAIK is not an official library, please correct me if I'm wrong). --DD

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Interest in a C++20 Unit Testing Framework?

Boost - Users mailing list
In reply to this post by Boost - Users mailing list

For anyone lucky enough to work on new bleeding-edge projects and compilers, this looks appealing, but I too was left in partial disambiguation mode after looking a more than the basic example.  Lots of example are good, but the explanation around them is too thin.

 

(It is also unsuitable for existing Boost projects that have been supporting C++03 compilers, and up, for decades, and I don’t see all the facilities available in combination with b2/bjam to cover all the myriad of platforms and compilers that are used to fill the extensive Boost test matrix).

 

Paul

 

From: Boost-users <[hidden email]> On Behalf Of Krzysztof Jusiak via Boost-users
Sent: 21 November 2019 15:24
To: [hidden email]; [hidden email]; [hidden email]
Cc: Krzysztof Jusiak <[hidden email]>
Subject: [Boost-users] Interest in a C++20 Unit Testing Framework?

 

Hi,

 

I was wondering whether there is any interest in exploring a C++20 single header/single module, macro-free Unit Testing Framework with no dependencies?

 

 

Additional links:

- Try it online: https://godbolt.org/z/uVDxkW 

 

Thanks, Kris


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Interest in a C++20 Unit Testing Framework?

Boost - Users mailing list
In reply to this post by Boost - Users mailing list

I noted, and was pleased, to see the lack of such a comparison – I fear it would be embarrassing 😉

 

But it is proving very difficult to replicate the whole testing structure catering with all the variants of compilers, platforms, chipsets …

So I don’t think we should even consider this as a replacement for current libraries.

 

Paul

 

 

From: Boost-users <[hidden email]> On Behalf Of Dominique Devienne via Boost-users
Sent: 22 November 2019 09:41
To: boost-users <[hidden email]>
Cc: Dominique Devienne <[hidden email]>
Subject: Re: [Boost-users] Interest in a C++20 Unit Testing Framework?

 

On Fri, Nov 22, 2019 at 9:18 AM Richard Hodges via Boost-users <[hidden email]> wrote:

It looks very interesting. The idea of not using macros is very appealing to me.

 

Indeed. What surprised me, given the announcement on the Boost ML, was the lack

of comparison to Boost's own Boost.Test library (and its other single-header lightweight one,

which AFAIK is not an official library, please correct me if I'm wrong). --DD


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: [boost] Interest in a C++20 Unit Testing Framework?

Boost - Users mailing list
In reply to this post by Boost - Users mailing list
(CC'ed to boost-users)

On Fri, 22 Nov 2019 at 21:53, Vinnie Falco via Boost
<[hidden email]> wrote:

> On Thu, Nov 21, 2019 at 7:24 AM Krzysztof Jusiak via Boost-users <[hidden email]>>
> > I was wondering whether there is any interest in exploring
> > a C++20 single header/single module, macro-free Unit
> > Testing Framework with no dependencies?
>
> I have no interest in a library that requires C++20, especially
> considering that C++20 is not even official yet but also because once
> C++20 is released, there will be hardly any users for many years. This
> project seems very much like it was written "just because", to use the
> latest language features, rather than for pragmatic reasons. I don't
> see anything compelling to use it over Boost.LightweightTest for
> example.

I had a look at the current documentation and examples,
and I'm glad to see I'm not the only sceptical about it.
My opinion is very similar to what Hans, Raffi and Vinnie explained.

Macros in testing and benchmarking frameworks are kosher,
in fact, they can be very helpul to organize and structure large
amount of tests that in turn makes it easier to search and browse
through the code. I can't imagine how any of the modern IDE's will
support the string-driven syntax.

As a long time maintainer of SOCI library, I'm no stranger to
the syntax-first library development [1], still, I find the UT's
string-based test cases approach as an interesting curiosity
with very little practical value. (It falls into similar drawer
as the (over)use of emoji in commit messages on GitHub :)).

Boost is known as a C++ guinea pigs playground, so any library can
make it in. If it does, I just hope Boost will not allow to adopt the UT
as a test framework of choice of any/too many of its libraries.

[1] https://www.drdobbs.com/database/a-simple-oracle-call-interface/184405930?pgno=2

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: [boost] Interest in a C++20 Unit Testing Framework?

Boost - Users mailing list
In reply to this post by Boost - Users mailing list
<quote author='Boost - Users mailing list'>
(CC'ed to boost-users)

On Fri, 22 Nov 2019 at 21:53, Vinnie Falco via Boost
<[hidden email]> wrote:

> On Thu, Nov 21, 2019 at 7:24 AM Krzysztof Jusiak via Boost-users
> <[hidden email]>>
> > I was wondering whether there is any interest in exploring
> > a C++20 single header/single module, macro-free Unit
> > Testing Framework with no dependencies?
>
> I have no interest in a library that requires C++20, especially
> considering that C++20 is not even official yet but also because once
> C++20 is released, there will be hardly any users for many years. This
> project seems very much like it was written "just because", to use the
> latest language features, rather than for pragmatic reasons. I don't
> see anything compelling to use it over Boost.LightweightTest for
> example.

I had a look at the current documentation and examples,
and I'm glad to see I'm not the only sceptical about it.
My opinion is very similar to what Hans, Raffi and Vinnie explained.

Macros in testing and benchmarking frameworks are kosher,
in fact, they can be very helpul to organize and structure large
amount of tests that in turn makes it easier to search and browse
through the code. I can't imagine how any of the modern IDE's will
support the string-driven syntax.

As a long time maintainer of SOCI library, I'm no stranger to
the syntax-first library development [1], still, I find the UT's
string-based test cases approach as an interesting curiosity
with very little practical value. (It falls into similar drawer
as the (over)use of emoji in commit messages on GitHub :)).

Boost is known as a C++ guinea pigs playground, so any library can
make it in. If it does, I just hope Boost will not allow to adopt the UT
as a test framework of choice of any/too many of its libraries.

[1]
https://www.drdobbs.com/database/a-simple-oracle-call-interface/184405930?pgno=2

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users

</quote>
Quoted from:
http://boost.2283326.n4.nabble.com/Interest-in-a-C-20-Unit-Testing-Framework-tp4710376p4710397.html


_____________________________________
Sent from http://boost.2283326.n4.nabble.com

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: [boost] Interest in a C++20 Unit Testing Framework?

Boost - Users mailing list
In reply to this post by Boost - Users mailing list
Thank you for your feedback. I appreciate it.

Well, IMHO, there are pros and cons to any solution; I'm not going to start a flame war here about whether macros are evil or not.
However, with [Boost].UT there is nothing stopping anyone from using simple macros (one-lines) to achieve other frameworks syntax
The good bit about it is that it's an opt-in 'feature' as opposed to being the only available option (see example below [1]).
This way more users can be satisfied and other benefits such as faster execution, quicker compilation times and other features are still available.

```
#define EXPECT(...) ::boost::ut::expect(::boost::ut::that % __VA_ARGS__)
#define SUITE       ::boost::ut::suite _ = []
#define TEST(name)  ::boost::ut::detail::test{"test", name} = [=]() mutable

SUITE {
  TEST("suite") {
    EXPECT(42 == 42);
  };
};

int main() {
  TEST("macro") {
    EXPECT(1 != 2);
  };

  TEST("vector") {
    std::vector<int> v(5);

    EXPECT(5u == std::size(v)) << "fatal";

    TEST("resize bigger") {
      v.resize(10);
      EXPECT(10u == std::size(v));
    };
  };
}
```


On Fri, Nov 22, 2019 at 2:27 PM Mateusz Loskot via Boost-users <[hidden email]> wrote:
(CC'ed to boost-users)

On Fri, 22 Nov 2019 at 21:53, Vinnie Falco via Boost
<[hidden email]> wrote:
> On Thu, Nov 21, 2019 at 7:24 AM Krzysztof Jusiak via Boost-users <[hidden email]>>
> > I was wondering whether there is any interest in exploring
> > a C++20 single header/single module, macro-free Unit
> > Testing Framework with no dependencies?
>
> I have no interest in a library that requires C++20, especially
> considering that C++20 is not even official yet but also because once
> C++20 is released, there will be hardly any users for many years. This
> project seems very much like it was written "just because", to use the
> latest language features, rather than for pragmatic reasons. I don't
> see anything compelling to use it over Boost.LightweightTest for
> example.

I had a look at the current documentation and examples,
and I'm glad to see I'm not the only sceptical about it.
My opinion is very similar to what Hans, Raffi and Vinnie explained.

Macros in testing and benchmarking frameworks are kosher,
in fact, they can be very helpul to organize and structure large
amount of tests that in turn makes it easier to search and browse
through the code. I can't imagine how any of the modern IDE's will
support the string-driven syntax.

As a long time maintainer of SOCI library, I'm no stranger to
the syntax-first library development [1], still, I find the UT's
string-based test cases approach as an interesting curiosity
with very little practical value. (It falls into similar drawer
as the (over)use of emoji in commit messages on GitHub :)).

Boost is known as a C++ guinea pigs playground, so any library can
make it in. If it does, I just hope Boost will not allow to adopt the UT
as a test framework of choice of any/too many of its libraries.

[1] https://www.drdobbs.com/database/a-simple-oracle-call-interface/184405930?pgno=2

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: [boost] Interest in a C++20 Unit Testing Framework?

Boost - Users mailing list
On Sun, Nov 24, 2019 at 9:49 AM Hans Dembinski via Boost
<[hidden email]> wrote:
> both will have difficulty in understanding the code of other.

    BOOST_TEST(b)

What could this possibly mean?

/me scratches head

Regards
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Interest in a C++20 Unit Testing Framework?

Boost - Users mailing list
In reply to this post by Boost - Users mailing list
On Thu, Nov 21, 2019 at 7:24 AM Krzysztof Jusiak via Boost-users
<[hidden email]> wrote:
> I was wondering whether there is any interest in exploring
> a C++20 single header/single module, macro-free Unit Testing
> Framework with no dependencies?

Apologies if my previous comments were discouraging. There is benefit
to "exploring" this library, in that it is useful to see what a
re-imagining of a unit test interface could look like if it used C++20
constructs instead of macros. Using a user defined string literal to
name the test case is innovative as are some of the other features. My
comments are narrowly focused only on the practical use of the library
in a general sense.

Regards
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Interest in a C++20 Unit Testing Framework?

Boost - Users mailing list
In reply to this post by Boost - Users mailing list
Thanks for your valuable feedback.

I added initial versions of tutorial and user-guide to README. It's not ideal yet but it's a start.

I also updated benchmarks with Boost.Test-1.71.0 (static library).
I didn't add Boost.LightweightTest though as it's just assertions (no tests/suites/etc...) so it makes it difficult to compare due to missing features.

I hope that helps a bit.

Thanks again, Kris

On Fri, Nov 22, 2019 at 1:17 AM Richard Hodges via Boost-users <[hidden email]> wrote:
It looks very interesting. The idea of not using macros is very appealing to me.

From looking at the examples, I get the feeling of "I could probably use this".

However, as the other commenters have mentioned, without a tutorial and full reference it's difficult to judge whether it's ready for use in production.

Are there plans to develop this?




On Thu, 21 Nov 2019 at 16:24, Krzysztof Jusiak via Boost-users <[hidden email]> wrote:
Hi,

I was wondering whether there is any interest in exploring a C++20 single header/single module, macro-free Unit Testing Framework with no dependencies?


Additional links:
- Try it online: https://godbolt.org/z/uVDxkW 

Thanks, Kris
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users


--
Richard Hodges
office: +442032898513
home: +376841522
mobile: +376380212

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Interest in a C++20 Unit Testing Framework?

Boost - Users mailing list
(FYI, https://www.boost.org/community/policy.html says: Don't
Overquote, Don't Top-Post,...)

On Mon, 25 Nov 2019 at 19:10, Krzysztof Jusiak via Boost-users
<[hidden email]> wrote:
>
> I also updated benchmarks with Boost.Test-1.71.0 (static library).
> I didn't add Boost.LightweightTest though as it's just assertions (no tests/suites/etc...) so it makes it difficult to compare due to missing features.
> * https://github.com/boost-experimental/ut#benchmarks

Boost.LT does not offer formal vocabulary for cases and suites,
but saying it's "just assertions" is not quite accurate, I think.

According to some of TDD advocates, there shall be single assertion
per unit test [1]
(test case is an individual unit of testing, a unit test):

int sqr(int x) { return x * x; }
int main()
{
    BOOST_TEST( sqr(2) == 4 ); // test case 1
    BOOST_TEST_EQ( sqr(-3), 9 ); // test case 2
    return boost::report_errors();
}

For those who multiple assertions:

void test_sqr(int input, int expect)
{
    BOOST_TEST( sqr(input) == expect);
    BOOST_TEST( sqr(-input) == expect);
}
int main()
{
    test_sqrt(2, 4); // test case 1
    test_sqrt(-3, 9); // test case 1
    return boost::report_errors();
}

Finally, the single runnable test program is a test suite.

So, I will argue that Boost.LT does support test cases and test suites.

[1] https://osherove.com/blog/2006/10/3/avoid-multiple-asserts-in-a-single-unit-test-revisited.html

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Interest in a C++20 Unit Testing Framework?

Boost - Users mailing list
In reply to this post by Boost - Users mailing list
On 25.11.19 19:10, Krzysztof Jusiak via Boost-users wrote:

> Thanks for your valuable feedback.
>
> I added initial versions of tutorial and user-guide to README. It's not
> ideal yet but it's a start.
> * https://github.com/boost-experimental/ut#tutorial 
> * https://github.com/boost-experimental/ut#user-guide
>
> I also updated benchmarks with Boost.Test-1.71.0 (static library).
> I didn't add Boost.LightweightTest though as it's just assertions (no
> tests/suites/etc...) so it makes it difficult to compare due to missing
> features.
> * https://github.com/boost-experimental/ut#benchmarks 
>

Thanks, very interesting!

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Interest in a C++20 Unit Testing Framework?

Boost - Users mailing list
In reply to this post by Boost - Users mailing list

Ok – with more docs it now looks convincing. I’ll try it on my next standalone project.

 

It won’t replace Boost.Test – we have much too much invested in it (and we support much older compilers), but that’s no reason why it couldn’t be a Boost library.  To get through a Boost review, you need some enthusiastic users.

 

Paul

 

Paul A. Bristow

Prizet Farmhouse

Kendal, Cumbria

LA8 8AB           UK

 

From: Boost-users <[hidden email]> On Behalf Of Krzysztof Jusiak via Boost-users
Sent: 25 November 2019 18:10
To: [hidden email]; [hidden email] List <[hidden email]>
Cc: Krzysztof Jusiak <[hidden email]>
Subject: Re: [Boost-users] Interest in a C++20 Unit Testing Framework?

 

Thanks for your valuable feedback.

 

I added initial versions of tutorial and user-guide to README. It's not ideal yet but it's a start.

 

I also updated benchmarks with Boost.Test-1.71.0 (static library).

I didn't add Boost.LightweightTest though as it's just assertions (no tests/suites/etc...) so it makes it difficult to compare due to missing features.

 

I hope that helps a bit.

 

Thanks again, Kris

 

On Fri, Nov 22, 2019 at 1:17 AM Richard Hodges via Boost-users <[hidden email]> wrote:

It looks very interesting. The idea of not using macros is very appealing to me.

 

From looking at the examples, I get the feeling of "I could probably use this".

 

However, as the other commenters have mentioned, without a tutorial and full reference it's difficult to judge whether it's ready for use in production.

 

Are there plans to develop this?

 

 

 

 

On Thu, 21 Nov 2019 at 16:24, Krzysztof Jusiak via Boost-users <[hidden email]> wrote:

Hi,

 

I was wondering whether there is any interest in exploring a C++20 single header/single module, macro-free Unit Testing Framework with no dependencies?

 

 

Additional links:

- Try it online: https://godbolt.org/z/uVDxkW 

 

Thanks, Kris

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users


 

--

Richard Hodges

office: +442032898513

home: +376841522

mobile: +376380212

 

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: [boost] Interest in a C++20 Unit Testing Framework?

Boost - Users mailing list
In reply to this post by Boost - Users mailing list
Le 22/11/2019 à 22:28, Mateusz Loskot via Boost-users a écrit :
> Macros in testing and benchmarking frameworks are kosher,
> in fact, they can be very helpul to organize and structure large
> amount of tests that in turn makes it easier to search and browse
> through the code. I can't imagine how any of the modern IDE's will
> support the string-driven syntax.

Not sure to understand how macros help organizing code but well.

> As a long time maintainer of SOCI library, I'm no stranger to
> the syntax-first library development [1], still, I find the UT's
> string-based test cases approach as an interesting curiosity
> with very little practical value. (It falls into similar drawer
> as the (over)use of emoji in commit messages on GitHub :)).

Catch2 and some Javascript frameworks use strings based tests too. I
don't see any issues with that. Regarding emojis, this is clearly a
mainstream hype unfortunately [0] [1]

> I just hope Boost will not allow to adopt the UT
> as a test framework of choice of any/too many of its libraries.

I'd like to know what are the benefits of this kind of comments that are
very subjective. But it's not the first time I see this on this mailing
list. Refrain yourself next time, not liking a library is opinion based
but trying to demotivate people is irrelevant and not productive.

[0]: https://github.com/nlohmann/json/commits/develop
[1]: https://rocket.rs/v0.4/guide/getting-started

--
David

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: [boost] Interest in a C++20 Unit Testing Framework?

Boost - Users mailing list
On Tue, 26 Nov 2019 at 17:29, David Demelier via Boost-users
<[hidden email]> wrote:
>
> not liking a library is opinion based but trying to demotivate
> people is irrelevant and not productive.

Krzysztof, FYI, that judgement is not even remotely close to what
motivated my subjective, naturally (!), opinions about design and
style of your library. By no means my goal was to demotivate you.

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net

p.s. David, allow me to avoid political correctness.
_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Interest in a C++20 Unit Testing Framework?

Boost - Users mailing list
In reply to this post by Boost - Users mailing list
FYI, [Boost].UT (since v1.1.2) has relaxed the standard requirement to C++17 (although some limitations apply depending on the standard/compiler combination).

In general, source_location is available since C++20, however, the builtin functionality powering it (__builtin_FILE(), __builtin_LINE()) is available since GCC-9/Clang-9.

Therefore, now:
* [Boost].UT with Clang/GCC >= 9 and with either C++17 or C++20 works as expected (although with C++17 it uses compiler builtin designed for C++20 source_location)
* [Boost].UT with Clang/GCC < 9 and with either C++17 or C++20 still compiles/`works`, however, the file/line in assertion won't be propagated

Also, MSVC-2019 doesn't support source_location yet neither with /std:C++20 nor with /std:C++latest, hence, the file/line is also not propagated yet.


-Kris

On Fri, Nov 22, 2019 at 1:53 PM Vinnie Falco <[hidden email]> wrote:
On Thu, Nov 21, 2019 at 7:24 AM Krzysztof Jusiak via Boost-users
<[hidden email]> > I was wondering whether there is any
interest in exploring
> a C++20 single header/single module, macro-free Unit
> Testing Framework with no dependencies?

I have no interest in a library that requires C++20, especially
considering that C++20 is not even official yet but also because once
C++20 is released, there will be hardly any users for many years. This
project seems very much like it was written "just because", to use the
latest language features, rather than for pragmatic reasons. I don't
see anything compelling to use it over Boost.LightweightTest for
example.

Thanks

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users