Skip to content

Commit 367f355

Browse files
authored
[SYCL][E2E][NFC] Fix NameError if directive fails to parse (intel#16767)
Currently if a test contains a malformed directive, the following exception is raised along with the original parsing error: ```plaintext Exception during script execution: (original error) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "llvm/llvm/utils/lit/lit/worker.py", line 76, in _execute_test_handle_errors result = test.config.test_format.execute(test, lit_config) File "llvm/sycl/test-e2e/format.py", line 232, in execute script = self.parseTestScript(test) File "llvm/sycl/test-e2e/format.py", line 105, in parseTestScript return lit.Test.Result(Test.UNRESOLVED, str(e)) NameError: name 'Test' is not defined ``` The test ends up as UNRESOLVED either way, but fixing it is easy and improves the error message greatly.
1 parent 4f829bd commit 367f355

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sycl/test-e2e/format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def parseTestScript(self, test):
6161
require_script=True,
6262
)
6363
except ValueError as e:
64-
return lit.Test.Result(Test.UNRESOLVED, str(e))
64+
return lit.Test.Result(lit.Test.UNRESOLVED, str(e))
6565
script = parsed["RUN:"] or []
6666
assert parsed["DEFINE:"] == script
6767
assert parsed["REDEFINE:"] == script

0 commit comments

Comments
 (0)