Thanks @ivankravets, I managed to work out what I was doing wrong.
I had too many levels of nesting:
- tests
- desktop
- test_analyzer
- test_analyzer.cpp
- test_endstop
- test_endstop.cpp
- test_analyzer
- desktop
When I removed the desktop level, everything worked as expected:
- tests
- test_analyzer
- test_analyzer.cpp
- test_endstop
+ test_endstop.cpp
- test_analyzer