This removes the rest of the llvm dependencies from the libc unit test framework.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
(NOT QUITE WORKING) get the rest of the llvm dependencies out StreamWrapper and FDReader
my FDReader change isn't quite working yet but I need to go work on something else and I
don't want to forget to upload this
libc/utils/testutils/FDReaderUnix.cpp | ||
---|---|---|
20–23 ↗ | (On Diff #306222) | Needs brackets and no comment |
32–35 ↗ | (On Diff #306222) | const -> constexpr |
40 ↗ | (On Diff #306222) | Probably left over from testing. |
42–43 ↗ | (On Diff #306222) | This loop could maybe be |
45 ↗ | (On Diff #306222) | Read will not null terminate the buffer, the input probably won't have a '\0' in it either. I think pipeStr.insert(pipeStr.end(), buffer, bytesRead) or similar is safer. |
54 ↗ | (On Diff #306222) | I think pipeStr == inputStr is more clear |
This change finishes the work started in the previous one, all of the tests now pass.
Big thank you to abrachet for the comments.
submit comments
libc/utils/testutils/FDReaderUnix.cpp | ||
---|---|---|
20–23 ↗ | (On Diff #306222) | I feel very silly for missing that one. That was why the test was failing immediately. |
42–43 ↗ | (On Diff #306222) | I made one small change to your code, bytesRead needs to be signed because read uses negative numbers for errors |
54 ↗ | (On Diff #306222) | oops, as I'm sure you guessed I forgot to clean up my code before submitting. |
I am not an expert with pipes. To my eyes, looks OK.
libc/utils/testutils/FDReaderUnix.cpp | ||
---|---|---|
10 ↗ | (On Diff #306525) | Remove this? |
You should probably do the same in utils/testutils/CMakeLists.txt? I will do another pass and switch these targets to add_library after I move FPUtil's TestHelpers.