cli: Fix testing when build dir != source dir.