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

Commit bb8c3792 authored by Henri Chataing's avatar Henri Chataing
Browse files

pdl: Merge script/ and scripts/ subfolders

Rename the python parser to scripts/pdl/parser.py,
and the test file to tests/python_parser_test.py

Test: atest --host pdl_python_parser_test
Change-Id: Ie32e9e384810bbc991e291e4863d37845f73c9b7
parent 624e50d9
Loading
Loading
Loading
Loading
+20 −0
Original line number Original line Diff line number Diff line
@@ -33,6 +33,12 @@ rust_binary_host {
    defaults: ["pdl_defaults"],
    defaults: ["pdl_defaults"],
}
}


python_binary_host {
    name: "pypdl",
    main: "scripts/pdl/parser.py",
    srcs: ["scripts/pdl/parser.py"],
}

rust_test_host {
rust_test_host {
    name: "pdl_inline_tests",
    name: "pdl_inline_tests",
    defaults: ["pdl_defaults"],
    defaults: ["pdl_defaults"],
@@ -139,3 +145,17 @@ python_test_host {
        unit_test: true,
        unit_test: true,
    },
    },
}
}

// Test the python parser against the rust parser
// on selected PDL source files.
python_test_host {
    name: "pdl_python_parser_test",
    main: "tests/python_parser_test.py",
    srcs: ["tests/python_parser_test.py"],
    data: [
        ":pdl",
        ":pypdl",
        ":BluetoothHciPackets",
        ":RootCanalLinkLayerPackets",
    ],
}

tools/pdl/script/Android.bp

deleted100644 → 0
+0 −35
Original line number Original line Diff line number Diff line
// Copyright 2022 Google Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package {
    default_applicable_licenses: ["Android-Apache-2.0"],
}

python_binary_host {
    name: "pypdl",
    main: "pdl.py",
    srcs: ["pdl.py"],
}

python_test_host {
    name: "pypdl_test",
    main: "pdl_test.py",
    srcs: ["pdl_test.py"],
    data: [
        ":pdl",
        ":pypdl",
        ":BluetoothHciPackets",
        ":RootCanalLinkLayerPackets",
    ],
}
+0 −0

File moved.

+1 −1
Original line number Original line Diff line number Diff line
@@ -25,7 +25,7 @@ FILES_TO_TEST = [
    'packets/link_layer_packets.pdl',
    'packets/link_layer_packets.pdl',
]
]


test_dir = os.path.dirname(__file__)
test_dir = os.path.dirname(os.path.dirname(__file__))
pdl_bin = os.path.join(test_dir, 'pdl')
pdl_bin = os.path.join(test_dir, 'pdl')
pypdl_bin = os.path.join(test_dir, 'pypdl')
pypdl_bin = os.path.join(test_dir, 'pypdl')