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 codeblocks codeblocks-ide copier-template
Last synced: over 1 year 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-01-18T22:02:18.000Z (over 1 year ago)
- Last Synced: 2025-01-18T22:27:24.830Z (over 1 year ago)
- Topics: c, clanguage, cmake, codeblocks, codeblocks-ide, copier-template
- Language: Jinja
- Homepage:
- Size: 362 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
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/
## Other stuff
### checks
1. tests pass
### results
| | | | checked | state |
| --- | --- | --- | --- | --- |
| both | flat | with-external | 2024-07-22 | ok |
| both | flat | wo-external | 2024-07-22 | ok |
| both | nested | with-external | 2024-07-22 | ok |
| both | nested | wo-external | 2024-07-22 | ok |
| exe | flat | with-external | 2024-07-22 | ok |
| exe | flat | wo-external | 2024-07-22 | ok |
| exe | nested | with-external | 2024-07-22 | ok |
| exe | nested | wo-external | 2024-07-22 | ok |
| lib | flat | with-external | 2024-07-22 | ok |
| lib | flat | wo-external | 2024-07-22 | ok |
| lib | nested | with-external | 2024-07-22 | ok |
| lib | nested | wo-external | 2024-07-22 | ok |