Fetching an input file required about five lines of code, and this was
repeated in multiple unit tests, with slight variations. Add a helper
function for doing that into the lldbUtilityMocks module (which I rename
to lldbUtilityHelpers to commemorate the fact it includes more than
mocks)
Details
Diff Detail
- Build Status
Buildable 7646 Build 7646: arc lint + arc unit
Event Timeline
Great change. The only comment I have is about location of TestUtilities.cpp.
Utility\Helpers kinda implies that these are helpers for Utility tests which is not true.
I would move it up one level up lldb/unittests/TestUtilities.cpp
unittests/Utility/Helpers/TestUtilities.cpp | ||
---|---|---|
17 | this should be const Twine &name. Also can you call this GetInputFilePath()? At first I was assuming it would return the contents of the file. |
Hm.. that makes sort of sense for this function.
However, right now I can't think of any other utility function that would go here. OTOH, I have a couple of ideas about the use of the XXX/Helpers/YYY.h pattern. For example, in Host/Helpers we could have a utility function which creates two connected sockets (already needed for a couple tests), and Core/Helpers could contain mocked versions of various Process/Target/... classes (as no higher level functionality can be tested without one of those around).
That's why I'd like to avoid creating a module if it's going to contain just this function. And with that in mind putting in in Utility/Helpers makes sense as that's the place everyone can pull it from without grabbing additional dependencies.
this should be const Twine &name. Also can you call this GetInputFilePath()? At first I was assuming it would return the contents of the file.