LukasScheucher / include-what-you-use

Automatically exported from code.google.com/p/include-what-you-use
Other
0 stars 0 forks source link

Test badinc fails on mac @ r62 #22

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
On OSX 10.6.6, I get the following error when running test badinc at r62. Could 
you please confirm that it passes for you? If so, it is likely this is an 
osx/linux environment difference.

======================================================================
FAIL: runTest (__main__.badinc)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "run_iwyu_tests.py", line 85, in <lambda>
    {'runTest': lambda self, f=filename: self.RunOneTest(f)})
  File "run_iwyu_tests.py", line 67, in RunOneTest
    iwyu_flags, verbose=True)
  File "/Volumes/work/chromium/src/third_party/llvm-build/tools/clang/tools/include-what-you-use/iwyu_test_util.py", line 396, in TestIwyuOnRelativeFile
    test_case.assert_(not failures, ''.join(failures))
AssertionError: 
tests/badinc.cc:717: actual diagnostic doesn't match expectation.
Expected: regular expression "I1_Class is...*badinc-i1.h"
Actual: I1_Class needs a declaration, but does not provide or directly #include 
one.

tests/badinc.cc:720: expecting 1 diagnostics; actually had 0:

tests/badinc.cc:755: expecting 4 diagnostics; actually had 3:
I1_Class needs a declaration, but does not provide or directly #include one.
I1_TemplateClass is defined in "tests/badinc-i1.h", which isn't directly 
#included.
std::vector is defined in <vector>, which isn't directly #included.

tests/badinc.cc:824: expecting 3 diagnostics; actually had 2:
I1_Class needs a declaration, but does not provide or directly #include one.
I1_TypedefOnly_Class is defined in "tests/badinc-i1.h", which isn't directly 
#included.

tests/badinc.cc:829: expecting 4 diagnostics; actually had 3:
I1_Class needs a declaration, but does not provide or directly #include one.
I1_TypedefOnly_Class is defined in "tests/badinc-i1.h", which isn't directly 
#included.
I1_TypedefOnly_Class<I1_Class>::i is defined in "tests/badinc-i1.h", which 
isn't directly #included.

tests/badinc.cc:1013: expecting 1 diagnostics; actually had 0:

tests/badinc.cc:1071: actual diagnostic doesn't match expectation.
Expected: regular expression "size_t is...*<stddef.h>"
Actual: size_t is defined in <unistd.h>, which isn't directly #included.

tests/badinc.cc:1123: expecting 0 diagnostics; actually had 1:
errno is defined in <sys/errno.h>, which isn't directly #included.

tests/badinc.cc:1256: expecting 4 diagnostics; actually had 3:
I1_Class needs a declaration, but does not provide or directly #include one.
I1_TemplateMethodOnlyClass is defined in "tests/badinc-i1.h", which isn't 
directly #included.
I2_Class needs a declaration, but does not provide or directly #include one.

tests/badinc.cc:1915: expecting 4 diagnostics; actually had 3:
I1_Class needs a declaration, but does not provide or directly #include one.
I1_Struct needs a declaration, but does not provide or directly #include one.
I1_TemplateMethodOnlyClass is defined in "tests/badinc-i1.h", which isn't 
directly #included.

tests/badinc.h:136: expecting 0 diagnostics; actually had 1:
errno is defined in <sys/errno.h>, which isn't directly #included.

tests/badinc.h:298: expecting 4 diagnostics; actually had 3:
I2_Class is defined in "tests/badinc-i2.h", which isn't directly #included.
I2_Class needs a declaration, but does not provide or directly #include one.
std::vector is defined in <vector>, which isn't directly #included.

Unexpected summary diffs for tests/badinc.cc:
+++  
@@ -2,6 +2,7 @@
 #include <ctype.h>
 #include <stddef.h>
 #include <stdlib.h>
+#include <unistd.h>
 #include <list>
 #include <new>
 #include "tests/badinc-i1.h"
@@ -31,13 +32,14 @@
 #include "tests/badinc-inl.h"
 #include <ctype.h>  // for isascii
 #include <setjmp.h>
-#include <stddef.h>  // for offsetof, size_t
+#include <stddef.h>  // for offsetof
 #include <stdlib.h>  // for rand
+#include <unistd.h>  // for size_t
 #include <algorithm>  // for find
 #include <fstream>  // for fstream
 #include <list>  // for list
 #include <new>  // for operator new
-#include <string>  // for allocator, basic_string, char_traits, operator+, 
string
+#include <string>  // for allocator, basic_string, operator+, string
 #include <typeinfo>  // for type_info
 #include "tests/badinc-d1.h"  // for D1CopyClassFn, D1Function, D1_Class, D1_CopyClass, D1_Enum, D1_Enum::D11, D1_I1_Typedef, D1_StructPtr, D1_Subclass, D1_TemplateClass, D1_TemplateStructWithDefaultParam, MACRO_CALLING_I4_FUNCTION
 #include "tests/badinc-d4.h"  // for D4_ClassForOperator, operator<<

---

Unexpected summary diffs for tests/badinc.h:
+++  
@@ -1,5 +1,6 @@
 tests/badinc.h should add these lines:
 #include <stdio.h>
+#include <sys/errno.h>
 #include <set>
 #include <utility>
 #include <vector>
@@ -8,14 +9,15 @@

 tests/badinc.h should remove these lines:
 - #include <ctype.h>  // lines XX-XX
+- #include <errno.h>  // lines XX-XX
 - #include <math.h>  // lines XX-XX
 - #include "tests/badinc-d2.h"  // lines XX-XX
 - class H_ForwardDeclareClass;  // lines XX-XX
 - template <typename T> class I2_TypedefOnly_Class;  // lines XX-XX

 The full include-list for tests/badinc.h:
-#include <errno.h>  // for errno
 #include <stdio.h>  // for NULL, printf
+#include <sys/errno.h>  // for errno
 #include <queue>  // for queue
 #include <set>  // for set
 #include <string>  // for string

---

----------------------------------------------------------------------
Ran 18 tests in 2.849s

FAILED (failures=1)

Original issue reported on code.google.com by tonyg@chromium.org on 15 Mar 2011 at 6:09

GoogleCodeExporter commented 8 years ago
I am seeing an error with badinc in some cases (maybe all the time?, I think it 
depends what version of clang I'm synced to) with char_traits being removed 
from the include-list for <string>.  The other errors are new to me, though.

Some are clearly OS X specific:
-#include <errno.h>  // for errno
+#include <sys/errno.h>  // for errno

and size_t being in unistd.h and not stddef.h.  (That last one surprises me, 
actually.)

It looks like the rest of the warnings are there for me too:
---
tests/badinc.cc:717: actual diagnostic doesn't match expectation.
Expected: regular expression "I1_Class is...*badinc-i1.h"
Actual: I1_Class needs a declaration, but does not provide or directly #include 
one.

tests/badinc.cc:720: expecting 1 diagnostics; actually had 0:

tests/badinc.cc:755: expecting 4 diagnostics; actually had 3:
I1_Class needs a declaration, but does not provide or directly #include one.
I1_TemplateClass is defined in "tests/badinc-i1.h", which isn't directly 
#included.
std::vector is defined in <vector>, which isn't directly #included.

tests/badinc.cc:824: expecting 3 diagnostics; actually had 2:
I1_Class needs a declaration, but does not provide or directly #include one.
I1_TypedefOnly_Class is defined in "tests/badinc-i1.h", which isn't directly 
#included.

tests/badinc.cc:829: expecting 4 diagnostics; actually had 3:
I1_Class needs a declaration, but does not provide or directly #include one.
I1_TypedefOnly_Class is defined in "tests/badinc-i1.h", which isn't directly 
#included.
I1_TypedefOnly_Class<I1_Class>::i is defined in "tests/badinc-i1.h", which 
isn't directly #included.

tests/badinc.cc:1013: expecting 1 diagnostics; actually had 0:

tests/badinc.cc:1256: expecting 4 diagnostics; actually had 3:
I1_Class needs a declaration, but does not provide or directly #include one.
I1_TemplateMethodOnlyClass is defined in "tests/badinc-i1.h", which isn't 
directly #included.
I2_Class needs a declaration, but does not provide or directly #include one.

tests/badinc.cc:1915: expecting 4 diagnostics; actually had 3:
I1_Class needs a declaration, but does not provide or directly #include one.
I1_Struct needs a declaration, but does not provide or directly #include one.
I1_TemplateMethodOnlyClass is defined in "tests/badinc-i1.h", which isn't 
directly #included.

tests/badinc.h:298: expecting 4 diagnostics; actually had 3:
I2_Class is defined in "tests/badinc-i2.h", which isn't directly #included.
I2_Class needs a declaration, but does not provide or directly #include one.
std::vector is defined in <vector>, which isn't directly #included.
---

Perhaps a recent update to clang broke things somehow.  I'll take a look when I 
have a free moment.

Original comment by csilv...@gmail.com on 15 Mar 2011 at 7:25

GoogleCodeExporter commented 8 years ago
I just committed a whole slew of updates that were living in our local tree, 
and this fixed all the badinc problems on linux (at least on my linux).  So you 
can try again to isolate the OS X behavior.

Original comment by csilv...@gmail.com on 18 Mar 2011 at 7:11

GoogleCodeExporter commented 8 years ago
I haven't heard anything about this in a while, so I'm presuming it's fixed.  
Feel free to reopen if it's not.

Original comment by csilv...@gmail.com on 25 Oct 2011 at 12:12