Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03d93147 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "pdl: Implement python parser generator for pdl source files" am:...

Merge "pdl: Implement python parser generator for pdl source files" am: 31c960af am: 09ea5fbc am: bf39f7d4 am: 4c13a5c3

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2134423



Change-Id: I8d34fdd057264e219cc04c1ad1c2bbb9d56d91c6
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 585ecb5a 4c13a5c3
Loading
Loading
Loading
Loading
+37 −0
Original line number Original line Diff line number Diff line
@@ -70,3 +70,40 @@ rust_test_host {
        ":rustfmt",
        ":rustfmt",
    ],
    ],
}
}

// Generate the python parser+serializer backend for the
// test grammar located at test/grammars/test-grammar.pdl.
genrule {
    name: "pdl_python_generator_test_gen",
    cmd: "$(location :pdl) $(in) |" +
        " $(location scripts/generate_python_backend.py)" +
        " --output $(out) --custom-type-location test.custom_types",
    tools: [ ":pdl" ],
    tool_files: [
        "scripts/generate_python_backend.py",
        "scripts/pdl/core.py",
        "scripts/pdl/ast.py",
        "test/custom_types.py",
    ],
    srcs: [
        "test/grammars/test-grammar.pdl",
    ],
    out: [
        "pdl_test.py",
    ],
}

// Test the generated python parser+serializer against
// pre-generated binary inputs.
python_test_host {
    name: "pdl_python_generator_test",
    main: "test/python_generator_test.py",
    srcs: [
        "test/python_generator_test.py",
        "test/custom_types.py",
        ":pdl_python_generator_test_gen",
    ],
    test_options: {
        unit_test: true,
    },
}
Loading