Debian Codegraph @

llvm/utils/lit/tests/Inputs/discovery-getTestsForPath/custom_format.py

raw
1 import os
2 import lit.formats
3
4 class CustomFormat(lit.formats.ShTest):
5 def getTestsForPath(self, testSuite, path_in_suite, litConfig, localConfig):
6 for sub in ['one.test', 'two.test']:
7 basePath = os.path.dirname(testSuite.getExecPath(path_in_suite))
8 os.makedirs(basePath, exist_ok=True)
9 generatedFile = os.path.join(basePath, sub)
10 with open(generatedFile, 'w') as f:
11 f.write('RUN: true')
12 yield lit.Test.Test(testSuite, (generatedFile, ), localConfig)