Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lest 2 - learn from stf by Joel Falcou #30

Open
9 tasks
martinmoene opened this issue Jan 14, 2016 · 5 comments
Open
9 tasks

lest 2 - learn from stf by Joel Falcou #30

martinmoene opened this issue Jan 14, 2016 · 5 comments
Milestone

Comments

@martinmoene
Copy link
Owner

martinmoene commented Jan 14, 2016

Study stf by @jfalcou and let lest benefit from it.

Ideas:

  • Use auto test case registration only.
  • Use default suite, but still allow for user to specify one, e.g. for testing lest itself.
  • Add ULP comparison
  • Add PASS/FAIL/TYPE_IS/EXPR_IS/EXPR_TYPE
  • Add typed tests (see what can be done w/o Boost).
  • Fail empty test cases
  • Simplify reporting mechanism
  • Use C++ Detection Idiom (N4436), see below
  • ...

Not supporting VC12 (VS2013), the detection mechanism can be simplified to:

#include <type_traits>

// Use pre-C++17 workaround for void_t:
// using std::void_t;   // template< typename... > using void_t = void;
template<typename... Ts> struct make_void { typedef void type;};
template<typename... Ts> using void_t = typename make_void<Ts...>::type;

template< typename, typename = void_t<> >
struct has_begin : std::false_type{};

template< typename T >
struct has_begin<T, void_t<decltype(std::declval<T>().begin())>> : std::true_type{};

template <typename, typename = void_t<> >
struct has_end : std::false_type{};

template <typename T>
struct has_end<T, void_t<decltype(std::declval<T>().end())>> : std::true_type{};

template <typename T>
using is_sequence = std::integral_constant<bool, has_end<T>::value && has_begin<T>::value>;
@martinmoene martinmoene added this to the 2.0 milestone Jan 26, 2016
@jfalcou
Copy link

jfalcou commented Apr 30, 2018

would you be interested by some PR for those ?

@martinmoene
Copy link
Owner Author

A kind offer, in which I'm certainly interested (although I might not be entirely ready for it).

I Just created branch lest-v2 for it.

@jfalcou
Copy link

jfalcou commented May 1, 2018

Good. What is the minimal language version 11 or 14 ?
C++14 makes a lot of things easier with polymorphic lambda and auto without trailing decltype.

@martinmoene
Copy link
Owner Author

I like to keep it at C++11.

@jfalcou
Copy link

jfalcou commented May 2, 2018

OK. I've forked the repo & will do some testing soon on how to adapt my old code to LEST.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants