Regression tests for the derammo/cmake submodule. Lives outside the cmake submodule and outside cmake-example so that:
- consumers of the
cmakesubmodule don't get test files in their tree - the test harness is independent of any particular example project
- the submodule pin can be bumped here independently to test changes
Only POSIX tools: sh, make, sed, find, grep. No C/C++ compiler needed — these tests only exercise the text-generation parts of cmake/setup.make.
After cloning:
git submodule update --init
make testEach tests/test_*.sh file is a standalone script and can be run directly:
sh tests/test_root_sed_g_flag.shEach test creates an isolated sandbox under $TMPDIR, symlinks the cmake submodule into it, runs make -f .../cmake/setup.make <target>, and asserts on the generated files.
| Test | Target in setup.make |
Bug it covers |
|---|---|---|
test_root_sed_g_flag.sh |
root |
sed without /g at setup.make:58 |
test_library_local_sources.sh |
library |
> vs >> in root-source loop at setup.make:23-25 |
test_executable_local_sources.sh |
executable |
> vs >> in root-source loop at setup.make:46-48 |
test_executable_private_sources.sh |
executable |
> vs >> in src/ loop at setup.make:49-51 |
When a fix to the cmake submodule should be tested:
cd cmake
git fetch
git checkout <fixed commit>
cd ..
git add cmake
git commit -m "bump cmake to <sha>"
make test