diff options
author | 2020-11-25 16:09:32 +0100 | |
---|---|---|
committer | 2020-11-25 16:11:49 +0100 | |
commit | 3c5905b0cbed94c2b8f5543a14cdc1af2db8acaf (patch) | |
tree | d0ba3be62576780f20a25f805ff19e62d3ec63dc /rust/project_json_test.go | |
parent | b26070efef296bdd26c9d2ddadd0b4083587c484 (diff) |
Ignore variant dependencies in rust-project.json
Source-generated library modules will have a dependency on the source
variant. This creates a cycle in the dependency graph which triggers a
warning from rust-analyzer. Ignore this type of dependency.
Test: m nothing
Change-Id: I13365093ebb88b00f6a72734b01114ec3e9a320e
Diffstat (limited to 'rust/project_json_test.go')
-rw-r--r-- | rust/project_json_test.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/rust/project_json_test.go b/rust/project_json_test.go index 69288fcfa..16699c19a 100644 --- a/rust/project_json_test.go +++ b/rust/project_json_test.go @@ -131,6 +131,22 @@ func TestProjectJsonBindGen(t *testing.T) { t.Errorf("The source path for libbindings2 does not contain the BuildOs, got %v; want %v", rootModule, android.BuildOs.String()) } + // Check that libbindings1 does not depend on itself. + if strings.Contains(rootModule, "libbindings1") { + deps, ok := crate["deps"].([]interface{}) + if !ok { + t.Errorf("Unexpected format for deps: %v", crate["deps"]) + } + for _, dep := range deps { + d, ok := dep.(map[string]interface{}) + if !ok { + t.Errorf("Unexpected format for dep: %v", dep) + } + if d["name"] == "bindings1" { + t.Errorf("libbindings1 depends on itself") + } + } + } } } |