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

Fix lit test cfg on windows. #39

Merged
merged 1 commit into from
Feb 24, 2024
Merged

Fix lit test cfg on windows. #39

merged 1 commit into from
Feb 24, 2024

Conversation

jagt
Copy link
Contributor

@jagt jagt commented Feb 24, 2024

Greetings! I'm following along your tutorial and noticed this that the test isn't working.

Without this str() the test would fail with a stacktrace like this:

D:\DevLLVM\repos\mlir-tutorial\tests>lit -v .\ctlz_simple.mlir
-- Testing: 1 tests, 1 workers --
UNRESOLVED: mlir_tutorial :: ctlz_simple.mlir (1 of 1)
******************** TEST 'mlir_tutorial :: ctlz_simple.mlir' FAILED ********************
Exception during script execution:
Traceback (most recent call last):
  File "C:\Wares\python310\lib\site-packages\lit\worker.py", line 76, in _execute_test_handle_errors
    result = test.config.test_format.execute(test, lit_config)
  File "C:\Wares\python310\lib\site-packages\lit\formats\shtest.py", line 29, in execute
    return lit.TestRunner.executeShTest(
  File "C:\Wares\python310\lib\site-packages\lit\TestRunner.py", line 2120, in executeShTest
    script = applySubstitutions(
  File "C:\Wares\python310\lib\site-packages\lit\TestRunner.py", line 1674, in applySubstitutions
    output.append(unescapePercents(process(line)))
  File "C:\Wares\python310\lib\site-packages\lit\TestRunner.py", line 1631, in processLine
    b = b.replace("\\", "\\\\")
TypeError: Path.replace() takes 2 positional arguments but 3 were given


********************
********************
Unresolved Tests (1):
  mlir_tutorial :: ctlz_simple.mlir


Testing Time: 0.16s
  Unresolved: 1

I'm only running on windows with CMake though. Not sure if this is breaking other platforms.
Cheers!

Without this `str()` the test would fail with a stacktrace like this:

```shell
D:\DevLLVM\repos\mlir-tutorial\tests>lit -v .\ctlz_simple.mlir
-- Testing: 1 tests, 1 workers --
UNRESOLVED: mlir_tutorial :: ctlz_simple.mlir (1 of 1)
******************** TEST 'mlir_tutorial :: ctlz_simple.mlir' FAILED ********************
Exception during script execution:
Traceback (most recent call last):
  File "C:\Wares\python310\lib\site-packages\lit\worker.py", line 76, in _execute_test_handle_errors
    result = test.config.test_format.execute(test, lit_config)
  File "C:\Wares\python310\lib\site-packages\lit\formats\shtest.py", line 29, in execute
    return lit.TestRunner.executeShTest(
  File "C:\Wares\python310\lib\site-packages\lit\TestRunner.py", line 2120, in executeShTest
    script = applySubstitutions(
  File "C:\Wares\python310\lib\site-packages\lit\TestRunner.py", line 1674, in applySubstitutions
    output.append(unescapePercents(process(line)))
  File "C:\Wares\python310\lib\site-packages\lit\TestRunner.py", line 1631, in processLine
    b = b.replace("\\", "\\\\")
TypeError: Path.replace() takes 2 positional arguments but 3 were given


********************
********************
Unresolved Tests (1):
  mlir_tutorial :: ctlz_simple.mlir


Testing Time: 0.16s
  Unresolved: 1
```
@j2kun
Copy link
Owner

j2kun commented Feb 24, 2024

Hey, thanks for the contribution!

@j2kun j2kun merged commit 02ea1c2 into j2kun:main Feb 24, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants