-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More CLI tests for output selection in Standard JSON
- Loading branch information
Showing
14 changed files
with
542 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
.../cmdlineTests/standard_output_selection_all_sources_blank_contract_named_blank/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"language": "Solidity", | ||
"sources": { | ||
"": {"content": "contract D {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"}, | ||
"*": {"content": "contract D {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"}, | ||
"C": {"content": "contract D {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"} | ||
}, | ||
"settings": { | ||
"outputSelection": { | ||
"": {"D": ["userdoc"]} | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...cmdlineTests/standard_output_selection_all_sources_blank_contract_named_blank/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"contracts": { | ||
"": { | ||
"D": { | ||
"userdoc": { | ||
"kind": "user", | ||
"methods": {}, | ||
"version": 1 | ||
} | ||
} | ||
} | ||
}, | ||
"sources": { | ||
"": { | ||
"id": 0 | ||
}, | ||
"*": { | ||
"id": 1 | ||
}, | ||
"C": { | ||
"id": 2 | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
test/cmdlineTests/standard_output_selection_all_sources_star_contract_named_star/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"language": "Solidity", | ||
"sources": { | ||
"": {"content": "contract D {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"}, | ||
"*": {"content": "contract D {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"}, | ||
"C": {"content": "contract D {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"} | ||
}, | ||
"settings": { | ||
"outputSelection": { | ||
"*": {"D": ["userdoc"]} | ||
} | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
test/cmdlineTests/standard_output_selection_all_sources_star_contract_named_star/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"contracts": { | ||
"": { | ||
"D": { | ||
"userdoc": { | ||
"kind": "user", | ||
"methods": {}, | ||
"version": 1 | ||
} | ||
} | ||
}, | ||
"*": { | ||
"D": { | ||
"userdoc": { | ||
"kind": "user", | ||
"methods": {}, | ||
"version": 1 | ||
} | ||
} | ||
}, | ||
"C": { | ||
"D": { | ||
"userdoc": { | ||
"kind": "user", | ||
"methods": {}, | ||
"version": 1 | ||
} | ||
} | ||
} | ||
}, | ||
"sources": { | ||
"": { | ||
"id": 0 | ||
}, | ||
"*": { | ||
"id": 1 | ||
}, | ||
"C": { | ||
"id": 2 | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...sts/standard_output_selection_duplicate_matching_source_and_contract_selectors/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"language": "Solidity", | ||
"sources": { | ||
"*": {"content": "contract A {}\ncontract B {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"}, | ||
"C": {"content": "contract A {}\ncontract B {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"}, | ||
"D": {"content": "contract A {}\ncontract B {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"} | ||
}, | ||
"settings": { | ||
"outputSelection": { | ||
// Outputs from duplicate keys are not combined. Last value wins. | ||
"*": { | ||
"*": ["userdoc"], // Ignored | ||
"*": ["devdoc"] // Ignored | ||
}, | ||
"C": { | ||
"*": ["storageLayout"], // Ignored | ||
"*": ["transientStorageLayout"] // Ignored | ||
}, | ||
"C": { | ||
"A": ["evm.bytecode.linkReferences"], // Ignored | ||
"A": ["evm.bytecode.object"] | ||
}, | ||
"*": { | ||
"A": ["evm.deployedBytecode.immutableReferences"], // Ignored | ||
"A": ["abi"] | ||
} | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...ts/standard_output_selection_duplicate_matching_source_and_contract_selectors/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"contracts": { | ||
"*": { | ||
"A": { | ||
"abi": [] | ||
} | ||
}, | ||
"C": { | ||
"A": { | ||
"abi": [], | ||
"evm": { | ||
"bytecode": { | ||
"object": "<BYTECODE REMOVED>" | ||
} | ||
} | ||
} | ||
}, | ||
"D": { | ||
"A": { | ||
"abi": [] | ||
} | ||
} | ||
}, | ||
"sources": { | ||
"*": { | ||
"id": 0 | ||
}, | ||
"C": { | ||
"id": 1 | ||
}, | ||
"D": { | ||
"id": 2 | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...ests/standard_output_selection_multiple_matching_source_and_contract_selectors/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"language": "Solidity", | ||
"sources": { | ||
"": {"content": "contract A {}\ncontract B {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"}, | ||
"*": {"content": "contract A {}\ncontract B {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"}, | ||
"C": {"content": "contract A {}\ncontract B {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"}, | ||
"D": {"content": "contract A {}\ncontract B {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"} | ||
}, | ||
"settings": { | ||
"outputSelection": { | ||
// FIXME: Behavior of "" is inconsistent. Sometimes it matches everything, sometimes only empty name. | ||
"": { | ||
"": ["metadata"], // No matches | ||
"*": ["transientStorageLayout"], // All sources, all contracts | ||
"A": ["abi"] // source "", contract A | ||
}, | ||
"*": { | ||
"": ["evm.deployedBytecode.immutableReferences"], // No matches | ||
"*": ["evm.bytecode.object"], // All sources, all contracts | ||
"A": ["evm.bytecode.linkReferences"] // All sources, contract A | ||
}, | ||
"C": { | ||
"": ["userdoc"], // No matches | ||
"*": ["devdoc"], // All contracts in source "C" | ||
"A": ["storageLayout"] // source "C", contract A | ||
} | ||
} | ||
} | ||
} |
109 changes: 109 additions & 0 deletions
109
...sts/standard_output_selection_multiple_matching_source_and_contract_selectors/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
{ | ||
"contracts": { | ||
"": { | ||
"A": { | ||
"abi": [], | ||
"evm": { | ||
"bytecode": { | ||
"linkReferences": {}, | ||
"object": "<BYTECODE REMOVED>" | ||
} | ||
}, | ||
"transientStorageLayout": { | ||
"storage": [], | ||
"types": null | ||
} | ||
}, | ||
"B": { | ||
"evm": { | ||
"bytecode": { | ||
"object": "<BYTECODE REMOVED>" | ||
} | ||
}, | ||
"transientStorageLayout": { | ||
"storage": [], | ||
"types": null | ||
} | ||
} | ||
}, | ||
"*": { | ||
"A": { | ||
"evm": { | ||
"bytecode": { | ||
"linkReferences": {}, | ||
"object": "<BYTECODE REMOVED>" | ||
} | ||
} | ||
}, | ||
"B": { | ||
"evm": { | ||
"bytecode": { | ||
"object": "<BYTECODE REMOVED>" | ||
} | ||
} | ||
} | ||
}, | ||
"C": { | ||
"A": { | ||
"devdoc": { | ||
"kind": "dev", | ||
"methods": {}, | ||
"version": 1 | ||
}, | ||
"evm": { | ||
"bytecode": { | ||
"linkReferences": {}, | ||
"object": "<BYTECODE REMOVED>" | ||
} | ||
}, | ||
"storageLayout": { | ||
"storage": [], | ||
"types": null | ||
} | ||
}, | ||
"B": { | ||
"devdoc": { | ||
"kind": "dev", | ||
"methods": {}, | ||
"version": 1 | ||
}, | ||
"evm": { | ||
"bytecode": { | ||
"object": "<BYTECODE REMOVED>" | ||
} | ||
} | ||
} | ||
}, | ||
"D": { | ||
"A": { | ||
"evm": { | ||
"bytecode": { | ||
"linkReferences": {}, | ||
"object": "<BYTECODE REMOVED>" | ||
} | ||
} | ||
}, | ||
"B": { | ||
"evm": { | ||
"bytecode": { | ||
"object": "<BYTECODE REMOVED>" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"sources": { | ||
"": { | ||
"id": 0 | ||
}, | ||
"*": { | ||
"id": 1 | ||
}, | ||
"C": { | ||
"id": 2 | ||
}, | ||
"D": { | ||
"id": 3 | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...output_selection_multiple_matching_source_and_contract_selectors_full_pipeline/input.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"language": "Solidity", | ||
"sources": { | ||
"C": {"content": "contract A {}\ncontract B {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"}, | ||
"D": {"content": "contract A {}\ncontract B {}\n//SPDX-License-Identifier: GPL-3.0\npragma solidity *;"} | ||
}, | ||
"settings": { | ||
"optimizer": {"enabled": true}, | ||
"debug": {"debugInfo": []}, | ||
"outputSelection": { | ||
// This test uses outputs that require all stages of the pipeline to run, possibly via | ||
// multiple paths, to make sure the later stages handle more complex output selection correctly. | ||
// Currently there are only distinct paths (IR, optimized IR and bytecode generation). | ||
"*": { | ||
"*": ["evm.bytecode.object"], | ||
"A": ["irOptimized"] | ||
}, | ||
"C": { | ||
"A": ["ir"] | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.