[Lldb-commits] [PATCH] Add SBArgs to the public interface
jingham at apple.com
jingham at apple.com
Wed Mar 11 15:13:41 PDT 2015
My feelings in order of importance are:
1) For sure we should not be adding things to the SB API just for testing. That's going to make for a bad API.
2) We should test everything we can test through the SB API
3) Things that are impossible to test through the SB API need some other way to test them.
a) One way would be to add some SBTest headers that augment the SB API's and add stuff just for testing.
They would depend on the SB API and you would SWIG & include them in the test harness. Tests that use them
would have to be marked as such since you wouldn't be able to run them against an installed lldb, but...
b) Another way is to write something like C++ unit tests
I kind of prefer (a) because it seems likely to me that maintaining tests based on this is less likely to depend
on irrelevant implementation details of the lldb_private API's. And it means we only have one test harness to maintain.
OTOH, in the case of SBArgs, as I said earlier I'm not totally convinced you couldn't come up with a decent reason such a thing might be useful...
> On Mar 11, 2015, at 3:05 PM, Zachary Turner <zturner at google.com> wrote:
> In http://reviews.llvm.org/D8265#139320, @clayborg wrote:
>> You can also test with setting the "target.run-args":
>> (lldb) settings set target.run-args "one 1" 'two 2' three
>> (lldb) settings show target.run-args
>> target.run-args (arguments) =
>> : "one 1"
>> : "two 2"
>> : "three"
> I'm also not crazy about this. it's not testing the real thing. A long time ago I proposed C++ based unit tests and the reaction wasn't very warm, but on the other hand now we're saying "don't add classes to the public API just for testing". Put together, this sounds like "we don't need to test everything". I know that's not the intention, but the point is these two statements don't really reconcile very well with each other. If the SB API is the way to test things, then we should be able to add things to it for the purpose of testing. If it's not, then we need to get gtest up and running on all platforms and all build systems and we need to start writing unit tests.
> EMAIL PREFERENCES
More information about the lldb-commits