mirror of
https://github.com/NGSolve/netgen.git
synced 2025-02-11 12:53:08 +05:00
![Drew Parsons](/assets/img/avatar_default.png)
- uses Cmake config files for Catch2
- supports both v2 and v3 of Catch2
- Catch2 v3 includes <catch2/catch_all.hpp> instead of <catch2/catch.hpp>
- v3 moves Catch::Contains to Catch::Matchers::ContainsSubstring
see https://github.com/catchorg/Catch2/blob/devel/docs/migrate-v2-to-v3.md
Patch adapted from debian patch catch2_v3.patch
d7ca1c564d/debian/patches/catch2_v3.patch
24 lines
457 B
C++
24 lines
457 B
C++
|
|
#ifdef CATCH2_v3
|
|
#include "catch2/catch_all.hpp"
|
|
#else
|
|
#include <catch2/catch.hpp>
|
|
#endif
|
|
#include <../core/ngcore.hpp>
|
|
using namespace ngcore;
|
|
using namespace std;
|
|
|
|
|
|
TEST_CASE("Version")
|
|
{
|
|
VersionInfo v("v6.2.1811-3-asdf");
|
|
CHECK(v.to_string() == "v6.2.1811-3-asdf");
|
|
VersionInfo v2("6.2");
|
|
CHECK(v2.to_string() == "v6.2");
|
|
CHECK(v < "v7");
|
|
CHECK(v >= "6.2");
|
|
CHECK(v > "6.2.1811");
|
|
CHECK(v < "6.2.1811-5");
|
|
CHECK(v == "v6.2.1811-3");
|
|
}
|