Skip to content

Commit

Permalink
Improve test_standalone_system_headers. NFC (#22854)
Browse files Browse the repository at this point in the history
Include `compat` headers.

See #22850
  • Loading branch information
sbc100 authored Nov 5, 2024
1 parent f5b6c66 commit 6be9648
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions system/include/compat/xlocale.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#ifndef _COMPAT_XLOCALE_H_
#define _COMPAT_XLOCALE_H_

#define __NEED_locale_t
#include <bits/alltypes.h>

#include <locale.h>

#ifdef __cplusplus
Expand Down
11 changes: 7 additions & 4 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -9349,7 +9349,7 @@ def test_standalone_system_headers(self):
# everything it needs.
directories = {'': []}
for elem in os.listdir(path_from_root('system/include')):
if elem in ('compat', 'fakesdl'):
if elem == 'fakesdl':
continue
full = path_from_root('system/include', elem)
if os.path.isdir(full):
Expand All @@ -9373,19 +9373,22 @@ def test_standalone_system_headers(self):
cxx_only = header in [
'wire.h', 'val.h', 'bind.h',
'webgpu_cpp.h', 'webgpu_cpp_chained_struct.h', 'webgpu_enum_class_bitmasks.h',
# Some headers are not yet C compatible
'arm_neon.h', 'avxintrin.h', 'immintrin.h',
]
if directory:
if directory and directory != 'compat':
header = f'{directory}/{header}'
inc = f'#include <{header}>\n__attribute__((weak)) int foo;\n'
cflags = ['-Werror', '-Wall', '-pedantic', '-mavx', '-msimd128', '-msse3']
if cxx_only:
create_file('a.cxx', inc)
create_file('b.cxx', inc)
self.run_process([EMXX, '-Werror', '-Wall', '-pedantic', 'a.cxx', 'b.cxx'])
self.run_process([EMXX, '-msse3', 'a.cxx', 'b.cxx'] + cflags)
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, 'a.c', 'b.c'] + std + cflags)

@is_slow_test
@parameterized({
Expand Down

0 comments on commit 6be9648

Please sign in to comment.