Skip to content

Commit 54a4c36

Browse files
authored
testing: clean up some filecheck tests (#4050)
These raised errors when removing the `cd ../..` preamble in the lit.cfg. (See #3953)
1 parent e294346 commit 54a4c36

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

tests/filecheck/backend/csl/gaussian-end-to-end.mlir

Whitespace-only changes.

tests/filecheck/dialects/irdl/cmath_irdl_loading.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# RUN: python %s | filecheck %s
22

3+
from pathlib import Path
4+
35
from xdsl.context import Context
46
from xdsl.dialects import get_all_dialects
57
from xdsl.dialects.irdl.irdl import DialectOp
@@ -19,7 +21,9 @@
1921
ctx.register_dialect(n, f)
2022

2123
# Open the IRDL description of cmath, parse it
22-
f = open("tests/filecheck/dialects/irdl/cmath.irdl.mlir")
24+
25+
file_path = Path(__file__).parent / "cmath.irdl.mlir"
26+
f = file_path.open()
2327
parser = Parser(ctx, f.read())
2428
module = parser.parse_module()
2529

@@ -32,7 +36,7 @@
3236
ctx.register_dialect("cmath", lambda: dialect)
3337

3438
# Roundtrip a cmath file!
35-
f = open("tests/filecheck/dialects/cmath/cmath_ops.mlir")
39+
f = (Path(__file__).parent.parent / "cmath" / "cmath_ops.mlir").open()
3640
parser = Parser(ctx, f.read())
3741
module = parser.parse_module()
3842
module.verify()

tests/filecheck/dialects/irdl/cmath_irdl_stub.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# RUN: python %s | filecheck %s
2+
from pathlib import Path
23

34
from xdsl.context import Context
45
from xdsl.dialects import get_all_dialects
@@ -20,7 +21,7 @@
2021
ctx.register_dialect(n, f)
2122

2223
# Open the IRDL description of cmath, parse it
23-
f = open("tests/filecheck/dialects/irdl/cmath.irdl.mlir")
24+
f = (Path(__file__).parent / "cmath.irdl.mlir").open()
2425
parser = Parser(ctx, f.read())
2526
module = parser.parse_module()
2627

tests/filecheck/transforms/apply-pdl/extra_file.mlir

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// RUN: true
2+
3+
// Support file for apply_pdl_extra_file.mlir
4+
15
pdl.pattern : benefit(1) {
26
%zero_attr = pdl.attribute = 0
37
%root = pdl.operation "test.op" {"attr" = %zero_attr}

0 commit comments

Comments
 (0)