Skip to content

ctest: De-duplicate add_subdirectory and subdirs

Brad King requested to merge brad.king/cmake:ctest-add_subdirectory into master

CTest re-implements the subdirs and add_subdirectory commands. De-duplicate their implementations and add test cases verifying both.

In particular, this fixes the add_subdirectory implementation that was missing code for changing the current working directory.

Factored out of !6734 (closed).

Co-Authored-By: @friendlyanon
Issue: #22921

Merge request reports