7070** Runner** :
7171- ` lammpsrunner.h ` - Thread-based LAMMPS execution
7272
73+ ** Note** : All classes are documented in ` doc/architecture.rst ` with detailed descriptions organized into:
74+ - Main Window and Application Control (LammpsGui, TutorialWizard)
75+ - Editor Components (CodeEditor, LineNumberArea, Highlighter, FindAndReplace)
76+ - LAMMPS Interface (LammpsWrapper, LammpsRunner)
77+ - Visualization Components (ImageViewer, ChartWindow, ChartViewer, SlideShow, RangeSlider)
78+ - Dialog Components (Preferences, SetVariables, FileViewer, LogWindow)
79+ - Support Components (StdCapture, FlagWarnings, Qt helper widgets)
80+
7381### Documentation (` doc/ ` )
74- - ** Format** : reStructuredText (Sphinx)
82+ - ** Format** : reStructuredText (Sphinx) + Doxygen
7583- ** Build Target** : ` html ` (creates ` build-doc/doc/html/ ` )
76- - ** Requirements** : ` doc/requirements.txt ` (Sphinx 6-8.2, extensions)
77- - ** Key Files** : index.rst, installation.rst, basic_usage.rst, etc.
84+ - ** Requirements** : ` doc/requirements.txt ` (Sphinx 6-8.2.3, Breathe, extensions)
85+ - ** Doxygen** : ` Doxyfile.in ` configures API documentation generation
86+ - ** Key Files** :
87+ - ` index.rst ` - Main documentation index with programmer's guide
88+ - ` api_reference.rst ` - Doxygen-generated API documentation
89+ - ` architecture.rst ` - Comprehensive architecture overview of all 26+ classes
90+ - ` lammps_interface.rst ` - LAMMPS integration documentation
91+ - ` testing.rst ` - Testing infrastructure and test case documentation
92+ - ` installation.rst ` , ` basic_usage.rst ` - User-facing documentation
7893
7994### Resources (` resources/ ` )
8095- ` lammpsgui.qrc ` - Qt resource collection file
89104- ` lammps-gui.appdata.xml ` - Linux appdata metadata
90105- ` org.lammps.lammps-gui.yml ` - Flatpak manifest
91106
107+ ### Test Infrastructure (` test/ ` )
108+ - ** Framework** : GoogleTest v1.17.0 (auto-fetched via CMake FetchContent)
109+ - ** CMakeLists.txt** : Test configuration and executable definitions
110+ - ** test_helpers.cpp** : Unit tests for utility functions (28 test cases)
111+ - ** EXAMPLES.md** : Documentation for writing new tests
112+ - ** Enable** : Use ` -D ENABLE_TESTING=ON ` (OFF by default to speed up builds)
113+
92114## Build System & Configuration
93115
94116### CMake Build Modes
@@ -128,6 +150,7 @@ cmake --build build-doc --target doc
128150- ` LAMMPS_GUI_USE_QT5 ` - ON to prefer Qt5, OFF (default) prefers Qt6
129151- ` BUILD_DOC ` - ON (default) builds docs with app, OFF skips docs
130152- ` BUILD_DOC_ONLY ` - ON builds only docs (no app), OFF (default) builds app
153+ - ` ENABLE_TESTING ` - ON enables GoogleTest unit tests, OFF (default) disables tests
131154- ` CMAKE_CXX_STANDARD ` - 17 (required minimum), 23 supported
132155- ` CMAKE_BUILD_TYPE ` - Release or Debug
133156
@@ -147,6 +170,9 @@ sudo apt-get install -y \
147170 qtbase5-dev libqt5charts5-dev # For Qt5
148171 # OR
149172 qt6-base-dev qt6-charts-dev # For Qt6
173+
174+ # For documentation building (optional)
175+ sudo apt-get install -y doxygen
150176```
151177
152178#### macOS (11+)
@@ -164,8 +190,9 @@ sudo apt-get install -y \
164190
165191### Build Targets
166192- ` lammps-gui ` (default) - Main executable
167- - ` doc ` - Build HTML documentation (alias for ` html ` )
168- - ` html ` - Build Sphinx HTML docs
193+ - ` doc ` - Build HTML documentation with Doxygen + Sphinx (alias for ` html ` )
194+ - ` html ` - Build complete HTML documentation (Doxygen → XML → Breathe → Sphinx)
195+ - ` doxygen ` - Run Doxygen only to generate XML (intermediate step)
169196- ` pdf ` - Build PDF documentation (requires pdflatex, latexmk)
170197- ` spelling ` - Run spell check on docs
171198- ` tarball ` - Create source tarball (requires Git)
@@ -212,7 +239,9 @@ Before submitting a PR, ensure:
2122393 . ** Application runs** (` ./build/lammps-gui --platform offscreen -v ` shows version)
2132404 . ** Code follows style** : Use ` .clang-format ` (LLVM-based, 100 char limit)
2142415 . ** No new compiler warnings** with ` -Wall -Wextra `
215- 6 . ** CodeQL scans pass** (checked automatically on push to develop)
242+ 6 . ** Tests pass** if modifying tested components (` ctest --test-dir build/test ` )
243+ 7 . ** Doxygen comments** added for new public classes/methods
244+ 8 . ** CodeQL scans pass** (checked automatically on push to develop)
216245
217246## Common Build Patterns & Issues
218247
@@ -274,6 +303,8 @@ cmake --build build --parallel 2
2743034 . ** GPG sign commits** : All git commits must be GPG signed with a verifiable signature
2753045 . ** Test both Qt versions** if possible (Qt5 and Qt6 have subtle differences)
2763056 . ** Update docs** if changing user-facing features (files in ` doc/ ` directory)
306+ 7 . ** Add Doxygen comments** for new classes/methods using ` /** @brief */ ` style
307+ 8 . ** Update architecture.rst** when adding new classes or major components
277308
278309### Adding New Source Files
2793101 . Add to ` PROJECT_SOURCES ` list in ` CMakeLists.txt ` (lines 88-127)
@@ -287,10 +318,46 @@ cmake --build build --parallel 2
287318- After changes: Qt resource system auto-compiles via ` qt6_add_resources() ` (line 129)
288319
289320### Documentation Updates
290- - ** Format** : reStructuredText (` .rst ` files in ` doc/ ` )
321+ - ** Format** : reStructuredText (` .rst ` files in ` doc/ ` ) + Doxygen comments in C++ headers
322+ - ** Doxygen** : Add ` /** @brief */ ` style comments to classes and methods in header files
323+ - ** API Reference** : Classes documented with Doxygen appear in ` doc/api_reference.rst `
324+ - ** Architecture** : Update ` doc/architecture.rst ` when adding new classes or components
291325- ** Spell check** : Run ` cmake --build build-doc --target spelling `
292326- ** Preview locally** : Open ` build-doc/doc/html/index.html ` in browser
293- - ** CI validates** : Every PR builds docs automatically
327+ - ** CI validates** : Every PR builds docs automatically (including Doxygen → Breathe → Sphinx)
328+
329+ ### Doxygen Documentation Standards
330+ Use Javadoc-style comments for C++ code documentation:
331+
332+ ** Class documentation** :
333+ ``` cpp
334+ /* *
335+ * @brief Brief one-line description
336+ *
337+ * Detailed description paragraph. Can span multiple lines.
338+ * List features and responsibilities.
339+ *
340+ * @see RelatedClass for related functionality
341+ */
342+ class MyClass {
343+ ```
344+
345+ **Method documentation**:
346+ ```cpp
347+ /**
348+ * @brief Brief description of what the method does
349+ * @param paramName Description of parameter
350+ * @return Description of return value
351+ */
352+ void myMethod(int paramName);
353+ ```
354+
355+ ** Member variables** (inline documentation):
356+ ``` cpp
357+ QString current_file; // /< Brief description of member variable
358+ ```
359+
360+ ** Example** : See ` src/lammpsgui.h ` for comprehensive Doxygen documentation of the main LammpsGui class with 69+ documented methods.
294361
295362## Dependency Management
296363
@@ -310,11 +377,37 @@ cmake --build build --parallel 2
310377
311378## Testing & Validation
312379
313- ### No Automated Unit Tests
314- - ** Important** : This project has NO automated test suite
315- - ** No test framework** : No gtest, catch2, Qt Test, etc.
316- - ** Validation method** : Manual testing and CI compilation checks
317- - ** CI only verifies** : Code compiles and app starts (` --platform offscreen -v ` )
380+ ### Automated Unit Tests (NEW)
381+ The project now includes a growing test suite using GoogleTest:
382+
383+ - ** Test Directory** : ` test/ ` contains test files and CMakeLists.txt
384+ - ** Test Framework** : GoogleTest v1.17.0 (fetched automatically via CMake)
385+ - ** Current Coverage** : 28 test cases in ` test_helpers.cpp ` covering:
386+ - String duplication functions (` mystrdup ` - 3 overloads)
387+ - Date comparison (` date_compare ` )
388+ - Line splitting with quote handling (` split_line ` )
389+ - Executable detection (` has_exe ` )
390+ - Theme detection (` is_light_theme ` )
391+ - ** Command-line Tests** : Two CTest tests validate executable behavior:
392+ - ` CommandLine.GetVersion ` - Version string validation
393+ - ` CommandLine.HasPlugin ` - Build configuration verification
394+ - ** Enable Testing** : Use ` -D ENABLE_TESTING=ON ` during CMake configuration (OFF by default)
395+
396+ ### Running Tests
397+ ``` bash
398+ # Build with tests enabled
399+ cmake -S . -B build -D LAMMPS_GUI_USE_PLUGIN=yes -D BUILD_DOC=no -D ENABLE_TESTING=ON
400+ cmake --build build --parallel 2
401+
402+ # Run all tests
403+ ctest --test-dir build/test
404+
405+ # Run with verbose output
406+ ctest --test-dir build/test -V
407+
408+ # Run specific test
409+ ctest --test-dir build/test -R MyStrdup
410+ ```
318411
319412### Manual Testing Checklist
320413When making changes:
@@ -325,6 +418,7 @@ When making changes:
3254185 . Can run simulations (requires LAMMPS library in plugin mode)
3264196 . Documentation builds without errors
3274207 . No new compiler warnings
421+ 8 . Run unit tests if modifying tested components
328422
329423## Important Notes & Constraints
330424
@@ -376,24 +470,47 @@ cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug \
376470 -D LAMMPS_GUI_USE_PLUGIN=yes -D BUILD_DOC=no
377471cmake --build build 2>&1 | grep -i " warning:"
378472```
473+
474+ ### Run Tests
475+ ``` bash
476+ cmake -S . -B build -D LAMMPS_GUI_USE_PLUGIN=yes -D BUILD_DOC=no -D ENABLE_TESTING=ON
477+ cmake --build build --parallel 2
478+ ctest --test-dir build/test -V
479+ ```
379480## Code Review
380481
381482When performing a code review, check any changes to the documentation
382483(in the `doc/` folder) to be written in American English and with plain
383484ASCII characters.
384485
486+ ## Programmer' s Guide and API Documentation
487+
488+ The project now includes comprehensive developer documentation:
489+
490+ - **Programmer' s Guide**: `doc/index.rst` includes a dedicated section for developers
491+ - **API Reference**: `doc/api_reference.rst` - Doxygen-generated class documentation
492+ - ** Architecture** : ` doc/architecture.rst ` - Complete overview of all 26+ classes
493+ - ** LAMMPS Interface** : ` doc/lammps_interface.rst ` - Integration documentation
494+ - ** Testing Guide** : ` doc/testing.rst ` - Test infrastructure and examples
495+
496+ ** Note** : The initial version of the Programmer's Guide was created by a GitHub Copilot
497+ Coding Agent. While comprehensive, not everything has been carefully verified yet. If you
498+ spot errors or inconsistencies in the architecture or API documentation, please submit
499+ a bug report.
500+
385501## Trust These Instructions
386502
387503These instructions have been thoroughly researched by examining:
388504- All workflow files, CMakeLists.txt, build scripts
389505- Documentation (README, installation.rst, TODO.md)
390506- Source code structure and build patterns
391507- Actual successful build of documentation
508+ - Test infrastructure and examples
392509
393510** Only search or explore further if** :
394511- These instructions are incomplete for your specific task
395512- You encounter errors not covered here
396513- The information appears outdated or incorrect
397514- You need details about specific source files not covered
398515
399- For implementation details of specific features, refer to the source files in ` src/ ` . For user-facing behavior, check the documentation in ` doc/ ` . For build system internals, study ` CMakeLists.txt ` (well-commented, 415 lines).
516+ For implementation details of specific features, refer to the source files in ` src/ ` . For user-facing behavior, check the documentation in ` doc/ ` . For build system internals, study ` CMakeLists.txt ` (well-commented, 415 lines). For API documentation, see ` doc/api_reference.rst ` .
0 commit comments