Instead of outputting the test directory into the JSON result file, parsing it with FileCheck and then potentially stripping it, simply use FileCheck's -D option.
Note that we use %/t instead of %t in order to normalize to forward slashes on Windows, which matches what we do with sed 's:\\\\\?:/:g'.