16.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit ed1dd638 authored by di68kap's avatar di68kap
Browse files

- json: tst-script

parent 59844e1a
......@@ -540,6 +540,7 @@ def grammar_suite(directory, parser_factory, transformer_factory,
with concurrent.futures.ProcessPoolExecutor(multiprocessing.cpu_count()) as pool:
results = []
for filename in sorted(os.listdir('.')):
print(filename)
if any(fnmatch.fnmatch(filename, pattern) for pattern in fn_patterns):
parameters = filename, parser_factory, transformer_factory, report, verbose
results.append((filename, pool.submit(run_unit, log_dir(), *parameters)))
......
......@@ -12,7 +12,7 @@ from functools import partial
import os
import sys
sys.path.append(r'/home/eckhart/Entwicklung/DHParser')
sys.path.extend(['../../', '../', './'])
try:
import regex as re
......
......@@ -11,10 +11,8 @@ import collections
from functools import partial
import os
import sys
sys.path.extend(['../../', '../', './'])
sys.path.append(r'/home/eckhart/Entwicklung/DHParser')
sys.path.extend(['../../', '../', './'])
try:
import regex as re
......
......@@ -12,7 +12,7 @@ from functools import partial
import os
import sys
sys.path.append(r'/home/eckhart/Entwicklung/DHParser')
sys.path.extend(['../../', '../', './'])
try:
import regex as re
......
......@@ -12,7 +12,6 @@ from functools import partial
import os
import sys
sys.path.extend(['../', '../../'])
try:
......
......@@ -12,7 +12,7 @@ from functools import partial
import os
import sys
sys.path.append(r'/home/eckhart/Entwicklung/DHParser')
sys.path.extend(['../../', '../', './'])
try:
import regex as re
......
......@@ -8,15 +8,15 @@ import sys
LOGGING = False
sys.path.append(r'/home/eckhart/Entwicklung/DHParser')
sys.path.extend(['.', '../..'])
scriptpath = os.path.dirname(__file__)
try:
from DHParser import dsl
import DHParser.log
from DHParser import testing
from DHParser.toolkit import set_config_value
except ModuleNotFoundError:
print('Could not import DHParser. Please adjust sys.path in file '
'"%s" manually' % __file__)
......@@ -37,7 +37,7 @@ def recompile_grammar(grammar_src, force):
sys.exit(1)
def run_grammar_tests(glob_pattern):
def run_grammar_tests(glob_pattern, get_grammar, get_transformer):
with DHParser.log.logging(LOGGING):
error_report = testing.grammar_suite(
os.path.join(scriptpath, 'grammar_tests'),
......@@ -66,7 +66,8 @@ if __name__ == '__main__':
force=False)
sys.path.append('.')
from jsonCompiler import get_grammar, get_transformer
error_report = run_grammar_tests(glob_pattern=arg)
# set_config_value('test_parallelization', False)
error_report = run_grammar_tests(arg, get_grammar, get_transformer)
if error_report:
print('\n')
print(error_report)
......
......@@ -155,7 +155,7 @@ def recompile_grammar(grammar_src, force):
sys.exit(1)
def run_grammar_tests(glob_pattern):
def run_grammar_tests(glob_pattern, get_grammar, get_transformer):
with DHParser.log.logging(LOGGING):
error_report = testing.grammar_suite(
os.path.join(scriptpath, 'grammar_tests'),
......@@ -184,7 +184,7 @@ if __name__ == '__main__':
force=False)
sys.path.append('.')
from {name}Compiler import get_grammar, get_transformer
error_report = run_grammar_tests(glob_pattern=arg)
error_report = run_grammar_tests(arg, get_grammar, get_transformer)
if error_report:
print('\n')
print(error_report)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment