@@ -17,6 +17,7 @@
from collections import OrderedDict
import enum
import os
+from pathlib import Path
import re
from typing import (
TYPE_CHECKING,
@@ -100,7 +101,7 @@ def __init__(self,
self.src = ''
# Lexer state (see `accept` for details):
- self.info = QAPISourceInfo(self._fname, incl_info)
+ self.info = QAPISourceInfo(str(Path(self._fname).resolve()), incl_info)
self.tok: Union[None, str] = None
self.pos = 0
self.cursor = 0
@@ -15,6 +15,7 @@
import argparse
import difflib
import os
+from pathlib import Path
import sys
from io import StringIO
@@ -216,6 +217,7 @@ def main(argv):
(dir_name, base_name) = os.path.split(t)
dir_name = dir_name or args.dir
test_name = os.path.splitext(base_name)[0]
+ dir_name = str(Path(dir_name).resolve())
status |= test_and_diff(test_name, dir_name, args.update)
sys.exit(status)
Resolve symbolic filenames (i.e. build/../tests/qapi-schema) to fully specified absolute paths in QAPI info structures. Normalizing filenames in this way makes trimming common path prefixes for test output more consistent. It's also used for the intermediate output representation for the new transmogrifier. Signed-off-by: John Snow <jsnow@redhat.com> --- scripts/qapi/parser.py | 3 ++- tests/qapi-schema/test-qapi.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-)