This patch allows a target to call a function add_llvm_unittest_inputs() with a list of files. This list of files will be copied from the source directory to the binary directory. Then, it adds a function to SupportHelpers that computes the input directory folder, which a unittest can then use to construct a path to the inputs folder.
LLDB has had this for a while, but now I need it in LLVM. Since we have more than one user now, having this in LLVM makes sense, and as a followup we can port LLDB's uses over to the new LLVM code.
These post build commands will only run when the unit test target rebuilds, which means changes to the inputs won't be reflected in the copied files if you edit an input, rebuild, and re-run the test.
Would it be better to embed a path to the Inputs directory in the source directory? That's how lit tests work; they don't copy inputs to the output directory. I don't see why unit tests need to be independent from the source directory.