I would like to use ThrowTheSwitch Unity for my unit tests in several projects so I have this generic structure:
.
├── README.md
├── Makefile
├── src
│ ├── ...
│ └── main.c
└── test
├── vendor
│ ├── unity.c
│ └── unity.h
└── test_main.c
To include unity I could use different approach:
- Git Submodules
- pros: git only, one single source of truth
- cons: get all the unity repository while only 3 files are required
- Git Submodules with sparse checkout
- pros: only get what I need
- cons: need some hack to enable the sparse-checkout
- Git Subtree
- pros: safe if no internet available
- cons: keep local copies of unity in the history
- Wget from a release
- pros: very simple, very effective
- cons: dependency on
wgetandtarand internet (no local cache)
- Local copy of unity
- pros: most simple solution, effective
- cons: not SSOT, all similar projects will have their local copy of unity, lost track of which unity version is synced.
It seems none of the above method is perfect and I don't know which one to choose. The best solution would be to have a simple package manager with a package.json file that list my dependencies and their versions.
Is there any other/better solution?