-
Notifications
You must be signed in to change notification settings - Fork 274
Deactivate broken tests that depend on assert on MacOS. #5541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
regression/ansi-c/CMakeLists.txt
Outdated
) | ||
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") | ||
add_test_pl_tests( | ||
"$<TARGET_FILE:goto-cc>" -X mac-frontend-broken |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes need to go in the Makefile too
‘mac-frontend-broken’ is a bad name. What’s broken about the frontend? Which frontend are we even talking about? In fact this is basically a lie, the C++ frontend on mac isn’t more broken than anywhere else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit concerned by this. assert.h
is a C header and should not be including C++. The C++ header should be cassert
. If assert.h
doesn't work on Mac then I doubt the tool will be usable at all on Mac. Are you sure about this? If it is really a problem with assert.h
it should break hundreds of regression tests, not just three.
Codecov Report
@@ Coverage Diff @@
## develop #5541 +/- ##
========================================
Coverage 68.52% 68.52%
========================================
Files 1187 1187
Lines 98265 98265
========================================
Hits 67339 67339
Misses 30926 30926
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
@martin-cs Basically what’s happening is that
A lot of standard libraries just have their here’s the full text of my cassert header for instance:
and handle all the language differing logic (if any) there ( |
OK... but then why are these tests, in |
Also, while I am at it, @NlightNFotis the code coverage is broken. I remember commenting on this when you were changing the CI infrastructure and you said it was temporary and would go away. It hasn't. Please can you fix it? |
The reason seems to be related to something @tautschnig did in 2019, apparently the idea was that these tests should also pass if the C++ frontend is used to compile them. I think perhaps a better way would be to move them over to the C++ frontend tests, please note that this is currently blocking our CI (and thus everything) though. The correct solution here is going to involve disabling these tests on macOS or deleting them (for C++, not for C!) though, as the reason they’re broken is not a regression – it’s just that the C++ frontend is flaky. |
They are not C++ tests! Have a look at them! The correct fix is to work out why they are being compiled as C++ and have them compiled as C instead. |
They are compiled as C++ because they are tagged as "this should be compiled with C++". Take a look at 723620d Basically what this commit did was it changed the C tests so they would be tested with both the C and the C++ frontend, the idea being that most C tests should also work for a C++ frontend. Whether or not that’s a good idea is neither here nor there, but that’s what’s causing the issue we have right now. |
This raises more questions than it answers...
If |
My understanding is that these tests are run as both C and C++ tests. They are C tests which are also used to check the C++ front-end's compatibility with C code. The problem is that the latest Mac versions of |
@thomasspriggs Thanks. Do you know why this is not affecting other C++ tests, like the ones in |
I’ve not looked at all of the other tests for which C++ testing is enabled but none of the ones I looked at that aren’t disabled by this PR include
Now that’s an excellent question. For the most part it seems the C++ tests also don’t use assertions, but it’s possible the ansi-c tests (C++ version) are somehow treated slightly differently than the C++ proper tests. |
On Mon, 2020-11-02 at 08:41 -0800, hannes-steffenhagen-diffblue wrote:
> Why is it only these three that cause issues? Why not the others?
I’ve not looked at _all_ of the other tests for which C++ testing is
enabled but none of the ones I looked at that aren’t disabled by this
PR include `assert.h`.
Right; that seems like a good answer.
> Why are the rest of the C++ tests passing on Mac?
Now that’s an excellent question. For the most part it seems the C++
tests also don’t use assertions, but it’s possible the ansi-c tests
(C++ version) are somehow treated slightly differently than the C++
proper tests.
Many don't but enough do to make this concerning.
$ find ../regression/ -name '*.cpp' -print | wc -l
405
$ find ../regression/ -name '*.cpp' -exec grep '<assert.h>' {} \; | wc
-l
11
$ find ../regression/ -name '*.cpp' -exec grep '<cassert>' {} \; | wc
-l
49
I don't get why these don't break as well?
../regression/cbmc-cpp/MethodParam1/main.cpp
#include <assert.h>
assert(x<4);
assert(x<5);
../regression/cbmc-cpp/lvalue1/main.cpp
#include <cassert>
assert(a == ASD);
assert(a == ABC);
|
One thing to note here is that you are right @martin-cs, more tests are broken than the ones excluded here. I'm in the process of excluding them as well. |
2247dcb
to
caf24ec
Compare
Right, so now there should be a lot more tests excluded, which should paint a more accurate picture of what was broken. There might be one or two missing, but I'm waiting CI to see what's being reported and fix it later. |
caf24ec
to
711530a
Compare
711530a
to
30888f2
Compare
Thanks @NlightNFotis this is starting to look like something that will actually fix the problem. One more thing; please could you add a comment, to the Makefiles or to the test cases, explaining what is broken and why. |
regression/ansi-c/Makefile
Outdated
endif | ||
|
||
tests.log: ../test.pl | ||
@../test.pl -e -p -c $(exe) | ||
@../test.pl -e -p -c $(exe) $(exclude_mac_broken_tests) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 Likewise, I thought that the C tests were still fine on mac?
2e3aa6b
to
b4b47cd
Compare
The reason we are deactivating the tests is that there was a change to the `assert.h` header under MacOS that makes it now include some other C++ headers which include `type_traits` causing template errors that have broken CI under that platform.
b4b47cd
to
7a8c427
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems more consistent and understandable. Thanks for the discussion and extra work on sorting this out, I think it has really improved it.
The reason we are deactivating the tests is that there
was a change to the
assert.h
header under MacOS thatmakes it now include some other C++ headers which include
type_traits
causing template errors that have brokenCI under that platform.