https://github.com/jspaaks/copier-template-for-c-projects
Copier template for C projects
https://github.com/jspaaks/copier-template-for-c-projects
c clanguage cmake copier-template template
Last synced: 16 days ago
JSON representation
Copier template for C projects
- Host: GitHub
- URL: https://github.com/jspaaks/copier-template-for-c-projects
- Owner: jspaaks
- License: apache-2.0
- Created: 2024-07-09T18:40:30.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-11-13T14:20:25.000Z (8 months ago)
- Last Synced: 2026-03-27T08:02:52.381Z (3 months ago)
- Topics: c, clanguage, cmake, copier-template, template
- Language: Jinja
- Homepage:
- Size: 484 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.dev.md
- License: LICENSE
Awesome Lists containing this project
README
# Development notes
## Badges
[](https://github.com/jspaaks/copier-template-for-c-projects/actions/workflows/testing.yml)
[](https://github.com/jspaaks/copier-template-for-c-projects/compare/0.1.0...HEAD)
## Testing
Running the tests requires Python libraries specified in `pyproject.toml`.
Directory `fuzzy` contains fuzzy tests. Each fuzzy test is a random combination of parameter values for the parameters
from [`copier.yml`](copier.yml). Each parameterization runs on a dedicated temporary test directory. Run with:
```shell
python3 -m venv venv
source venv/bin/activate
pip install .[testing]
# Run pytest with default settings from pyproject.toml
NFUZZY=50 pytest
# Run pytest verbosely and for a specific test (here: test_clang_format_generation),
# report stdout in case of failure
NFUZZY=10 pytest fuzzy/test_template.py::test_clang_format_generation -ra --verbose
```
Change the value of `NFUZZY` to run more or fewer fuzzy tests.
By default, testing includes running the generated tests on the generated content. Since this requires additional
dependencies (e.g. Criterion and its dependencies, CMake, some build system like `make`, a C compiler, etc), it's sometimes convenient to
skip those tests. To that end, they have been marked with a PyTest marker `inception` which should be used as follows in
order to skip those tests:
```
NFUZZY=10 pytest -m 'not inception'
```
For an overview of all pytest markers, see [`pyproject.toml`](pyproject.toml) or run:
```console
$ pytest --markers
```
On Windows and Mac you may need to fiddle with various path-related environment variables, see the testing
workflow [`.github/workflows/testing.yml`](.github/workflows/testing.yml).
# Live editing / rendering of Jinja templates
https://j2live.ttl255.com/