From d880526bd50aadcfcaa4a94adebf404be7a8ef1c Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 30 Oct 2024 11:02:36 -0700 Subject: [PATCH 1/2] Use the -E flag (preprocess only) in test_standalone_system_headers This test only checks header inclusion, so it doesn't need to link or even compile. This change makes this (still slow) test 5x faster. --- test/test_other.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_other.py b/test/test_other.py index 95d682a03be10..828d3b5e6fd2d 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -9365,12 +9365,12 @@ def test_standalone_system_headers(self): 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, '-Werror', '-Wall', '-pedantic', 'a.cxx', 'b.cxx', '-E'], stdout=subprocess.DEVNULL) 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', 'b.c', '-E'], stdout=subprocess.DEVNULL) @is_slow_test @parameterized({ From 9e665cb05746c446967fe050789c2cfc641a7899 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Wed, 30 Oct 2024 11:35:47 -0700 Subject: [PATCH 2/2] include each header only once --- test/test_other.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/test_other.py b/test/test_other.py index 828d3b5e6fd2d..6f43f25c1aa54 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -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) - create_file('b.cxx', inc) - self.run_process([EMXX, '-Werror', '-Wall', '-pedantic', 'a.cxx', 'b.cxx', '-E'], stdout=subprocess.DEVNULL) + 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', '-E'], stdout=subprocess.DEVNULL) + self.run_process([EMCC] + std + ['-Werror', '-Wall', '-pedantic', 'a.c', '-E', '-o', 'a.i']) @is_slow_test @parameterized({