Skip to content

Commit e24dc1c

Browse files
author
Mordan Vitalii
committed
Move MEA lib to CV
1 parent 4fd8c4c commit e24dc1c

File tree

7 files changed

+1807
-17
lines changed

7 files changed

+1807
-17
lines changed

scripts/components/mea.py

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,15 @@
2626
import json
2727
import logging
2828
import multiprocessing
29-
import operator
30-
import re
3129
import resource
3230
import time
3331
import zipfile
3432

35-
# noinspection PyUnresolvedReferences
36-
from aux.mea import DEFAULT_CONVERSION_FUNCTION, CONVERSION_FUNCTION_MODEL_FUNCTIONS, \
37-
CONVERSION_FUNCTION_CALL_TREE, CONVERSION_FUNCTION_NOTES, convert_error_trace, \
38-
compare_error_traces, is_equivalent, DEFAULT_COMPARISON_FUNCTION, \
39-
DEFAULT_SIMILARITY_THRESHOLD, TAG_COMPARISON_FUNCTION, TAG_CONVERSION_FUNCTION, \
40-
TAG_ADDITIONAL_MODEL_FUNCTIONS, CONVERSION_FUNCTION_FULL
41-
4233
from aux.common import *
4334
from components import *
4435
from components.component import Component
36+
from mea.core import *
37+
from mea.et import import_error_trace
4538

4639
ERROR_TRACE_FILE = "error trace.json"
4740
CONVERTED_ERROR_TRACES = "converted error traces.json"
@@ -86,7 +79,6 @@ def __init__(self, general_config: dict, error_traces: list, install_dir: str, r
8679
os.makedirs(self.result_dir, exist_ok=True)
8780
else:
8881
self.result_dir = None
89-
self.__export_et_parser_lib()
9082
self.rule = rule
9183

9284
# List of files with error traces.
@@ -323,6 +315,7 @@ def __print_trace_archive(self, error_trace_file_name: str, witness_type=WITNESS
323315
'reports',
324316
)
325317
django.setup()
318+
self.__export_et_parser_lib()
326319
# noinspection PyUnresolvedReferences
327320
from reports.etv import convert_json_trace_to_html
328321
with open(json_trace_name, encoding="utf8") as trace_file:
@@ -348,11 +341,8 @@ def __process_parsed_trace(parsed_error_trace: dict):
348341
parsed_error_trace['files'] = src_files
349342

350343
def __parse_trace(self, error_trace_file: str, supported_types: set) -> dict:
351-
# noinspection PyUnresolvedReferences
352-
from core.vrp.et import import_error_trace
353-
354344
# Those messages are waste of space.
355-
logger = self._create_logger(
345+
logger = Component._create_logger(
356346
"Witness processor", logging.WARNING if self.debug else logging.ERROR
357347
)
358348
try:
@@ -429,9 +419,6 @@ def __get_option_for_rule(self, tag: str, default_value):
429419
return self.component_config.get(self.rule, {}).get(tag, default)
430420

431421
def __export_et_parser_lib(self):
432-
et_parser_lib = self.get_tool_path(self._get_tool_default_path(ET_LIB),
433-
self.config.get(TAG_TOOLS, {}).get(ET_LIB))
434-
sys.path.append(et_parser_lib)
435422
et_html_lib = self.get_tool_path(self._get_tool_default_path(ET_HTML_LIB),
436423
self.config.get(TAG_TOOLS, {}).get(ET_HTML_LIB))
437424
sys.path.append(et_html_lib)

scripts/mea/__init__.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#
2+
# CV is a framework for continuous verification.
3+
#
4+
# Copyright (c) 2018-2023 ISP RAS (http://www.ispras.ru)
5+
# Ivannikov Institute for System Programming of the Russian Academy of Sciences
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#

0 commit comments

Comments
 (0)