<div dir="ltr"><div>[moving this to lldb-dev for more visibility.]</div><div><br></div>Sorry, I was in a hurry yesterday, so I did not explain myself fully. Let me try to elaborate.<div><br></div><div>> <span style="font-size:12.8px">What I am trying to avoid here is getting useless noise in build automation where test cases proclaim their failure, which however tells us nothing of value as the issue is simply “libc++ not available” vs. “data formatters broken” </span><span style="font-size:12.8px">That is an ability I would strongly like to preserve</span></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I agree that we should have an ability to skip libc++ tests if the library is not available (similarly for go, etc.). However, I believe there should be as little "magic" in that as possible. Otherwise you run into the opposite problem where a test passing could mean "everything is ok" or "our auto-skipping magic has gone wrong", which I would argue is a worse situation than the first one.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Currently, we have a lot of magic in here:</div><div style="font-size:12.8px">- self.build() silently builds an executable with a different library even though libc++ was requested. (otherwise you wouldn't even be able to list the modules of the executable)</div><div style="font-size:12.8px">- the test decides to skip itself without giving any indication about (sure, it shows up in the "skipped tests" list, but a lot of other stuff appears there as well. and I would argue that this is a different situation: usually we do skips based on the OS, architecture, or other "immutable" characteristics. Presence of libc++ is something that can be usually changed by simply installing a package.)</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I'd like to propose a few alternative solutions to achieve both of these objectives:</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">a) Use the existing category system for this: libc++ tests get tagged as such and the user has to explicitly disable this category to avoid running the tests. Potentially, add some code to detect when the user is running the test suite without libc++ installed and abort the run with some message like "No libc++ detected on your system. Please install libc++ or disable libc++ tests with `--disable-category libc++`".</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I like this solution because it is easily achievable and has no magic involved. However, it requires an action from the user (which I think is a good thing, but I see how others may disagree). That's what I meant for asking about your "use case". Would you be able to fit it inside this framework?</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">b) Use category tagging as in (a), but auto-disable this category when libc++ is missing and print a big fat warning "No libc++ detected, libc++ tests will not run". What is different from the current state is that this libc++ detection would work centrally, which would give us the possibility to print the warning (e.g. right before the "Ran XXX test suites" message")</div><div style="font-size:12.8px">I like this a bit less, as it is still automatic, but I am fine with it, as it would give a clear visual indication of what is happening.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">What do you think? Do you have another proposal?</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I can implement either of those, but I was to get some feedback first..</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">pl</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 20 October 2015 at 19:05, Enrico Granata <span dir="ltr"><<a href="mailto:egranata@apple.com" target="_blank">egranata@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><span class=""><blockquote type="cite"><div>On Oct 20, 2015, at 10:43 AM, Pavel Labath <<a href="mailto:labath@google.com" target="_blank">labath@google.com</a>> wrote:</div><br><div><div>Hi Enrico,<br><br>Could you explain what was the motivation behind this change?<br><br></div></div></blockquote><div><br></div></span><div>As per title of the commit, in a process that is using a standard c++ library other than libc++, these tests are noise - of course the libc++ tests aren’t gonna pass if you don’t have libc++</div><span class=""><br><blockquote type="cite"><div><div>I am asking because, I have just learned that this commit has caused<br>all libc++ tests to be skipped on linux*, silently decreasing test<br>coverage on linux. I would like to replace this with some other<br>mechanism, which is not prone to accidental silent skips, like a<br>dotest flag to skip libc++ or something, but I'd like to understand<br>the original motivation first.<br><br>pl<br><br>* the problem seems to be that on linux, we do not have the list of<br>modules until we actually start the process, so this code will not<br>find the library, as it runs before that. </div></div></blockquote><div><br></div></span><div>The solution might then be to run the process, and then skip_if_library_missing</div><div>I think we avoid trying to compile the test inferior entirely if we can’t find libc++ however, so you might first want to check if a.out exists at all, and only then proceed all the way to the first breakpoint being hit</div><span class=""><br><blockquote type="cite"><div><div>If is considered a bug then<br>we can look into that separately, but I'd still like to avoid these<br>kinds of skips.<br><br></div></div></blockquote><div><br></div></span><div>What I am trying to avoid here is getting useless noise in build automation where test cases proclaim their failure, which however tells us nothing of value as the issue is simply “libc++ not available” vs. “data formatters broken”</div><div>That is an ability I would strongly like to preserve</div><div><div class="h5"><br><blockquote type="cite"><div><div><br>On 18 September 2015 at 21:12, Enrico Granata via lldb-commits<br><<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a>> wrote:<br><blockquote type="cite">Author: enrico<br>Date: Fri Sep 18 15:12:52 2015<br>New Revision: 248028<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=248028&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=248028&view=rev</a><br>Log:<br>Make libc++ tests skip themselves if libc++ is not actually loaded in the target<br><br><br>Modified:<br>    lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py<br>    lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py<br>    lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py<br>    lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py<br>    lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py<br>    lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py<br>    lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py<br>    lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py<br>    lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py<br>    lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py<br>    lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py<br>    lldb/trunk/test/lldbutil.py<br><br>Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py?rev=248028&r1=248027&r2=248028&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py?rev=248028&r1=248027&r2=248028&view=diff</a><br>==============================================================================<br>--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py (original)<br>+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py Fri Sep 18 15:12:52 2015<br>@@ -36,6 +36,8 @@ class InitializerListTestCase(TestBase):<br>         """Test that that file and class static variables display correctly."""<br>         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)<br><br>+        lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))<br>+<br>         bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line."))<br><br>         self.runCmd("run", RUN_SUCCEEDED)<br><br>Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py?rev=248028&r1=248027&r2=248028&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py?rev=248028&r1=248027&r2=248028&view=diff</a><br>==============================================================================<br>--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py (original)<br>+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py Fri Sep 18 15:12:52 2015<br>@@ -37,6 +37,8 @@ class LibcxxIteratorDataFormatterTestCas<br>         """Test that libc++ iterators format properly."""<br>         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)<br><br>+        lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))<br>+<br>         lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1)<br><br>         self.runCmd("run", RUN_SUCCEEDED)<br><br>Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py?rev=248028&r1=248027&r2=248028&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py?rev=248028&r1=248027&r2=248028&view=diff</a><br>==============================================================================<br>--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py (original)<br>+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py Fri Sep 18 15:12:52 2015<br>@@ -2,7 +2,7 @@<br> Test lldb data formatter subsystem.<br> """<br><br>-import os, time<br>+import os, time, re<br> import unittest2<br> import lldb<br> from lldbtest import *<br>@@ -39,6 +39,8 @@ class LibcxxListDataFormatterTestCase(Te<br>     def data_formatter_commands(self):<br>         """Test that that file and class static variables display correctly."""<br>         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)<br>+<br>+        lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))<br><br>         lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1)<br>         lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line2, num_expected_locations=-1)<br><br>Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py?rev=248028&r1=248027&r2=248028&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py?rev=248028&r1=248027&r2=248028&view=diff</a><br>==============================================================================<br>--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py (original)<br>+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py Fri Sep 18 15:12:52 2015<br>@@ -35,6 +35,8 @@ class LibcxxMapDataFormatterTestCase(Tes<br>         """Test that that file and class static variables display correctly."""<br>         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)<br><br>+        lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))<br>+<br>         bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line."))<br><br>         self.runCmd("run", RUN_SUCCEEDED)<br><br>Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py?rev=248028&r1=248027&r2=248028&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py?rev=248028&r1=248027&r2=248028&view=diff</a><br>==============================================================================<br>--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py (original)<br>+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py Fri Sep 18 15:12:52 2015<br>@@ -34,6 +34,8 @@ class LibcxxMultiMapDataFormatterTestCas<br>     def data_formatter_commands(self):<br>         """Test that that file and class static variables display correctly."""<br>         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)<br>+<br>+        lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))<br><br>         bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line."))<br><br><br>Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py?rev=248028&r1=248027&r2=248028&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py?rev=248028&r1=248027&r2=248028&view=diff</a><br>==============================================================================<br>--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py (original)<br>+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py Fri Sep 18 15:12:52 2015<br>@@ -34,6 +34,8 @@ class LibcxxMultiSetDataFormatterTestCas<br>     def data_formatter_commands(self):<br>         """Test that that file and class static variables display correctly."""<br>         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)<br>+<br>+        lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))<br><br>         bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line."))<br><br><br>Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py?rev=248028&r1=248027&r2=248028&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py?rev=248028&r1=248027&r2=248028&view=diff</a><br>==============================================================================<br>--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py (original)<br>+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py Fri Sep 18 15:12:52 2015<br>@@ -34,6 +34,8 @@ class LibcxxSetDataFormatterTestCase(Tes<br>     def data_formatter_commands(self):<br>         """Test that that file and class static variables display correctly."""<br>         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)<br>+<br>+        lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))<br><br>         bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line."))<br><br><br>Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py?rev=248028&r1=248027&r2=248028&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py?rev=248028&r1=248027&r2=248028&view=diff</a><br>==============================================================================<br>--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py (original)<br>+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py Fri Sep 18 15:12:52 2015<br>@@ -38,6 +38,8 @@ class LibcxxStringDataFormatterTestCase(<br>         """Test that that file and class static variables display correctly."""<br>         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)<br><br>+        lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))<br>+<br>         lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1)<br><br>         self.runCmd("run", RUN_SUCCEEDED)<br><br>Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py?rev=248028&r1=248027&r2=248028&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py?rev=248028&r1=248027&r2=248028&view=diff</a><br>==============================================================================<br>--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py (original)<br>+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py Fri Sep 18 15:12:52 2015<br>@@ -39,6 +39,8 @@ class LibcxxUnorderedDataFormatterTestCa<br>         """Test that that file and class static variables display correctly."""<br>         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)<br><br>+        lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))<br>+<br>         lldbutil.run_break_set_by_source_regexp (self, "Set break point at this line.")<br><br>         self.runCmd("run", RUN_SUCCEEDED)<br><br>Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py?rev=248028&r1=248027&r2=248028&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py?rev=248028&r1=248027&r2=248028&view=diff</a><br>==============================================================================<br>--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py (original)<br>+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py Fri Sep 18 15:12:52 2015<br>@@ -37,6 +37,8 @@ class LibcxxVBoolDataFormatterTestCase(T<br>         """Test that that file and class static variables display correctly."""<br>         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)<br><br>+        lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))<br>+<br>         lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1)<br><br>         self.runCmd("run", RUN_SUCCEEDED)<br><br>Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py?rev=248028&r1=248027&r2=248028&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py?rev=248028&r1=248027&r2=248028&view=diff</a><br>==============================================================================<br>--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py (original)<br>+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py Fri Sep 18 15:12:52 2015<br>@@ -34,6 +34,8 @@ class LibcxxVectorDataFormatterTestCase(<br>     def data_formatter_commands(self):<br>         """Test that that file and class static variables display correctly."""<br>         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)<br>+<br>+        lldbutil.skip_if_library_missing(self, self.target(), lldbutil.PrintableRegex("libc\+\+"))<br><br>         bkpt = self.target().FindBreakpointByID(lldbutil.run_break_set_by_source_regexp (self, "break here"))<br><br><br>Modified: lldb/trunk/test/lldbutil.py<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbutil.py?rev=248028&r1=248027&r2=248028&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbutil.py?rev=248028&r1=248027&r2=248028&view=diff</a><br>==============================================================================<br>--- lldb/trunk/test/lldbutil.py (original)<br>+++ lldb/trunk/test/lldbutil.py Fri Sep 18 15:12:52 2015<br>@@ -7,6 +7,7 @@ They can also be useful for general purp<br> import lldb<br> import os, sys<br> import StringIO<br>+import re<br><br> # ===================================================<br> # Utilities for locating/checking executable programs<br>@@ -957,3 +958,38 @@ def get_signal_number(signal_name):<br>                 return signal_number<br>     # No remote platform; fall back to using local python signals.<br>     return getattr(signal, signal_name)<br>+<br>+class PrintableRegex(object):<br>+    def __init__(self, text):<br>+        self.regex = re.compile(text)<br>+        self.text = text<br>+<br>+    def match(self, str):<br>+        return self.regex.match(str)<br>+<br>+    def __str__(self):<br>+        return "%s" % (self.text)<br>+<br>+    def __repr__(self):<br>+        return "re.compile(%s) -> %s" % (self.text, self.regex)<br>+<br>+def skip_if_callable(test, callable, reason):<br>+    if callable(test) == True:<br>+        test.skipTest(reason)<br>+        return True<br>+    return False<br>+<br>+def skip_if_library_missing(test, target, library):<br>+    def find_library(target, library):<br>+        for module in target.modules:<br>+            filename = module.file.GetFilename()<br>+            if isinstance(library, str):<br>+                if library == filename:<br>+                    return False<br>+            elif hasattr(library, 'match'):<br>+                if library.match(filename):<br>+                    return False<br>+        return True<br>+    def find_library_callable(test):<br>+        return find_library(target, library)<br>+    return skip_if_callable(test, find_library_callable, "could not find library matching '%s' in target %s" % (library, target))<br><br><br>_______________________________________________<br>lldb-commits mailing list<br><a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br></blockquote></div></div></blockquote></div></div></div><br><div>
<div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br>Thanks,</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><i>- Enrico</i><br>📩 egranata@<font color="#ff2600"></font>.com ☎️ 27683</div>
</div>
<br></div></blockquote></div><br></div>