git clone https://github.com/homer6/frequent-cron.git
cd frequent-cron
cmake .
make -j$(nproc)
make test ARGS="--output-on-failure"GTest is fetched automatically via CMake FetchContent.
Release branches hold the latest patch for each minor version:
| Branch | Version Line | Description |
|---|---|---|
0.1 |
v0.1.x | Original Linux daemon |
0.2 |
v0.2.x | Cross-platform, modern C++ |
0.3 |
v0.3.x | Service manager |
main |
latest stable | Mirrors the latest release branch after a release is cut |
Workflow:
- Create a feature/fix branch off the appropriate release branch (e.g.
fix/my-bugoff0.3). - Open a PR targeting the release branch.
- After merge, tag the release (e.g.
v0.3.1) on the release branch. - Merge the release branch into
main.
For fixes that apply to multiple versions, create separate branches and PRs for each release branch.
include/ # Public headers
src/ # Implementation + main.cc
tests/ # GTest unit tests + integration test scripts
docs/ # Platform guides, release notes, wiki content
docs/wiki/ # Wiki pages (synced to GitHub Wiki)
docs/releases/ # Release notes
.github/workflows # CI configuration
# All tests (GTest + integration)
make test ARGS="--output-on-failure"
# GTest only (faster, skips integration)
make test ARGS="--output-on-failure -E integration"
# Specific test suite
make test ARGS="--output-on-failure -R Config"
make test ARGS="--output-on-failure -R Database"- Create header in
include/mymodule.h - Create implementation in
src/mymodule.cc - Add
mymodule.cctosrc/CMakeLists.txtin the library sources - Create tests in
tests/test_mymodule.cc - Add test target in
tests/CMakeLists.txt:add_executable( test_mymodule test_mymodule.cc ) target_link_libraries( test_mymodule ${CMAKE_PROJECT_NAME}_lib GTest::gtest_main ) gtest_discover_tests( test_mymodule )
- Add test binary to
.gitignore
- Use
#ifdef _WIN32/#elif defined(__APPLE__)/#elif defined(__FreeBSD__)/#elsefor platform-specific code - Test on all three platforms via CI before submitting a PR
- Windows requires
WIN32_LEAN_AND_MEANbefore<windows.h>andNOMINMAXto avoid macro conflicts - macOS uses
_NSGetExecutablePath()for binary path detection; Linux uses/proc/self/exe
- 4-space indentation
- Spaces inside parentheses:
if( condition ) - Braces on same line:
}else{ #pragma oncefor header guards- No
using namespace std-- qualify withstd::