From df1449879377b63cdf448f3fb2c9ae7ec5ae10d1 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 29 Mar 2023 10:21:20 -0700 Subject: [PATCH 1/5] Use `_` when ignoring part of a destructured tuple. We've done this elsewhere, so now it's consistent. --- tests/std/tests/Dev09_056375_locale_cleanup/custom_format.py | 2 +- tests/std/tests/Dev09_172666_tr1_tuple_odr/custom_format.py | 2 +- tests/std/tests/P0607R0_inline_variables/custom_format.py | 2 +- .../std/tests/P2465R3_standard_library_modules/custom_format.py | 2 +- .../tests/VSO_0000000_matching_npos_address/custom_format.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/std/tests/Dev09_056375_locale_cleanup/custom_format.py b/tests/std/tests/Dev09_056375_locale_cleanup/custom_format.py index 1792181ec4c..39f2c05c22e 100644 --- a/tests/std/tests/Dev09_056375_locale_cleanup/custom_format.py +++ b/tests/std/tests/Dev09_056375_locale_cleanup/custom_format.py @@ -11,7 +11,7 @@ def getBuildSteps(self, test, litConfig, shared): exeSource = test.getSourcePath() dllSource = os.path.join(os.path.dirname(exeSource), 'TestDll.cpp') - outputDir, outputBase = test.getTempPaths() + outputDir, _ = test.getTempPaths() dllOutput = os.path.join(outputDir, 'TestDll.DLL') cmd = [test.cxx, dllSource, *test.flags, *test.compileFlags, '/Fe' + dllOutput, diff --git a/tests/std/tests/Dev09_172666_tr1_tuple_odr/custom_format.py b/tests/std/tests/Dev09_172666_tr1_tuple_odr/custom_format.py index fa2efc4372f..910e2111fb6 100644 --- a/tests/std/tests/Dev09_172666_tr1_tuple_odr/custom_format.py +++ b/tests/std/tests/Dev09_172666_tr1_tuple_odr/custom_format.py @@ -12,7 +12,7 @@ def getBuildSteps(self, test, litConfig, shared): exeSource = test.getSourcePath() test2Source = os.path.join(os.path.dirname(exeSource), 'test2.cpp') - outputDir, outputBase = test.getTempPaths() + _, outputBase = test.getTempPaths() if TestType.COMPILE in test.testType: cmd = [test.cxx, '/c', exeSource, test2Source, *test.flags, *test.compileFlags] diff --git a/tests/std/tests/P0607R0_inline_variables/custom_format.py b/tests/std/tests/P0607R0_inline_variables/custom_format.py index fa2efc4372f..910e2111fb6 100644 --- a/tests/std/tests/P0607R0_inline_variables/custom_format.py +++ b/tests/std/tests/P0607R0_inline_variables/custom_format.py @@ -12,7 +12,7 @@ def getBuildSteps(self, test, litConfig, shared): exeSource = test.getSourcePath() test2Source = os.path.join(os.path.dirname(exeSource), 'test2.cpp') - outputDir, outputBase = test.getTempPaths() + _, outputBase = test.getTempPaths() if TestType.COMPILE in test.testType: cmd = [test.cxx, '/c', exeSource, test2Source, *test.flags, *test.compileFlags] diff --git a/tests/std/tests/P2465R3_standard_library_modules/custom_format.py b/tests/std/tests/P2465R3_standard_library_modules/custom_format.py index 3f5dbd3ef3c..54567eab7db 100644 --- a/tests/std/tests/P2465R3_standard_library_modules/custom_format.py +++ b/tests/std/tests/P2465R3_standard_library_modules/custom_format.py @@ -9,7 +9,7 @@ class CustomTestFormat(STLTestFormat): def getBuildSteps(self, test, litConfig, shared): - outputDir, outputBase = test.getTempPaths() + _, outputBase = test.getTempPaths() stdIxx = os.path.join(litConfig.cxx_modules, 'std.ixx') stdCompatIxx = os.path.join(litConfig.cxx_modules, 'std.compat.ixx') diff --git a/tests/std/tests/VSO_0000000_matching_npos_address/custom_format.py b/tests/std/tests/VSO_0000000_matching_npos_address/custom_format.py index fa2efc4372f..910e2111fb6 100644 --- a/tests/std/tests/VSO_0000000_matching_npos_address/custom_format.py +++ b/tests/std/tests/VSO_0000000_matching_npos_address/custom_format.py @@ -12,7 +12,7 @@ def getBuildSteps(self, test, litConfig, shared): exeSource = test.getSourcePath() test2Source = os.path.join(os.path.dirname(exeSource), 'test2.cpp') - outputDir, outputBase = test.getTempPaths() + _, outputBase = test.getTempPaths() if TestType.COMPILE in test.testType: cmd = [test.cxx, '/c', exeSource, test2Source, *test.flags, *test.compileFlags] From 9810b2e840087a8c7cef57bf86b8d0d788d97b62 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 29 Mar 2023 10:23:35 -0700 Subject: [PATCH 2/5] Drop unused imports. --- .../tests/VSO_0000000_any_calling_conventions/custom_format.py | 1 - tests/utils/stl/test/file_parsing.py | 3 +-- tests/utils/stl/test/format.py | 1 - tests/utils/stl/test/tests.py | 2 +- 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/std/tests/VSO_0000000_any_calling_conventions/custom_format.py b/tests/std/tests/VSO_0000000_any_calling_conventions/custom_format.py index 0f08a5e0183..d829adc921f 100644 --- a/tests/std/tests/VSO_0000000_any_calling_conventions/custom_format.py +++ b/tests/std/tests/VSO_0000000_any_calling_conventions/custom_format.py @@ -1,7 +1,6 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -import itertools import os from stl.test.format import STLTestFormat, TestStep diff --git a/tests/utils/stl/test/file_parsing.py b/tests/utils/stl/test/file_parsing.py index 9a1308b9d5a..7e5254b81f4 100644 --- a/tests/utils/stl/test/file_parsing.py +++ b/tests/utils/stl/test/file_parsing.py @@ -1,10 +1,9 @@ # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -from collections import namedtuple from dataclasses import dataclass, field from pathlib import Path -from typing import Dict, List, Optional, Set, Tuple, Union +from typing import Dict, List, Optional, Tuple, Union import itertools import os import re diff --git a/tests/utils/stl/test/format.py b/tests/utils/stl/test/format.py index f2ad078b47f..7a3c2304c23 100644 --- a/tests/utils/stl/test/format.py +++ b/tests/utils/stl/test/format.py @@ -10,7 +10,6 @@ from pathlib import Path from typing import Dict, List, Optional import copy -import errno import itertools import os import re diff --git a/tests/utils/stl/test/tests.py b/tests/utils/stl/test/tests.py index 5d10ae30386..fc0b0e2fafe 100644 --- a/tests/utils/stl/test/tests.py +++ b/tests/utils/stl/test/tests.py @@ -13,7 +13,7 @@ import os import shutil -from lit.Test import Result, SKIPPED, Test, UNRESOLVED, UNSUPPORTED +from lit.Test import Result, SKIPPED, Test, UNSUPPORTED from libcxx.test.dsl import Feature import lit From 51464fb8ae703c1561c1f33e230208490ea844dd Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 29 Mar 2023 10:24:14 -0700 Subject: [PATCH 3/5] Drop unused `filename` variable. --- tests/utils/stl/test/format.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/utils/stl/test/format.py b/tests/utils/stl/test/format.py index 7a3c2304c23..7de5471eda7 100644 --- a/tests/utils/stl/test/format.py +++ b/tests/utils/stl/test/format.py @@ -166,7 +166,6 @@ def getBuildSetupSteps(self, test, litConfig, shared): yield from [] def getBuildSteps(self, test, litConfig, shared): - filename = test.path_in_suite[-1] _, tmpBase = test.getTempPaths() shouldFail = TestType.FAIL in test.testType From 852366ab1e484d061c05622a97fb97a055913e2e Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 29 Mar 2023 10:24:37 -0700 Subject: [PATCH 4/5] Use `name` and `value` variables. --- tests/utils/stl/test/file_parsing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/utils/stl/test/file_parsing.py b/tests/utils/stl/test/file_parsing.py index 7e5254b81f4..5b086cc49af 100644 --- a/tests/utils/stl/test/file_parsing.py +++ b/tests/utils/stl/test/file_parsing.py @@ -59,7 +59,7 @@ def _parse_env_line(line: str) -> Optional[_TmpEnvEntry]: for env_match in _ENV_VAR_MULTI_ITEM_REGEX.finditer(line): name = env_match.group("name") value = env_match.group("value") - result.env[env_match.group("name")] = env_match.group("value") + result.env[name] = value return result From c48085521573ca118884a7e227a11997e5829983 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Wed, 29 Mar 2023 11:26:57 -0700 Subject: [PATCH 5/5] Non-Python: Detect 17.6 Preview 2 in `test_header_units_and_modules.hpp`. --- tests/std/include/test_header_units_and_modules.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/std/include/test_header_units_and_modules.hpp b/tests/std/include/test_header_units_and_modules.hpp index ebd07763d14..f439720a118 100644 --- a/tests/std/include/test_header_units_and_modules.hpp +++ b/tests/std/include/test_header_units_and_modules.hpp @@ -661,7 +661,7 @@ constexpr bool impl_test_source_location() { using namespace std; const auto sl = source_location::current(); assert(sl.line() == __LINE__ - 1); -#ifdef _MSVC_INTERNAL_TESTING // TRANSITION, VS 2022 17.6 Preview 2 +#if defined(_MSVC_INTERNAL_TESTING) || _MSC_FULL_VER >= 193632502 // TRANSITION, VS 2022 17.6 Preview 2 assert(sl.column() == 38); #else // ^^^ no workaround / workaround vvv assert(sl.column() == 1);