Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .ci/JSONCDecoder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# https://stackoverflow.com/a/72168909
import json
from typing import Any
class JSONCDecoder( json.JSONDecoder ):
def __init__( self, **kw ) :
super().__init__( **kw )

def decode( self, s : str ) -> Any :
# Sanitize the input string for leading // comments ONLY and replace with
# blank line so that line numbers are preserved
s = '\n'.join( l if not l.lstrip().startswith( "//" ) else "" for l in s.split( '\n' ) )
return super().decode( s )
18 changes: 9 additions & 9 deletions .ci/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from contextlib import redirect_stdout
from datetime import timedelta


import JSONCDecoder
import SubmitCommon as sc

from SubmitAction import SubmitAction
Expand Down Expand Up @@ -518,7 +518,7 @@ def runSuite( options ) :
with redirect_stdout( redirect ) :
testSuite = Suite(
basename,
json.load( fp ),
json.load( fp, cls=JSONCDecoder.JSONCDecoder ),
opts,
options,
parent=options.globalPrefix,
Expand All @@ -529,13 +529,13 @@ def runSuite( options ) :
# print( options.message )
else :
testSuite = Suite(
basename,
json.load( fp ),
opts,
options,
parent=options.globalPrefix,
rootDir=root
)
basename,
json.load( fp, cls=JSONCDecoder.JSONCDecoder ),
opts,
options,
parent=options.globalPrefix,
rootDir=root
)
success, logs = testSuite.run( options.tests )
# if success and options.message :
# print( options.message )
Expand Down
Loading