It looks like cmCTestTestHandler::FindExecutable does this. But it only does it for the main binary. If you want a specific python3, I suggest using an absolute path at configure time; mpirun is going to rely on test-time PATH (I don’t think CTest has any magic insight into the arguments to mpirun here).
1 Like