public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/libnitrokey] rawhide: Enable Offline tests
@ 2026-08-03  7:30 Ali Erdinc Koroglu
  0 siblings, 0 replies; only message in thread
From: Ali Erdinc Koroglu @ 2026-08-03  7:30 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/libnitrokey
Branch : rawhide
Commit : 290f2b03ab783e8b6969477e7bbdc7c468b6a96e
Author : Ali Erdinc Koroglu <ali.koroglu@oss.qualcomm.com>
Date   : 2026-08-03T10:30:16+03:00
Stats  : +130/-51 in 3 file(s)
URL    : https://src.fedoraproject.org/rpms/libnitrokey/c/290f2b03ab783e8b6969477e7bbdc7c468b6a96e?branch=rawhide

Log:
Enable Offline tests

---
diff --git a/0001-meson-Bring-buildsystem-to-parity-with-CMake.patch b/0001-meson-Bring-buildsystem-to-parity-with-CMake.patch
deleted file mode 100644
index 841016f..0000000
--- a/0001-meson-Bring-buildsystem-to-parity-with-CMake.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From a616ac00c2cd0461d98d49b7a240ec4b73111c7d Mon Sep 17 00:00:00 2001
-From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
-Date: Thu, 19 Dec 2019 18:06:59 +0100
-Subject: [PATCH] meson: Bring buildsystem to parity with CMake
-
-Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
----
- meson.build | 17 ++++++++++-------
- 1 file changed, 10 insertions(+), 7 deletions(-)
-
-diff --git a/meson.build b/meson.build
-index 600be6d..dc34a97 100644
---- a/meson.build
-+++ b/meson.build
-@@ -1,6 +1,6 @@
- project(
-   'libnitrokey', 'cpp',
--  version : '3.4.1',
-+  version : '3.5.0',
-   license : 'LGPL-3.0+',
-   default_options : [
-     'cpp_std=c++14'
-@@ -150,12 +150,15 @@ if get_option('offline-tests')
- endif
- if get_option('tests')
-   tests += [
--    ['test_C_API',  'test_C_API.cpp'],
--    ['test1',       'test1.cc'],
--    ['test2',       'test2.cc'],
--    ['test3',       'test3.cc'],
--    ['test_HOTP',   'test_HOTP.cc'],
--    ['test_issues', 'test_issues.cc'],
-+    ['test_C_API',            'test_C_API.cpp'],
-+    ['test1',                 'test1.cc'],
-+    ['test2',                 'test2.cc'],
-+    ['test3',                 'test3.cc'],
-+    ['test_HOTP',             'test_HOTP.cc'],
-+    ['test_issues',           'test_issues.cc'],
-+    ['test_multiple_devices', 'test_multiple_devices.cc'],
-+    ['test_strdup',           'test_strdup.cpp'],
-+    ['test_safe',             'test_safe.cpp'],
-   ]
- endif
- foreach tst : tests
--- 
-2.24.1
-

diff --git a/catch2-test.patch b/catch2-test.patch
new file mode 100644
index 0000000..94096d5
--- /dev/null
+++ b/catch2-test.patch
@@ -0,0 +1,119 @@
+--- a/unittest/catch_main.cpp	2026-08-01 21:17:51.942683172 +0300
++++ b/unittest/catch_main.cpp	2026-08-01 21:18:08.598621517 +0300
+@@ -20,4 +20,4 @@
+  */
+ 
+ #define CATCH_CONFIG_MAIN  // This tells Catch to provide a main()
+-#include "catch2/catch.hpp"
+\ No newline at end of file
++#include <catch2/catch.hpp>
+--- a/unittest/test_strdup.cpp	2026-08-01 21:18:48.240388357 +0300
++++ b/unittest/test_strdup.cpp	2026-08-01 21:19:09.164297102 +0300
+@@ -26,7 +26,7 @@
+ #include <cstdio>
+ #include <memory.h>
+ #include "../NK_C_API.h"
+-#include "catch2/catch.hpp"
++#include <catch2/catch.hpp>
+ 
+ 
+ static const int SHORT_STRING_LENGTH = 10;
+--- a/unittest/test_issues.cc	2026-08-01 21:19:22.284210079 +0300
++++ b/unittest/test_issues.cc	2026-08-01 21:19:38.212772116 +0300
+@@ -26,7 +26,7 @@
+ const char * const RFC_SECRET = "12345678901234567890";
+ const char * const hidden_volume_pass = "123456789012345";
+ 
+-#include "catch2/catch.hpp"
++#include <catch2/catch.hpp>
+ 
+ #include <NitrokeyManager.h>
+ 
+--- a/unittest/test_C_API.cpp	2026-08-01 21:19:46.233084663 +0300
++++ b/unittest/test_C_API.cpp	2026-08-01 21:19:58.313325460 +0300
+@@ -21,7 +21,7 @@
+ 
+ static const int TOO_LONG_STRING = 200;
+ 
+-#include "catch2/catch.hpp"
++#include <catch2/catch.hpp>
+ 
+ #include <iostream>
+ #include <string>
+--- a/unittest/test_HOTP.cc	2026-08-01 21:20:08.905965930 +0300
++++ b/unittest/test_HOTP.cc	2026-08-01 21:20:20.799736597 +0300
+@@ -20,7 +20,7 @@
+  */
+ 
+ 
+-#include "catch2/catch.hpp"
++#include <catch2/catch.hpp>
+ #include <iostream>
+ #include "device_proto.h"
+ #include "log.h"
+--- a/unittest/test2.cc	2026-08-01 21:20:35.989824092 +0300
++++ b/unittest/test2.cc	2026-08-01 21:20:48.633339355 +0300
+@@ -23,7 +23,7 @@
+ static const char *const default_admin_pin = "12345678";
+ static const char *const default_user_pin = "123456";
+ 
+-#include "catch2/catch.hpp"
++#include <catch2/catch.hpp>
+ 
+ #include <iostream>
+ #include <string.h>
+--- a/unittest/test_multiple_devices.cc	2026-08-01 21:21:19.009598789 +0300
++++ b/unittest/test_multiple_devices.cc	2026-08-01 21:21:31.819157960 +0300
+@@ -24,7 +24,7 @@
+ const char * temporary_password = "123456789012345678901234";
+ const char * RFC_SECRET = "12345678901234567890";
+ 
+-#include "catch2/catch.hpp"
++#include <catch2/catch.hpp>
+ 
+ #include <iostream>
+ #include <NitrokeyManager.h>
+--- a/unittest/test_offline.cc	2026-08-01 21:21:40.319487190 +0300
++++ b/unittest/test_offline.cc	2026-08-01 21:21:51.957877928 +0300
+@@ -19,7 +19,7 @@
+  * SPDX-License-Identifier: LGPL-3.0
+  */
+ 
+-#include "catch2/catch.hpp"
++#include <catch2/catch.hpp>
+ #include <NitrokeyManager.h>
+ #include <memory>
+ #include <string>
+--- a/unittest/test1.cc	2026-08-01 21:21:59.318387703 +0300
++++ b/unittest/test1.cc	2026-08-01 21:22:09.906332259 +0300
+@@ -19,7 +19,7 @@
+  * SPDX-License-Identifier: LGPL-3.0
+  */
+ 
+-#include "catch2/catch.hpp"
++#include <catch2/catch.hpp>
+ 
+ #include <iostream>
+ #include <string.h>
+--- a/unittest/test_safe.cpp	2026-08-01 21:22:21.098273649 +0300
++++ b/unittest/test_safe.cpp	2026-08-01 21:22:36.794136971 +0300
+@@ -19,7 +19,7 @@
+  * SPDX-License-Identifier: LGPL-3.0
+  */
+ 
+-#include "catch2/catch.hpp"
++#include <catch2/catch.hpp>
+ 
+ #include <iostream>
+ #include <cstring>
+--- a/unittest/test3.cc	2026-08-01 21:22:44.477151219 +0300
++++ b/unittest/test3.cc	2026-08-01 21:22:53.902654653 +0300
+@@ -25,7 +25,7 @@
+ const char * temporary_password = "123456789012345678901234";
+ const char * RFC_SECRET = "12345678901234567890";
+ 
+-#include "catch2/catch.hpp"
++#include <catch2/catch.hpp>
+ 
+ #include <iostream>
+ #include <string.h>

diff --git a/libnitrokey.spec b/libnitrokey.spec
index 0b07c99..72b210c 100644
--- a/libnitrokey.spec
+++ b/libnitrokey.spec
@@ -1,16 +1,19 @@
 Name:           libnitrokey
 Version:        3.8
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Communicate with Nitrokey stick devices in a clean and easy manner
 
 License:        LGPL-3.0-or-later
 URL:            https://github.com/Nitrokey/libnitrokey
 Source0:        %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
 
+Patch0:		catch2-test.patch
+
 BuildRequires:  cmake
 BuildRequires:  gcc-c++
 BuildRequires:  pkgconfig(hidapi-libusb)
 BuildRequires:  pkgconfig(udev)
+BuildRequires:  pkgconfig(catch2) < 3
 
 %description
 Libnitrokey is a project to communicate with Nitrokey Pro and Storage devices
@@ -25,11 +28,12 @@ This package contains development libraries and header files are needed
 to develop using libnitrokey.
 
 %prep
-%autosetup
+%autosetup -p1
 
 %build
 %cmake \
-	-DCMAKE_POLICY_VERSION_MINIMUM="3.5.0"
+	-DCMAKE_POLICY_VERSION_MINIMUM="3.5.0" \
+	-DCOMPILE_OFFLINE_TESTS=ON
 %cmake_build
 
 %install
@@ -56,8 +60,11 @@ to develop using libnitrokey.
 %{_includedir}/libnitrokey/
 
 %changelog
+* Mon Aug 03 2026 Ali Erdinc Koroglu <aekoroglu@fedoraproject.org> - 3.8-2
+- Enable Offline tests
+
 * Sat Aug 01 2026 Ali Erdinc Koroglu <aekoroglu@fedoraproject.org> - 3.8-1
-- Update to 3.8 (rhbz#2504287)
+- Update to 3.7 (rhbz#2504287)
 
 * Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 3.7-11
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-03  7:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-03  7:30 [rpms/libnitrokey] rawhide: Enable Offline tests Ali Erdinc Koroglu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox