Skip to content

Commit

Permalink
[test-suite] Register result codes with lit.
Browse files Browse the repository at this point in the history
lit currently only has a hard-coded set of result codes and crashes
when encountering test-suite's NOEXE result code. D78164 adds the
possibility to register custom result codes.

This patch registers the result code NOEXE and renames SKIPPED to
NOCHANGE since lit already has a SKIPPED result code.

While this does not fix any buildbot (such as
http://lab.llvm.org:8011/builders/clang-native-arm-lnt-perf), it at
least should allow lit to display which tests have failed at the end.

Reviewed By: yln, jdoerfert

Differential Revision: https://reviews.llvm.org/D79064
  • Loading branch information
Meinersbur committed May 13, 2020
1 parent 3390417 commit 2c8cbce
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion litsupport-tests/hash/check/lit.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
CHECK-DAG: SKIPPED: test-suite :: tests/skip.test
CHECK-DAG: NOCHANGE: test-suite :: tests/unchanged.test
CHECK-DAG: PASS: test-suite :: tests/normal.test
CHECK: Expected Passes
2 changes: 1 addition & 1 deletion litsupport-tests/hash/previous.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"metrics": {
"hash": "5dbd958d0108aca7182edcc98225739b"
},
"name": "test-suite :: tests/skip.test",
"name": "test-suite :: tests/nochange.test",
"output": "\ntests/foo.sh"
}
]
Expand Down
File renamed without changes.
8 changes: 5 additions & 3 deletions litsupport/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
import os


SKIPPED = lit.Test.ResultCode('SKIPPED', False)
NOEXE = lit.Test.ResultCode('NOEXE', True)
NOCHANGE = lit.Test.ResultCode('NOCHANGE', False)
lit.main.add_result_category(NOCHANGE, "Executable Unchanged")

NOEXE = lit.Test.ResultCode('NOEXE', True)
lit.main.add_result_category(NOEXE, "Executable Missing")

class TestSuiteTest(lit.formats.ShTest):
def __init__(self):
Expand Down Expand Up @@ -46,7 +48,7 @@ def execute(self, test, litConfig):
litsupport.modules.hash.compute(context)
if litsupport.modules.hash.same_as_previous(context):
result = lit.Test.Result(
SKIPPED, 'Executable identical to previous run')
NOCHANGE, 'Executable identical to previous run')
val = lit.Test.toMetricValue(context.executable_hash)
result.addMetric('hash', val)
return result
Expand Down

0 comments on commit 2c8cbce

Please sign in to comment.