tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
mtxclient: enable tests
Lu Wang
3 months ago
e4abb3f9
bf105ba1
+90
-11
2 changed files
expand all
collapse all
unified
split
pkgs
by-name
mt
mtxclient
package.nix
remove-network-tests.patch
+13
-11
pkgs/by-name/mt/mtxclient/package.nix
···
12
openssl,
13
re2,
14
spdlog,
0
15
}:
16
17
-
stdenv.mkDerivation rec {
18
pname = "mtxclient";
19
version = "0.10.1";
20
21
src = fetchFromGitHub {
22
owner = "Nheko-Reborn";
23
repo = "mtxclient";
24
-
rev = "v${version}";
25
hash = "sha256-Y0FMCq4crSbm0tJtYq04ZFwWw+vlfxXKXBo0XUgf7hw=";
26
};
27
28
-
postPatch = ''
29
-
# See https://github.com/gabime/spdlog/issues/1897
30
-
sed -i '1a add_compile_definitions(SPDLOG_FMT_EXTERNAL)' CMakeLists.txt
31
-
'';
32
33
cmakeFlags = [
34
-
# Network requiring tests can't be disabled individually:
35
-
# https://github.com/Nheko-Reborn/mtxclient/issues/22
36
-
"-DBUILD_LIB_TESTS=OFF"
37
-
"-DBUILD_LIB_EXAMPLES=OFF"
38
];
39
40
nativeBuildInputs = [
···
53
spdlog
54
];
55
0
0
0
0
56
meta = with lib; {
57
description = "Client API library for the Matrix protocol";
58
homepage = "https://github.com/Nheko-Reborn/mtxclient";
···
64
];
65
platforms = platforms.all;
66
};
67
-
}
···
12
openssl,
13
re2,
14
spdlog,
15
+
gtest,
16
}:
17
18
+
stdenv.mkDerivation (finalAttrs: {
19
pname = "mtxclient";
20
version = "0.10.1";
21
22
src = fetchFromGitHub {
23
owner = "Nheko-Reborn";
24
repo = "mtxclient";
25
+
rev = "v${finalAttrs.version}";
26
hash = "sha256-Y0FMCq4crSbm0tJtYq04ZFwWw+vlfxXKXBo0XUgf7hw=";
27
};
28
29
+
patches = [
30
+
./remove-network-tests.patch
31
+
];
0
32
33
cmakeFlags = [
34
+
(lib.cmakeBool "BUILD_LIB_TESTS" finalAttrs.finalPackage.doCheck)
35
+
(lib.cmakeBool "BUILD_LIB_EXAMPLES" false)
0
0
36
];
37
38
nativeBuildInputs = [
···
51
spdlog
52
];
53
54
+
checkInputs = [ gtest ];
55
+
56
+
doCheck = true;
57
+
58
meta = with lib; {
59
description = "Client API library for the Matrix protocol";
60
homepage = "https://github.com/Nheko-Reborn/mtxclient";
···
66
];
67
platforms = platforms.all;
68
};
69
+
})
+77
pkgs/by-name/mt/mtxclient/remove-network-tests.patch
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2
+
index 9d9f92932246ebec8ab5d1cc462366a17818d014..ce27390bd754a33986188dd2bf29cd0c818c2d58 100644
3
+
--- a/CMakeLists.txt
4
+
+++ b/CMakeLists.txt
5
+
@@ -398,36 +398,6 @@ if(BUILD_LIB_TESTS)
6
+
7
+
file(COPY tests/fixtures DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
8
+
9
+
- add_executable(client_api tests/client_api.cpp)
10
+
- target_link_libraries(client_api
11
+
- MatrixClient::MatrixClient
12
+
- GTest::GTest
13
+
- GTest::Main)
14
+
- target_include_directories(client_api PRIVATE
15
+
- ${CMAKE_CURRENT_SOURCE_DIR}/tests)
16
+
-
17
+
- add_executable(media_api tests/media_api.cpp)
18
+
- target_link_libraries(media_api
19
+
- MatrixClient::MatrixClient
20
+
- GTest::GTest
21
+
- GTest::Main)
22
+
- target_include_directories(media_api PRIVATE
23
+
- ${CMAKE_CURRENT_SOURCE_DIR}/tests)
24
+
-
25
+
- add_executable(e2ee tests/e2ee.cpp)
26
+
- target_link_libraries(e2ee
27
+
- MatrixClient::MatrixClient
28
+
- GTest::GTest
29
+
- GTest::Main)
30
+
- target_include_directories(e2ee PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests)
31
+
-
32
+
- add_executable(device tests/device.cpp)
33
+
- target_link_libraries(device
34
+
- MatrixClient::MatrixClient
35
+
- GTest::GTest
36
+
- GTest::Main)
37
+
- target_include_directories(device PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests)
38
+
-
39
+
add_executable(utils tests/utils.cpp)
40
+
target_link_libraries(utils
41
+
MatrixClient::MatrixClient
42
+
@@ -435,21 +405,6 @@ if(BUILD_LIB_TESTS)
43
+
GTest::Main)
44
+
target_include_directories(utils PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests)
45
+
46
+
- add_executable(pushrules tests/pushrules.cpp)
47
+
- target_link_libraries(pushrules
48
+
- MatrixClient::MatrixClient
49
+
- GTest::GTest
50
+
- GTest::Main)
51
+
- target_include_directories(pushrules PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests)
52
+
-
53
+
- add_executable(connection tests/connection.cpp)
54
+
- target_link_libraries(connection
55
+
- MatrixClient::MatrixClient
56
+
- GTest::GTest
57
+
- GTest::Main)
58
+
- target_include_directories(connection PRIVATE
59
+
- ${CMAKE_CURRENT_SOURCE_DIR}/tests)
60
+
-
61
+
add_executable(identifiers tests/identifiers.cpp)
62
+
target_link_libraries(identifiers
63
+
MatrixClient::MatrixClient
64
+
@@ -498,13 +453,7 @@ if(BUILD_LIB_TESTS)
65
+
GTest::GTest
66
+
GTest::Main)
67
+
68
+
- add_test(BasicConnectivity connection)
69
+
- add_test(ClientAPI client_api)
70
+
- add_test(MediaAPI media_api)
71
+
- add_test(Encryption e2ee)
72
+
- add_test(Devices device)
73
+
add_test(Utilities utils)
74
+
- add_test(Pushrules pushrules)
75
+
add_test(Identifiers identifiers)
76
+
add_test(Errors errors)
77
+
add_test(CryptoStructs crypto)