Skip to content

Commit 2422a38

Browse files
committed
tests: add an ability to ignore files.
Usually for the benefit of being compiled when imported.
1 parent d0e8430 commit 2422a38

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

tests-full/modules/ackermann.vpr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// compile: {vprc} {input} -o {input}.ll
2-
// assemble: {llc} {input}.ll -filetype=obj -relocation-model=pic
1+
// IGNORE: true
2+
// belongs to simple_import.vpr
33

44
module ackermann
55
{

tests-full/run

+10-3
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,16 @@ def parse_metadata(file_path):
6868
if match is None:
6969
break
7070

71+
if match.group(1) == 'IGNORE' and match.group(2) == 'true':
72+
return { 'ignored': True }
73+
7174
steps.append({ 'name': match.group(1), 'command': match.group(2) })
7275

7376

7477
if len(steps) == 0:
75-
return { 'failed': True, 'reason': 'no steps defined!' }
78+
return { 'ignored': False, 'failed': True, 'reason': 'no steps defined!' }
7679

77-
return { 'steps': steps, 'failed': False }
80+
return { 'ignored': False, 'steps': steps, 'failed': False }
7881

7982

8083
def test_file(file_path, test_dir):
@@ -89,11 +92,15 @@ def test_file(file_path, test_dir):
8992

9093
name = os.path.splitext(os.path.basename(file_path))[0]
9194

95+
test_info = parse_metadata(file_path)
96+
97+
if test_info['ignored']:
98+
return 0
99+
92100
if pt:
93101
print("##teamcity[testStarted name='%s' captureStandardOutput='true']" % name)
94102
print_if(ps, '-- Testing %s ' % os.path.relpath(file_path, test_dir), end = '', flush = True)
95103

96-
test_info = parse_metadata(file_path)
97104
if test_info['failed']:
98105
failed_tests.append(os.path.relpath(file_path, test_dir))
99106
print('\n%s%s-- Failed: %s:%s' % (bcolors.FAIL, bcolors.BOLD, os.path.relpath(file_path, test_dir), bcolors.ENDC))

0 commit comments

Comments
 (0)