Beispiel #1
0
        '--build-dir', help='Fuchsia build directory', required=True)
    parser.add_argument(
        '--before',
        help="Path to JSON IR for before version of the library",
        required=True)
    parser.add_argument(
        '--after',
        help="Path to JSON IR for after version of the library",
        required=True)
    parser.add_argument(
        '--stamp', help="Path to stamp file to write after completion")
    args = parser.parse_args()
    fidl_json_dir = os.path.join(
        args.build_dir, 'gen/garnet/public/lib/fidl/tools/difl_test_fidl')

    before = Libraries().load(args.before)
    after = Libraries().load(args.after)

    before_expected_changes = expected_library_changes(before, args.build_dir)
    after_expected_changes = expected_library_changes(after, args.build_dir)

    identifier_compatibility: Dict[str, bool] = {}

    changes: List[Change] = library_changes(before, after, identifier_compatibility)

    before_actual_changes = actual_library_changes(before, changes,
                                                   before_selector)
    after_actual_changes = actual_library_changes(after, changes,
                                                  after_selector)

    describe_library_differences(before_expected_changes,
Beispiel #2
0
from difl.tricium_output import tricium_output

ap = argparse.ArgumentParser(prog='difl')

before_group = ap.add_mutually_exclusive_group(required=True)
before_group.add_argument('--before', type=str, help='the .fidl.json from before the change')
before_group.add_argument('--before-files', type=str, help='a list of .fidl.json files from before the change')

after_group = ap.add_mutually_exclusive_group(required=True)
after_group.add_argument('--after', type=str, help='the .fidl.json from after the change')
after_group.add_argument('--after-files', type=str, help='a list of .fidl.json files from after the change')

ap.add_argument('--format', choices=['text', 'tricium'], default='text')
args = ap.parse_args()

before_libraries = Libraries()
if args.before:
    before_libraries.load(args.before)
else:
    before_libraries.load_all(args.before_files)

after_libraries = Libraries()
if args.after:
    after_libraries.load(args.after)
else:
    after_libraries.load_all(args.after_files)

changes = libraries_changes(before_libraries, after_libraries)

classified_changes = abi_changes(changes)