Add more pre-run asserts for the DirCompletionAbsolute test
authorRaphael Isemann <teemperor@gmail.com>
Thu, 23 Aug 2018 23:21:52 +0000 (23:21 +0000)
committerRaphael Isemann <teemperor@gmail.com>
Thu, 23 Aug 2018 23:21:52 +0000 (23:21 +0000)
commit3e1c793e9d257af2468d603e2f5439537c4d14b3
tree57fa268fdeed8e826a4aa57b90fc088fbcbb706a
parent7a973fb7f25cfb08858ea56c0d068f9ad4b2c50e
Add more pre-run asserts for the DirCompletionAbsolute test

Summary:
The DirCompletionAbsolute is still randomly failing on the nodes even after D50722, so this patch adds more asserts
that verify certain properties on which the actual completion implementation relies on.

The first assert checks that the directory we complete on actually exists. If the directory doesn't exist on the
next CI failure, this assert should catch it and we know that the 0 matches come from a missing base directory.

The second assert is just checking that we are below the PATH_MAX limit that the completion checks against.
This check could randomly fail if the temporary directories we generate are sometimes longer than PATH_MAX,
and the assert can tell us that this is the reason we failed (instead of the mysterious '0 matches').

(As a sidenote: We shouldn't be checking against PATH_MAX anyway in the code (as this is just wrong). Also
the disk completion API really needs a better error mechanism than returning 0 on both error or no-results.)

Reviewers: aprantl, friss

Reviewed By: aprantl

Subscribers: abidh

Differential Revision: https://reviews.llvm.org/D51111

llvm-svn: 340589
lldb/unittests/Interpreter/TestCompletion.cpp