Skip to content

Commit a152bb0

Browse files
committed
Use Catch2v3 for the unit test suite
This moves from the old header-only Catch2 version 2.x included in GUL14 to the newer 3.x family of the unit test framework. Accordingly, the header files that need to be included change. Signed-off-by: Lars Froehlich <lars.froehlich@desy.de>
1 parent 0243146 commit a152bb0

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed

tests/meson.build

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ test_src = files(
1111
test('all',
1212
executable(meson.project_name() + '_test',
1313
test_src,
14-
dependencies : libgit4cpp_dep,
14+
dependencies : [
15+
dependency('catch2'),
16+
libgit4cpp_dep,
17+
],
1518
),
1619
workdir : meson.current_build_dir(),
1720
timeout : 10,

tests/test_Error.cc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/**
2-
* \file test_Error.cc
3-
* \date Created on January 23, 2024
4-
* \brief Test suite for the git::Error exception class.
2+
* \file test_Error.cc
3+
* \authors Fini Jastrow, Lars Fröhlich
4+
* \date Created on January 23, 2024
5+
* \brief Test suite for the git::Error exception class.
56
*
6-
* \copyright Copyright 2024 Deutsches Elektronen-Synchrotron (DESY), Hamburg
7+
* \copyright Copyright 2024-2025 Deutsches Elektronen-Synchrotron (DESY), Hamburg
78
*
89
* This program is free software: you can redistribute it and/or modify
910
* it under the terms of the GNU Lesser General Public License as published
@@ -23,7 +24,7 @@
2324

2425
#include <string>
2526

26-
#include <gul14/catch.h>
27+
#include <catch2/catch_test_macros.hpp>
2728

2829
#include "libgit4cpp/Error.h"
2930

tests/test_Remote.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* \date Created on January 15, 2024
55
* \brief Test suite for the Remote class.
66
*
7-
* \copyright Copyright 2024 Deutsches Elektronen-Synchrotron (DESY), Hamburg
7+
* \copyright Copyright 2024-2025 Deutsches Elektronen-Synchrotron (DESY), Hamburg
88
*
99
* This program is free software: you can redistribute it and/or modify
1010
* it under the terms of the GNU Lesser General Public License as published
@@ -25,8 +25,8 @@
2525
#include <filesystem>
2626
#include <fstream>
2727

28+
#include <catch2/catch_test_macros.hpp>
2829
#include <git2.h>
29-
#include <gul14/catch.h>
3030
#include <gul14/gul.h>
3131

3232
#include "libgit4cpp/Error.h"

tests/test_Repository.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* \date Created on March 22, 2023
55
* \brief Test suite for the Repository class.
66
*
7-
* \copyright Copyright 2023-2024 Deutsches Elektronen-Synchrotron (DESY), Hamburg
7+
* \copyright Copyright 2023-2025 Deutsches Elektronen-Synchrotron (DESY), Hamburg
88
*
99
* This program is free software: you can redistribute it and/or modify
1010
* it under the terms of the GNU Lesser General Public License as published
@@ -26,8 +26,8 @@
2626
#include <fstream>
2727
#include <iostream>
2828

29+
#include <catch2/catch_test_macros.hpp>
2930
#include <git2.h>
30-
#include <gul14/catch.h>
3131
#include <gul14/gul.h>
3232

3333
#include "libgit4cpp/Error.h"

tests/test_main.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* \date Created on November 26, 2019
55
* \brief Test suite for libgit4cpp
66
*
7-
* \copyright Copyright 2019-2024 Deutsches Elektronen-Synchrotron (DESY), Hamburg
7+
* \copyright Copyright 2019-2025 Deutsches Elektronen-Synchrotron (DESY), Hamburg
88
*
99
* This program is free software: you can redistribute it and/or modify
1010
* it under the terms of the GNU Lesser General Public License as published
@@ -24,8 +24,7 @@
2424

2525
#include <filesystem>
2626

27-
#define CATCH_CONFIG_RUNNER
28-
#include <gul14/catch.h>
27+
#include <catch2/catch_session.hpp>
2928

3029
#include "test_main.h"
3130

0 commit comments

Comments
 (0)