summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules2
-rw-r--r--meson.build11
m---------unittest/Catch0
-rw-r--r--unittest/catch_main.cpp2
-rw-r--r--unittest/test1.cc2
-rw-r--r--unittest/test2.cc2
-rw-r--r--unittest/test3.cc2
-rw-r--r--unittest/test_C_API.cpp2
-rw-r--r--unittest/test_HOTP.cc2
-rw-r--r--unittest/test_issues.cc2
-rw-r--r--unittest/test_multiple_devices.cc2
-rw-r--r--unittest/test_offline.cc4
-rw-r--r--unittest/test_strdup.cpp2
13 files changed, 21 insertions, 14 deletions
diff --git a/.gitmodules b/.gitmodules
index 4608496..739be0a 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,6 +1,6 @@
[submodule "unittest/Catch"]
path = unittest/Catch
- url = https://github.com/philsquared/Catch.git
+ url = https://github.com/catchorg/Catch2.git
[submodule "hidapi"]
path = hidapi
url = https://github.com/Nitrokey/hidapi.git
diff --git a/meson.build b/meson.build
index b14fe0c..600be6d 100644
--- a/meson.build
+++ b/meson.build
@@ -5,7 +5,7 @@ project(
default_options : [
'cpp_std=c++14'
],
- meson_version : '>= 0.43.0',
+ meson_version : '>= 0.44.0',
)
cxx = meson.get_compiler('cpp')
host_system = host_machine.system()
@@ -53,6 +53,7 @@ version_cc_in = configure_file(
version_cc = vcs_tag(
input : version_cc_in,
output : 'version.cc',
+ fallback : 'v@0@'.format(meson.project_version()),
)
libnitrokey = library(
'nitrokey',
@@ -112,8 +113,14 @@ pkg.generate(
install : true,
)
+dep_udev = dependency('udev')
+install_data(
+ 'data/41-nitrokey.rules',
+ install_dir : '@0@/rules.d'.format(dep_udev.get_pkgconfig_variable('udevdir')),
+)
+
if get_option('tests') or get_option('offline-tests')
- dep_catch = dependency('catch', required : false)
+ dep_catch = dependency('catch2', version : '>=2.3.0', required : false)
if not dep_catch.found()
dep_catch = declare_dependency(
include_directories : include_directories('unittest/Catch/single_include')
diff --git a/unittest/Catch b/unittest/Catch
-Subproject 62dae592c330ab74cea30c897255ee9518639c3
+Subproject 15cf3caaceb21172ea42a24e595a2eb58c3ec96
diff --git a/unittest/catch_main.cpp b/unittest/catch_main.cpp
index 0ef4a4b..11a0a3a 100644
--- a/unittest/catch_main.cpp
+++ b/unittest/catch_main.cpp
@@ -20,4 +20,4 @@
*/
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main()
-#include "catch.hpp" \ No newline at end of file
+#include "catch2/catch.hpp" \ No newline at end of file
diff --git a/unittest/test1.cc b/unittest/test1.cc
index 51a2ef6..c8281c3 100644
--- a/unittest/test1.cc
+++ b/unittest/test1.cc
@@ -19,7 +19,7 @@
* SPDX-License-Identifier: LGPL-3.0
*/
-#include "catch.hpp"
+#include "catch2/catch.hpp"
#include <iostream>
#include <string.h>
diff --git a/unittest/test2.cc b/unittest/test2.cc
index a943683..604b3ba 100644
--- a/unittest/test2.cc
+++ b/unittest/test2.cc
@@ -23,7 +23,7 @@
static const char *const default_admin_pin = "12345678";
static const char *const default_user_pin = "123456";
-#include "catch.hpp"
+#include "catch2/catch.hpp"
#include <iostream>
#include <string.h>
diff --git a/unittest/test3.cc b/unittest/test3.cc
index 84f952c..bb8a376 100644
--- a/unittest/test3.cc
+++ b/unittest/test3.cc
@@ -25,7 +25,7 @@ static const char *const default_user_pin = "123456";
const char * temporary_password = "123456789012345678901234";
const char * RFC_SECRET = "12345678901234567890";
-#include "catch.hpp"
+#include "catch2/catch.hpp"
#include <iostream>
#include <string.h>
diff --git a/unittest/test_C_API.cpp b/unittest/test_C_API.cpp
index 1964738..27eb1c4 100644
--- a/unittest/test_C_API.cpp
+++ b/unittest/test_C_API.cpp
@@ -21,7 +21,7 @@
static const int TOO_LONG_STRING = 200;
-#include "catch.hpp"
+#include "catch2/catch.hpp"
#include <iostream>
#include <string>
diff --git a/unittest/test_HOTP.cc b/unittest/test_HOTP.cc
index b11cf25..0b0b222 100644
--- a/unittest/test_HOTP.cc
+++ b/unittest/test_HOTP.cc
@@ -20,7 +20,7 @@
*/
-#include "catch.hpp"
+#include "catch2/catch.hpp"
#include <iostream>
#include "device_proto.h"
#include "log.h"
diff --git a/unittest/test_issues.cc b/unittest/test_issues.cc
index d4fd72e..b588b00 100644
--- a/unittest/test_issues.cc
+++ b/unittest/test_issues.cc
@@ -26,7 +26,7 @@ const char * const temporary_password = "123456789012345678901234";
const char * const RFC_SECRET = "12345678901234567890";
const char * const hidden_volume_pass = "123456789012345";
-#include "catch.hpp"
+#include "catch2/catch.hpp"
#include <NitrokeyManager.h>
diff --git a/unittest/test_multiple_devices.cc b/unittest/test_multiple_devices.cc
index 81d18c9..cd78681 100644
--- a/unittest/test_multiple_devices.cc
+++ b/unittest/test_multiple_devices.cc
@@ -24,7 +24,7 @@ static const char *const default_user_pin = "123456";
const char * temporary_password = "123456789012345678901234";
const char * RFC_SECRET = "12345678901234567890";
-#include "catch.hpp"
+#include "catch2/catch.hpp"
#include <iostream>
#include <NitrokeyManager.h>
diff --git a/unittest/test_offline.cc b/unittest/test_offline.cc
index 92af78c..75bd316 100644
--- a/unittest/test_offline.cc
+++ b/unittest/test_offline.cc
@@ -19,7 +19,7 @@
* SPDX-License-Identifier: LGPL-3.0
*/
-#include "catch.hpp"
+#include "catch2/catch.hpp"
#include <NitrokeyManager.h>
#include <memory>
#include <string>
@@ -179,7 +179,7 @@ TEST_CASE("Test version getter", "[fast]") {
std::string s = library_version;
std::string version("v[0-9]+\\.[0-9]+(\\.[0-9]+)?");
std::string git_suffix("-[0-9]+-g[0-9a-z]+");
- std::regex pattern(version + "(" + git_suffix + "|)");
+ std::regex pattern(version + "(" + git_suffix + ")?");
REQUIRE(std::regex_match(s, pattern));
}
diff --git a/unittest/test_strdup.cpp b/unittest/test_strdup.cpp
index 6c2cfb3..4f77b7f 100644
--- a/unittest/test_strdup.cpp
+++ b/unittest/test_strdup.cpp
@@ -26,7 +26,7 @@
#include <cstdio>
#include <memory.h>
#include "../NK_C_API.h"
-#include "catch.hpp"
+#include "catch2/catch.hpp"
static const int SHORT_STRING_LENGTH = 10;