Skip to content

Commit 285bbfe

Browse files
committed
Add .editorconfig, refactor CMake setup for tests, and update CI to use test labels
1 parent 8fd8e80 commit 285bbfe

5 files changed

Lines changed: 67 additions & 36 deletions

File tree

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
7+
# 4-space indentation for all files
8+
[*.{py,js,ts,json}]
9+
indent_style = space
10+
indent_size = 4
11+
12+
# 2-space indentation for markup
13+
[*.{html,css,md,yml,yaml}]
14+
indent_style = space
15+
indent_size = 2
16+
17+
# Trims trailing whitespace for all files except Makefiles
18+
[*.{cs,java,cpp,h}]
19+
trim_trailing_whitespace = true

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ jobs:
6464
run: cmake --build build --config Release --parallel
6565

6666
- name: Unit tests
67-
run: ctest --test-dir build -C Release -R hyperliquid_tests --output-on-failure
67+
run: ctest --test-dir build -C Release -L unit --output-on-failure
6868

6969
- name: Integration tests
70-
run: ctest --test-dir build -C Release -R hyperliquid_integration_tests --output-on-failure
70+
run: ctest --test-dir build -C Release -L integration --output-on-failure
7171
timeout-minutes: 5

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
---
99

10+
## [unreleased]
11+
12+
### Changed
13+
- Normalize line ending to LF
14+
- Move test CMake setup into `tests/CMakeLists.txt`, register GoogleTest cases with `gtest_discover_tests()`, and update CI to run unit/integration test groups by CTest label.
15+
1016
## [0.1.2] - 2026-06-09
1117

1218
### Added

CMakeLists.txt

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -55,42 +55,9 @@ if(HYPERLIQUID_BUILD_EXAMPLES)
5555
target_link_libraries(basic_order PRIVATE hyperliquid)
5656
endif()
5757

58-
# ── Unit tests ────────────────────────────────────────────────────────────────
59-
6058
if(HYPERLIQUID_BUILD_TESTS)
61-
find_package(GTest CONFIG REQUIRED)
62-
63-
add_executable(hyperliquid_tests
64-
tests/test_keccak.cpp
65-
tests/test_types.cpp
66-
tests/test_signing.cpp
67-
tests/test_exchange.cpp
68-
tests/test_websocket_utils.cpp
69-
)
70-
71-
target_link_libraries(hyperliquid_tests PRIVATE
72-
hyperliquid
73-
GTest::gtest
74-
GTest::gtest_main
75-
)
76-
7759
enable_testing()
78-
add_test(NAME hyperliquid_tests COMMAND hyperliquid_tests)
79-
80-
# ── Integration tests (require network access to testnet) ─────────────────
81-
82-
add_executable(hyperliquid_integration_tests
83-
tests/test_info_integration.cpp
84-
tests/test_websocket_integration.cpp
85-
)
86-
87-
target_link_libraries(hyperliquid_integration_tests PRIVATE
88-
hyperliquid
89-
GTest::gtest
90-
GTest::gtest_main
91-
)
92-
93-
add_test(NAME hyperliquid_integration_tests COMMAND hyperliquid_integration_tests)
60+
add_subdirectory(tests)
9461
endif()
9562

9663
# ── Install ────────────────────────────────────────────────────────────────────

tests/CMakeLists.txt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
find_package(GTest CONFIG REQUIRED)
2+
include(GoogleTest)
3+
4+
add_executable(hyperliquid_tests
5+
test_keccak.cpp
6+
test_types.cpp
7+
test_signing.cpp
8+
test_exchange.cpp
9+
test_websocket_utils.cpp
10+
)
11+
12+
target_link_libraries(hyperliquid_tests PRIVATE
13+
hyperliquid
14+
GTest::gtest
15+
GTest::gtest_main
16+
)
17+
18+
gtest_discover_tests(hyperliquid_tests
19+
TEST_PREFIX unit.
20+
PROPERTIES
21+
LABELS unit
22+
)
23+
24+
add_executable(hyperliquid_integration_tests
25+
test_info_integration.cpp
26+
test_websocket_integration.cpp
27+
)
28+
29+
target_link_libraries(hyperliquid_integration_tests PRIVATE
30+
hyperliquid
31+
GTest::gtest
32+
GTest::gtest_main
33+
)
34+
35+
gtest_discover_tests(hyperliquid_integration_tests
36+
TEST_PREFIX integration.
37+
PROPERTIES
38+
LABELS integration
39+
)

0 commit comments

Comments
 (0)