Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python cleanups #3598

Merged
merged 5 commits into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion tests/std/include/test_header_units_and_modules.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
5 changes: 2 additions & 3 deletions tests/utils/stl/test/file_parsing.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -60,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


Expand Down
2 changes: 0 additions & 2 deletions tests/utils/stl/test/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from pathlib import Path
from typing import Dict, List, Optional
import copy
import errno
import itertools
import os
import re
Expand Down Expand Up @@ -167,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
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/stl/test/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down