Add support for -filelist option for llvm-libtool-darwin
-filelist option allows for passing in file containing a list of filenames.
Depends on D83520.
Documentation for the new option?
Why are you trying to delete some files here?
I'm not sure this comment is accurate for what the error is indicating. It needs to provide more context.
This seems like essentially a duplicate of the earlier error case?
Additional possible test-cases:
Nit: your -o option doesn't include a trailing full stop in its description. Be consistent.
I just wanted to make sure that %basename_t.tmp-input1.o didn't exist in the current directory. However, I have now removed the error test just below (and therefore removed RUN: rm -f %t-input1.o && rm -f %basename_t.tmp-input1.o) as it was similar to the "file not in filelist test" as you highlighted. Thanks!
yup, you are right. I have now removed the previous test case
3rd case is already there:
## Check that error is thrown when file in filelist doesn't exist (with dir): # RUN: rm -rf %t/Invalid-Dir && mkdir -p %t/Invalid-Dir # RUN: echo 'no-such-file' > %t.invalid-list.txt # RUN: not llvm-libtool-darwin -static -o %t.lib -filelist %t.invalid-list.txt,%t/Invalid-Dir 2>&1 | \ # RUN: FileCheck %s --check-prefix=FILE-ERROR -DFILE=%t/Invalid-Dir/no-such-file
I have modified the comment to make it more clear. Added the first 2 cases now. Thanks.
I'd suggest "Whitespace on a line is assumed..."
Could you just use echo '' >> %t.blank-line.txt to get your blank line, so that this can run on Windows?
Similarly, here, use echo -n " " here. Why the -n at all in fact in this case?
I'd suggest using FileCheck --strict-whitespace in this case to be able to match the filename properly.
error -> an error
I'd recommend a different name for the directory. The directory itself is not invalid, so calling it that is a little confusing. How about just reusing the directory from before?
Thanks. What about one for the directory not existing at all?
I'd be tempted to use a different error message to show that this error isn't a system error. Perhaps simply "filename cannot be empty".
Nit: SmallString has an operator std::string, so you should be able to convert directly without the intermediate Twine. I'm not sure if just InputFiles.push_back(Path) will compile, but a cast should definitely trigger the conversion, e.g. InputFiles.push_back(static_cast<std::string>(Path)).