Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -9364,13 +9364,11 @@ def test_standalone_system_headers(self):
inc = f'#include <{header}>\n__attribute__((weak)) int foo;\n'
if cxx_only:
create_file('a.cxx', inc)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does this test do the inclusion twice in 2 different files?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess so that we know the headers don't define global symbols (that would then cause link failures when two objects contain the same symbol). This change would obviously break that check, but I'm not sure how valuable it actually is.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right. In that case we can make the test even faster by including each file only once. Or just close this PR and keep the test as it is. I just noticed that the test was taking more than 300s and wondered why it was so slow.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be reasonable to skip the double compilation + linking.

It looks like this was originally added in c3c9b6e, but it does seems like maybe overkill.

create_file('b.cxx', inc)
self.run_process([EMXX, '-Werror', '-Wall', '-pedantic', 'a.cxx', 'b.cxx'])
self.run_process([EMXX, '-Werror', '-Wall', '-pedantic', 'a.cxx', '-E', '-o', 'a.i'])
else:
create_file('a.c', inc)
create_file('b.c', inc)
for std in ([], ['-std=c89']):
self.run_process([EMCC] + std + ['-Werror', '-Wall', '-pedantic', 'a.c', 'b.c'])
self.run_process([EMCC] + std + ['-Werror', '-Wall', '-pedantic', 'a.c', '-E', '-o', 'a.i'])

@is_slow_test
@parameterized({
Expand Down
Loading