From 1d5a436856e86381dfd06dd0bd93628c27c45824 Mon Sep 17 00:00:00 2001 From: Luke Drummond Date: Wed, 31 Jul 2024 18:37:53 +0100 Subject: [PATCH 1/6] Make testsuite respect SYCL_LIB_DUMPS_ONLY Running the check-sycl-dumps target sets the SYCL_LIB_DUMPS_ONLY param for lit which should only enable the ABI dump tests. However, since 1fde65647ebae9 we've added a non `lit.formats.ShTest()` which doesn't respect config.suffixes, so we need to account for this. --- sycl/test/lit.cfg.py | 6 ++-- .../test/self-contained-headers/lit.local.cfg | 30 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/sycl/test/lit.cfg.py b/sycl/test/lit.cfg.py index ff955fa1f269e..32e8f59e4b876 100644 --- a/sycl/test/lit.cfg.py +++ b/sycl/test/lit.cfg.py @@ -23,8 +23,8 @@ config.test_format = lit.formats.ShTest() # suffixes: A list of file extensions to treat as test files. -dump_only_tests = bool(lit_config.params.get("SYCL_LIB_DUMPS_ONLY", False)) -if dump_only_tests: +config.dump_only_tests = bool(lit_config.params.get("SYCL_LIB_DUMPS_ONLY", False)) +if config.dump_only_tests: config.suffixes = [".dump"] # Only run dump testing else: config.suffixes = [ @@ -186,7 +186,7 @@ ) # Dump-only tests do not have clang available -if not dump_only_tests: +if not config.dump_only_tests: llvm_config.use_clang(additional_flags=additional_flags) # Set timeout for test = 10 mins diff --git a/sycl/test/self-contained-headers/lit.local.cfg b/sycl/test/self-contained-headers/lit.local.cfg index d61551742dd85..f16672de9b9df 100644 --- a/sycl/test/self-contained-headers/lit.local.cfg +++ b/sycl/test/self-contained-headers/lit.local.cfg @@ -1,16 +1,16 @@ -import os -from format import SYCLHeadersTest +if not config.dump_only_tests: + import os + from format import SYCLHeadersTest + config.test_format = SYCLHeadersTest() -config.test_format = SYCLHeadersTest() - -# List of files that are not expected to compile cleanly when used -# standalone. `os.path.join` is required here so the filtering works -# cross-platform -config.sycl_headers_xfail = [ - os.path.join( - "sycl", "ext", "oneapi", "experimental", "backend", "cuda.hpp" - ), - os.path.join( - "sycl", "ext", "intel", "esimd", "detail", "types_elementary.hpp" - ), -] + # List of files that are not expected to compile cleanly when used + # standalone. `os.path.join` is required here so the filtering works + # cross-platform + config.sycl_headers_xfail = [ + os.path.join( + "sycl", "ext", "oneapi", "experimental", "backend", "cuda.hpp" + ), + os.path.join( + "sycl", "ext", "intel", "esimd", "detail", "types_elementary.hpp" + ), + ] From c20a242cd6b899a809f8368924c7e3cbdfd80346 Mon Sep 17 00:00:00 2001 From: Luke Drummond Date: Thu, 1 Aug 2024 11:26:35 +0100 Subject: [PATCH 2/6] fixup! Make testsuite respect SYCL_LIB_DUMPS_ONLY --- sycl/test/format.py | 2 ++ sycl/test/lit.cfg.py | 6 ++-- .../test/self-contained-headers/lit.local.cfg | 30 +++++++++---------- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/sycl/test/format.py b/sycl/test/format.py index 19d16a263426c..b64f418442226 100644 --- a/sycl/test/format.py +++ b/sycl/test/format.py @@ -23,6 +23,8 @@ def getTestsInDirectory(self, testSuite, path_in_suite, litConfig, localConfig): for filename in filenames: if not filename.endswith(".hpp"): continue + if os.path.splitext(filename)[1] not in litConfig.suffixes: + continue filepath = os.path.join(dirpath, filename) if headers_filter is not None: diff --git a/sycl/test/lit.cfg.py b/sycl/test/lit.cfg.py index 32e8f59e4b876..ff955fa1f269e 100644 --- a/sycl/test/lit.cfg.py +++ b/sycl/test/lit.cfg.py @@ -23,8 +23,8 @@ config.test_format = lit.formats.ShTest() # suffixes: A list of file extensions to treat as test files. -config.dump_only_tests = bool(lit_config.params.get("SYCL_LIB_DUMPS_ONLY", False)) -if config.dump_only_tests: +dump_only_tests = bool(lit_config.params.get("SYCL_LIB_DUMPS_ONLY", False)) +if dump_only_tests: config.suffixes = [".dump"] # Only run dump testing else: config.suffixes = [ @@ -186,7 +186,7 @@ ) # Dump-only tests do not have clang available -if not config.dump_only_tests: +if not dump_only_tests: llvm_config.use_clang(additional_flags=additional_flags) # Set timeout for test = 10 mins diff --git a/sycl/test/self-contained-headers/lit.local.cfg b/sycl/test/self-contained-headers/lit.local.cfg index f16672de9b9df..d61551742dd85 100644 --- a/sycl/test/self-contained-headers/lit.local.cfg +++ b/sycl/test/self-contained-headers/lit.local.cfg @@ -1,16 +1,16 @@ -if not config.dump_only_tests: - import os - from format import SYCLHeadersTest - config.test_format = SYCLHeadersTest() +import os +from format import SYCLHeadersTest - # List of files that are not expected to compile cleanly when used - # standalone. `os.path.join` is required here so the filtering works - # cross-platform - config.sycl_headers_xfail = [ - os.path.join( - "sycl", "ext", "oneapi", "experimental", "backend", "cuda.hpp" - ), - os.path.join( - "sycl", "ext", "intel", "esimd", "detail", "types_elementary.hpp" - ), - ] +config.test_format = SYCLHeadersTest() + +# List of files that are not expected to compile cleanly when used +# standalone. `os.path.join` is required here so the filtering works +# cross-platform +config.sycl_headers_xfail = [ + os.path.join( + "sycl", "ext", "oneapi", "experimental", "backend", "cuda.hpp" + ), + os.path.join( + "sycl", "ext", "intel", "esimd", "detail", "types_elementary.hpp" + ), +] From 045472721f93c6181496e2ea649a6f9f0b96e718 Mon Sep 17 00:00:00 2001 From: Luke Drummond Date: Thu, 1 Aug 2024 12:31:52 +0100 Subject: [PATCH 3/6] fixup! Make testsuite respect SYCL_LIB_DUMPS_ONLY --- sycl/test/format.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sycl/test/format.py b/sycl/test/format.py index b64f418442226..c1c9ca145cbf8 100644 --- a/sycl/test/format.py +++ b/sycl/test/format.py @@ -5,6 +5,8 @@ import os import re +SUFFIXES = {'.hpp'} + class SYCLHeadersTest(lit.formats.TestFormat): def getTestsForPath( @@ -21,9 +23,8 @@ def getTestsInDirectory(self, testSuite, path_in_suite, litConfig, localConfig): for dirpath, _, filenames in os.walk(source_path): relative_dirpath = dirpath[len(localConfig.sycl_include) + 1 :] for filename in filenames: - if not filename.endswith(".hpp"): - continue - if os.path.splitext(filename)[1] not in litConfig.suffixes: + suffix = os.path.splitext(filename)[1] + if suffix not in SUFFIXES or suffix not in litConfig.suffixes: continue filepath = os.path.join(dirpath, filename) From 564048c482287824f76e8da69a1c27c4f15fac79 Mon Sep 17 00:00:00 2001 From: Luke Drummond Date: Thu, 1 Aug 2024 13:47:27 +0100 Subject: [PATCH 4/6] fixup! Make testsuite respect SYCL_LIB_DUMPS_ONLY --- sycl/test/format.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test/format.py b/sycl/test/format.py index c1c9ca145cbf8..eb3a497ecd004 100644 --- a/sycl/test/format.py +++ b/sycl/test/format.py @@ -5,7 +5,7 @@ import os import re -SUFFIXES = {'.hpp'} +SUFFIXES = {".hpp"} class SYCLHeadersTest(lit.formats.TestFormat): From db859fb1717e2dd784e7f8b053b7e6842947b341 Mon Sep 17 00:00:00 2001 From: ldrumm Date: Thu, 22 Aug 2024 12:01:41 +0100 Subject: [PATCH 5/6] Fix quoting for python black --- sycl/test/format.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test/format.py b/sycl/test/format.py index eb3a497ecd004..c1c9ca145cbf8 100644 --- a/sycl/test/format.py +++ b/sycl/test/format.py @@ -5,7 +5,7 @@ import os import re -SUFFIXES = {".hpp"} +SUFFIXES = {'.hpp'} class SYCLHeadersTest(lit.formats.TestFormat): From 1a5a09ae1760fad45b1695786ea58e317c86c58c Mon Sep 17 00:00:00 2001 From: ldrumm Date: Thu, 22 Aug 2024 15:12:36 +0100 Subject: [PATCH 6/6] Update format.py --- sycl/test/format.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test/format.py b/sycl/test/format.py index c1c9ca145cbf8..eb3a497ecd004 100644 --- a/sycl/test/format.py +++ b/sycl/test/format.py @@ -5,7 +5,7 @@ import os import re -SUFFIXES = {'.hpp'} +SUFFIXES = {".hpp"} class SYCLHeadersTest(lit.formats.TestFormat):