Skip to content

Commit 1e05ca3

Browse files
committed
Fix systematic testing issues and improve MSVC compatibility
- Standardize test infrastructure across all modules - Fix MSVC-specific compilation issues - Improve CMake build configuration - Add comprehensive testing documentation - Update clang-format configuration - Add MSVC build scripts and documentation
1 parent a4fe300 commit 1e05ca3

File tree

887 files changed

+39448
-30500
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

887 files changed

+39448
-30500
lines changed

.clang-format

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,3 @@ SpacesInSquareBrackets: false
9191
Standard: Auto
9292
TabWidth: 8
9393
UseTab: Never
94-
---
95-
Language: JavaScript
96-
DisableFormat: true
97-
---
98-
Language: Json
99-
DisableFormat: true

.gitignore

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353

5454
# Build directories
5555
build/
56+
build-msvc/
5657
cmake-build-*/
5758
out/
5859
_build/
@@ -70,6 +71,7 @@ CPackSourceConfig.cmake
7071

7172
# CMake temporary files
7273
.cmake/
74+
cmake_config*.log
7375

7476
# -----------------------------------------------------------------------------
7577
# Package Managers
@@ -142,7 +144,6 @@ coverage.xml
142144
cover/
143145

144146
# Virtual environments
145-
.env
146147
.venv
147148
env/
148149
venv/
@@ -278,7 +279,6 @@ tramp
278279
# Sphinx documentation
279280
docs/_build/
280281
docs/build/
281-
_build/
282282

283283
# Doxygen
284284
doc/html/
@@ -299,7 +299,6 @@ doxygen_warnings.txt
299299

300300
# Xmake
301301
.xmake/
302-
build/
303302

304303
# Bazel
305304
bazel-*
@@ -313,8 +312,6 @@ Thumbs.db
313312
Thumbs.db:encryptable
314313
ehthumbs.db
315314
ehthumbs_vista.db
316-
*.tmp
317-
*.temp
318315
Desktop.ini
319316
$RECYCLE.BIN/
320317
*.cab
@@ -459,6 +456,18 @@ nlohmann/
459456
*SUMMARY.md
460457
*_SUMMARY.md
461458

459+
# Build output and logs
460+
build_output.txt
461+
test_results.txt
462+
preset_list.txt
463+
vcpkg_location.txt
464+
465+
# Generated distribution files
466+
dist/
467+
468+
# LLM documentation (generated)
469+
llmdoc/
470+
462471
# -----------------------------------------------------------------------------
463472
# End of .gitignore
464473
# -----------------------------------------------------------------------------

.markdownlint.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"MD013": false,
3+
"MD029": { "style": "ordered" }
4+
}

AGENTS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
# Repository Guidelines
22

33
## Project Structure & Module Organization
4+
45
- `atom/` — C++ core library, organized by domain (algorithm, async, io, etc.).
56
- `python/` — Pybind11 bindings and the `atom` Python package.
67
- `tests/` — C++ test suite (GoogleTest via CMake/CTest). Python tests, if any, also live here.
78
- `docs/` — Sphinx docs; `doc/` — Doxygen configuration (`Doxyfile`).
89
- `cmake/`, `scripts/`, `example/`, `build/` (generated).
910

1011
## Build, Test, and Development Commands
12+
1113
- C++ build (Ninja default): `cmake --preset release && cmake --build --preset release -j`
1214
- C++ tests: `cmake --preset debug && cmake --build --preset debug -j && ctest --preset default --output-on-failure`
1315
- Cross‑platform scripts: `./build.sh` (Unix) or `build.bat` (Windows) - wrapper scripts for backward compatibility
@@ -17,17 +19,21 @@
1719
- Docs: Sphinx `sphinx-build -b html docs docs/_build`; Doxygen `doxygen Doxyfile`
1820

1921
## Coding Style & Naming Conventions
22+
2023
- C++: 4‑space indent, 80‑column guide; format with `clang-format` (see `.clang-format`).
2124
- Naming (C++): camelCase for variables/functions, PascalCase for classes/namespaces, UPPER_SNAKE_CASE for constants, files `lower_snake_case.[cpp|hpp]` (see `STYLE_OF_CODE.md`). Prefer Doxygen comments.
2225
- Python: Black (88 cols), isort, Ruff, MyPy (configured in `pyproject.toml`). Run: `pre-commit run -a`.
2326

2427
## Testing Guidelines
28+
2529
- C++: Use GoogleTest; place tests under `tests/<module>/` and register targets in the local `CMakeLists.txt`. Run via CTest; include edge cases and failure paths.
2630
- Python: pytest patterns `test_*.py`, marks available (`unit`, `integration`, `slow`). Aim to keep coverage healthy; prefer small, focused tests.
2731

2832
## Commit & Pull Request Guidelines
33+
2934
- Commits: short imperative subject (≤72 chars), descriptive body when needed. Reference issues (`#123`). Conventional commit prefixes are optional.
3035
- PRs: clear description, rationale, linked issues, tests added/updated, and doc changes if behavior/user‑facing APIs change. Ensure `pre-commit` passes and CI is green.
3136

3237
## Security & Configuration Tips
38+
3339
- Don’t commit secrets; prefer env vars. Build requires CMake ≥3.21 and a modern compiler (MSVC 2022/GCC/Clang). C/C++ deps via vcpkg/Conan; Python ≥3.8.

CLAUDE.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ The project uses CMake as the primary build system with enhanced build scripts:
2222
### Build System Features
2323

2424
The enhanced build scripts support:
25+
2526
- Multiple build types (debug, release, relwithdebinfo)
2627
- Parallel compilation with automatic CPU detection
2728
- System dependency installation
@@ -32,6 +33,7 @@ The enhanced build scripts support:
3233
### Module-Based Building
3334

3435
You can selectively build modules using CMake options:
36+
3537
- `ATOM_BUILD_ALGORITHM=ON/OFF` - Algorithm and mathematical operations
3638
- `ATOM_BUILD_IMAGE=ON/OFF` - Image processing and computer vision
3739
- `ATOM_BUILD_ASYNC=ON/OFF` - Asynchronous operations
@@ -74,6 +76,7 @@ Atom is organized into modular components under `atom/`:
7476
### Python Bindings
7577

7678
Python bindings are available for most modules using pybind11:
79+
7780
- Enable with `--python` flag or `ATOM_BUILD_PYTHON_BINDINGS=ON`
7881
- Bindings are located in `python/` directory
7982
- Each module has corresponding Python binding files
@@ -107,18 +110,21 @@ Atom uses a comprehensive error handling system centered in the `error` module.
107110
## Common Development Tasks
108111

109112
### Building a Single Module
113+
110114
```bash
111115
cmake -B build -DATOM_BUILD_ALGORITHM=ON -DATOM_BUILD_TESTS=ON
112116
cmake --build build
113117
```
114118

115119
### Running Specific Tests
120+
116121
```bash
117122
cd build
118123
ctest -R "algorithm_*" --output-on-failure
119124
```
120125

121126
### Building with All Features
127+
122128
```bash
123129
./scripts/build.sh --release --python --examples --tests --docs --package
124-
```
130+
```

CMakeLists.txt

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,12 @@ endforeach()
4848
# -----------------------------------------------------------------------------
4949
# Options
5050
# -----------------------------------------------------------------------------
51-
option(USE_VCPKG "Use vcpkg package manager" ON)
52-
if(WIN32 AND CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
53-
# Ensure vcpkg is enabled for MSVC builds
51+
option(USE_VCPKG "Use vcpkg package manager" OFF)
52+
# Force vcpkg ON for MSVC builds (but not MSYS2/MinGW)
53+
if(WIN32
54+
AND CMAKE_CXX_COMPILER_ID MATCHES "MSVC"
55+
AND NOT DEFINED ENV{MSYSTEM})
56+
# Ensure vcpkg is enabled for MSVC builds only (not MSYS2)
5457
set(USE_VCPKG
5558
ON
5659
CACHE BOOL "Enable vcpkg for MSVC" FORCE)
@@ -132,6 +135,8 @@ set(CMAKE_CXX_EXTENSIONS OFF)
132135
# Setup compiler-specific options based on build type and compiler
133136
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
134137
message(STATUS "Configuring for MSVC compiler")
138+
# Work around Windows SDK winnt.h arch detection under some environments
139+
add_compile_definitions(ATOM_DISABLE_DBGHELP _AMD64_)
135140
# Call compiler configuration from compiler_options.cmake
136141
setup_project_defaults(
137142
CXX_STANDARD
@@ -159,8 +164,13 @@ add_compile_definitions(ATOM_VERSION="${PROJECT_VERSION}"
159164

160165
# Windows API version definitions
161166
if(WIN32)
162-
add_compile_definitions(_WIN32_WINNT=0x0A00 # Windows 10
163-
WINVER=0x0A00 _WIN32_WINDOWS=0x0A00)
167+
add_compile_definitions(
168+
_WIN32_WINNT=0x0A00 # Windows 10
169+
WINVER=0x0A00
170+
_WIN32_WINDOWS=0x0A00
171+
NOMINMAX # Prevent Windows.h from defining min/max macros
172+
WIN32_LEAN_AND_MEAN # Exclude rarely-used stuff from Windows headers
173+
)
164174
endif()
165175

166176
# -----------------------------------------------------------------------------

CMakePresets.json

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,28 @@
8383
"name": "base-msys2",
8484
"hidden": true,
8585
"inherits": "base-mingw",
86+
"cacheVariables": {
87+
"USE_VCPKG": "OFF"
88+
},
89+
"condition": {
90+
"type": "matches",
91+
"string": "$env{PATH}",
92+
"regex": ".*msys64.*|.*msys2.*"
93+
}
94+
},
95+
{
96+
"name": "base-msys2-vcpkg",
97+
"hidden": true,
98+
"inherits": "base-mingw",
99+
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
100+
"cacheVariables": {
101+
"USE_VCPKG": "ON",
102+
"VCPKG_TARGET_TRIPLET": "x64-mingw-dynamic",
103+
"VCPKG_HOST_TRIPLET": "x64-mingw-dynamic"
104+
},
105+
"environment": {
106+
"VCPKG_ROOT": "$penv{VCPKG_ROOT}"
107+
},
86108
"condition": {
87109
"type": "matches",
88110
"string": "$env{PATH}",
@@ -183,6 +205,30 @@
183205
"_common-relwithdebinfo-config"
184206
]
185207
},
208+
{
209+
"name": "debug-msys2-vcpkg",
210+
"displayName": "Debug (MSYS2 with vcpkg)",
211+
"inherits": [
212+
"base-msys2-vcpkg",
213+
"_common-debug-config"
214+
]
215+
},
216+
{
217+
"name": "release-msys2-vcpkg",
218+
"displayName": "Release (MSYS2 with vcpkg)",
219+
"inherits": [
220+
"base-msys2-vcpkg",
221+
"_common-release-config"
222+
]
223+
},
224+
{
225+
"name": "relwithdebinfo-msys2-vcpkg",
226+
"displayName": "RelWithDebInfo (MSYS2 with vcpkg)",
227+
"inherits": [
228+
"base-msys2-vcpkg",
229+
"_common-relwithdebinfo-config"
230+
]
231+
},
186232
{
187233
"name": "debug-make",
188234
"displayName": "Debug (Makefile)",
@@ -287,6 +333,21 @@
287333
"configurePreset": "relwithdebinfo-msys2",
288334
"jobs": 8
289335
},
336+
{
337+
"name": "debug-msys2-vcpkg",
338+
"configurePreset": "debug-msys2-vcpkg",
339+
"jobs": 8
340+
},
341+
{
342+
"name": "release-msys2-vcpkg",
343+
"configurePreset": "release-msys2-vcpkg",
344+
"jobs": 8
345+
},
346+
{
347+
"name": "relwithdebinfo-msys2-vcpkg",
348+
"configurePreset": "relwithdebinfo-msys2-vcpkg",
349+
"jobs": 8
350+
},
290351
{
291352
"name": "debug-make",
292353
"configurePreset": "debug-make",

0 commit comments

Comments
 (0)