Loading tools/pdl/Android.bp +12 −12 Original line number Diff line number Diff line Loading @@ -47,16 +47,16 @@ rust_test_host { data: [ ":rustfmt", ":rustfmt.toml", "test/generated/preamble.rs", "test/generated/packet_decl_empty.rs", "test/generated/packet_decl_simple_little_endian.rs", "test/generated/packet_decl_simple_big_endian.rs", "tests/generated/preamble.rs", "tests/generated/packet_decl_empty.rs", "tests/generated/packet_decl_simple_little_endian.rs", "tests/generated/packet_decl_simple_big_endian.rs", ], } rust_test_host { name: "pdl_tests", srcs: ["test/pdl_tests.rs"], srcs: ["tests/pdl_tests.rs"], test_suites: ["general-tests"], enabled: false, // rustfmt is only available on x86. arch: { Loading @@ -78,21 +78,21 @@ rust_test_host { } // Generate the python parser+serializer backend for the // test grammar located at test/grammars/test-grammar.pdl. // test grammar located at tests/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", " --output $(out) --custom-type-location tests.custom_types", tools: [ ":pdl" ], tool_files: [ "scripts/generate_python_backend.py", "scripts/pdl/core.py", "scripts/pdl/ast.py", "test/custom_types.py", "tests/custom_types.py", ], srcs: [ "test/grammars/test-grammar.pdl", "tests/grammars/test-grammar.pdl", ], out: [ "pdl_test.py", Loading @@ -103,10 +103,10 @@ genrule { // pre-generated binary inputs. python_test_host { name: "pdl_python_generator_test", main: "test/python_generator_test.py", main: "tests/python_generator_test.py", srcs: [ "test/python_generator_test.py", "test/custom_types.py", "tests/python_generator_test.py", "tests/custom_types.py", ":pdl_python_generator_test_gen", ], test_options: { Loading tools/pdl/src/generator.rs +4 −4 Original line number Diff line number Diff line Loading @@ -571,7 +571,7 @@ mod tests { #[test] fn test_generate_preamble() { let actual_code = generate_preamble(Path::new("some/path/foo.pdl")).unwrap(); assert_snapshot_eq("test/generated/preamble.rs", &rustfmt(&actual_code)); assert_snapshot_eq("tests/generated/preamble.rs", &rustfmt(&actual_code)); } #[test] Loading @@ -586,7 +586,7 @@ mod tests { let children = HashMap::new(); let decl = &grammar.declarations[0]; let actual_code = generate_decl(&grammar, &packets, &children, decl).unwrap(); assert_snapshot_eq("test/generated/packet_decl_empty.rs", &rustfmt(&actual_code)); assert_snapshot_eq("tests/generated/packet_decl_empty.rs", &rustfmt(&actual_code)); } #[test] Loading @@ -606,7 +606,7 @@ mod tests { let decl = &grammar.declarations[0]; let actual_code = generate_decl(&grammar, &packets, &children, decl).unwrap(); assert_snapshot_eq( "test/generated/packet_decl_simple_little_endian.rs", "tests/generated/packet_decl_simple_little_endian.rs", &rustfmt(&actual_code), ); } Loading @@ -628,7 +628,7 @@ mod tests { let decl = &grammar.declarations[0]; let actual_code = generate_decl(&grammar, &packets, &children, decl).unwrap(); assert_snapshot_eq( "test/generated/packet_decl_simple_big_endian.rs", "tests/generated/packet_decl_simple_big_endian.rs", &rustfmt(&actual_code), ); } Loading tools/pdl/src/test_utils.rs +1 −1 Original line number Diff line number Diff line //! Various utility functions used in tests. // This file is included directly into integration tests in the // `test/` directory. These tests are compiled without access to the // `tests/` directory. These tests are compiled without access to the // rest of the `pdl` crate. To make this work, avoid `use crate::` // statements below. Loading tools/pdl/test/custom_types.py→tools/pdl/tests/custom_types.py +0 −0 File moved. View file tools/pdl/test/generated/packet_decl_empty.rs→tools/pdl/tests/generated/packet_decl_empty.rs +0 −0 File moved. View file Loading
tools/pdl/Android.bp +12 −12 Original line number Diff line number Diff line Loading @@ -47,16 +47,16 @@ rust_test_host { data: [ ":rustfmt", ":rustfmt.toml", "test/generated/preamble.rs", "test/generated/packet_decl_empty.rs", "test/generated/packet_decl_simple_little_endian.rs", "test/generated/packet_decl_simple_big_endian.rs", "tests/generated/preamble.rs", "tests/generated/packet_decl_empty.rs", "tests/generated/packet_decl_simple_little_endian.rs", "tests/generated/packet_decl_simple_big_endian.rs", ], } rust_test_host { name: "pdl_tests", srcs: ["test/pdl_tests.rs"], srcs: ["tests/pdl_tests.rs"], test_suites: ["general-tests"], enabled: false, // rustfmt is only available on x86. arch: { Loading @@ -78,21 +78,21 @@ rust_test_host { } // Generate the python parser+serializer backend for the // test grammar located at test/grammars/test-grammar.pdl. // test grammar located at tests/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", " --output $(out) --custom-type-location tests.custom_types", tools: [ ":pdl" ], tool_files: [ "scripts/generate_python_backend.py", "scripts/pdl/core.py", "scripts/pdl/ast.py", "test/custom_types.py", "tests/custom_types.py", ], srcs: [ "test/grammars/test-grammar.pdl", "tests/grammars/test-grammar.pdl", ], out: [ "pdl_test.py", Loading @@ -103,10 +103,10 @@ genrule { // pre-generated binary inputs. python_test_host { name: "pdl_python_generator_test", main: "test/python_generator_test.py", main: "tests/python_generator_test.py", srcs: [ "test/python_generator_test.py", "test/custom_types.py", "tests/python_generator_test.py", "tests/custom_types.py", ":pdl_python_generator_test_gen", ], test_options: { Loading
tools/pdl/src/generator.rs +4 −4 Original line number Diff line number Diff line Loading @@ -571,7 +571,7 @@ mod tests { #[test] fn test_generate_preamble() { let actual_code = generate_preamble(Path::new("some/path/foo.pdl")).unwrap(); assert_snapshot_eq("test/generated/preamble.rs", &rustfmt(&actual_code)); assert_snapshot_eq("tests/generated/preamble.rs", &rustfmt(&actual_code)); } #[test] Loading @@ -586,7 +586,7 @@ mod tests { let children = HashMap::new(); let decl = &grammar.declarations[0]; let actual_code = generate_decl(&grammar, &packets, &children, decl).unwrap(); assert_snapshot_eq("test/generated/packet_decl_empty.rs", &rustfmt(&actual_code)); assert_snapshot_eq("tests/generated/packet_decl_empty.rs", &rustfmt(&actual_code)); } #[test] Loading @@ -606,7 +606,7 @@ mod tests { let decl = &grammar.declarations[0]; let actual_code = generate_decl(&grammar, &packets, &children, decl).unwrap(); assert_snapshot_eq( "test/generated/packet_decl_simple_little_endian.rs", "tests/generated/packet_decl_simple_little_endian.rs", &rustfmt(&actual_code), ); } Loading @@ -628,7 +628,7 @@ mod tests { let decl = &grammar.declarations[0]; let actual_code = generate_decl(&grammar, &packets, &children, decl).unwrap(); assert_snapshot_eq( "test/generated/packet_decl_simple_big_endian.rs", "tests/generated/packet_decl_simple_big_endian.rs", &rustfmt(&actual_code), ); } Loading
tools/pdl/src/test_utils.rs +1 −1 Original line number Diff line number Diff line //! Various utility functions used in tests. // This file is included directly into integration tests in the // `test/` directory. These tests are compiled without access to the // `tests/` directory. These tests are compiled without access to the // rest of the `pdl` crate. To make this work, avoid `use crate::` // statements below. Loading
tools/pdl/test/generated/packet_decl_empty.rs→tools/pdl/tests/generated/packet_decl_empty.rs +0 −0 File moved. View file