Add pragmas and SPDX comments to command-line tests to get cleaner error output

This commit is contained in:
Kamil Śliwak 2021-08-05 17:14:16 +02:00
parent dc4620d2be
commit 2803dba980
34 changed files with 95 additions and 133 deletions

View File

@ -1,5 +0,0 @@
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> combined_json_generated_sources/input.sol
Warning: Source file does not specify required compiler version!
--> combined_json_generated_sources/input.sol

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
pragma abicoder v2;
contract C {

View File

@ -1,5 +0,0 @@
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> dup_opt_peephole/input.sol
Warning: Source file does not specify required compiler version!
--> dup_opt_peephole/input.sol

View File

@ -1,3 +1,6 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
contract C {
fallback() external {
assembly {

View File

@ -1,7 +1,7 @@
======= dup_opt_peephole/input.sol:C =======
EVM assembly:
/* "dup_opt_peephole/input.sol":0:111 contract C {... */
/* "dup_opt_peephole/input.sol":60:171 contract C {... */
mstore(0x40, 0x80)
callvalue
dup1
@ -23,7 +23,7 @@ tag_1:
stop
sub_0: assembly {
/* "dup_opt_peephole/input.sol":0:111 contract C {... */
/* "dup_opt_peephole/input.sol":60:171 contract C {... */
mstore(0x40, 0x80)
callvalue
dup1
@ -35,19 +35,19 @@ sub_0: assembly {
revert
tag_3:
pop
/* "dup_opt_peephole/input.sol":74:75 0 */
/* "dup_opt_peephole/input.sol":134:135 0 */
0x00
/* "dup_opt_peephole/input.sol":61:76 calldataload(0) */
/* "dup_opt_peephole/input.sol":121:136 calldataload(0) */
calldataload
/* "dup_opt_peephole/input.sol":100:101 x */
/* "dup_opt_peephole/input.sol":160:161 x */
dup1
/* "dup_opt_peephole/input.sol":97:98 0 */
/* "dup_opt_peephole/input.sol":157:158 0 */
0x00
/* "dup_opt_peephole/input.sol":90:102 sstore(0, x) */
/* "dup_opt_peephole/input.sol":150:162 sstore(0, x) */
sstore
/* "dup_opt_peephole/input.sol":47:106 {... */
/* "dup_opt_peephole/input.sol":107:166 {... */
pop
/* "dup_opt_peephole/input.sol":0:111 contract C {... */
/* "dup_opt_peephole/input.sol":60:171 contract C {... */
stop
auxdata: <AUXDATA REMOVED>

View File

@ -1,36 +1,29 @@
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> message_format_utf8/input.sol
Warning: Source file does not specify required compiler version!
--> message_format_utf8/input.sol
Warning: Statement has no effect.
--> message_format_utf8/input.sol:2:51:
--> message_format_utf8/input.sol:5:51:
|
2 | /* ©©©©ᄅ©©©©© 2017 */ constructor () { unicode"©©©©ᄅ©©©©©" ; }
5 | /* ©©©©ᄅ©©©©© 2017 */ constructor () { unicode"©©©©ᄅ©©©©©" ; }
| ^^^^^^^^^^^^^^^^^^^
Warning: Statement has no effect.
--> message_format_utf8/input.sol:6:25:
--> message_format_utf8/input.sol:9:25:
|
6 | unicode"S = π × r²";
9 | unicode"S = π × r²";
| ^^^^^^^^^^^^^^^^^^^
Warning: Statement has no effect.
--> message_format_utf8/input.sol:7:39:
|
7 | /* ₀₁₂₃₄⁵⁶⁷⁸⁹ */ unicode"∑ 1/n! ≈ 2.7"; // tabs in-between
| ^^^^^^^^^^^^^^^^^^^^^
--> message_format_utf8/input.sol:10:39:
|
10 | /* ₀₁₂₃₄⁵⁶⁷⁸⁹ */ unicode"∑ 1/n! ≈ 2.7"; // tabs in-between
| ^^^^^^^^^^^^^^^^^^^^^
Warning: Statement has no effect.
--> message_format_utf8/input.sol:8:30:
|
8 | /* Ŀŏŗėɯ ïƥŝʉɱ */ unicode"μὴ χεῖρον βέλτιστον"; // tabs in-between and inside
| ^^^^^^^^^^ ^^^^^^ ^^^^^^^^^^
--> message_format_utf8/input.sol:11:30:
|
11 | /* Ŀŏŗėɯ ïƥŝʉɱ */ unicode"μὴ χεῖρον βέλτιστον"; // tabs in-between and inside
| ^^^^^^^^^^ ^^^^^^ ^^^^^^^^^^
Warning: Function state mutability can be restricted to pure
--> message_format_utf8/input.sol:12:2:
--> message_format_utf8/input.sol:15:2:
|
12 | function selector() public returns(uint) { // starts with tab
15 | function selector() public returns(uint) { // starts with tab
| ^ (Relevant source part starts here and spans across multiple lines).

View File

@ -1,3 +1,6 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
contract Foo {
/* ©©©©ᄅ©©©©© 2017 */ constructor () { unicode"©©©©ᄅ©©©©©" ; }

View File

@ -1,5 +0,0 @@
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> model_checker_engine_none/input.sol
Warning: Source file does not specify required compiler version!
--> model_checker_engine_none/input.sol

View File

@ -1,8 +1,8 @@
// Removed to yield a warning, otherwise CI test fails with the expectation
// "no output requested"
//pragma solidity >=0.0;
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
contract test {
function f(uint x) public pure {
function f(uint x) public pure {
assert(x > 0);
}
}
}

View File

@ -1,2 +0,0 @@
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> model_checker_targets_balance_chc/input.sol

View File

@ -1,7 +1,9 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
contract test {
uint[] arr;
function f(address payable a, uint x) public {
function f(address payable a, uint x) public {
require(x >= 0);
--x;
x + type(uint).max;
@ -10,5 +12,5 @@ contract test {
assert(x > 0);
arr.pop();
arr[x];
}
}
}

View File

@ -1,2 +0,0 @@
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> model_checker_targets_constant_condition_chc/input.sol

View File

@ -1,7 +1,9 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
contract test {
uint[] arr;
function f(address payable a, uint x) public {
function f(address payable a, uint x) public {
require(x >= 0);
--x;
x + type(uint).max;
@ -10,5 +12,5 @@ contract test {
assert(x > 0);
arr.pop();
arr[x];
}
}
}

View File

@ -1,2 +0,0 @@
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> model_checker_targets_out_of_bounds_bmc/input.sol

View File

@ -1,7 +1,9 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
contract test {
uint[] arr;
function f(address payable a, uint x) public {
function f(address payable a, uint x) public {
require(x >= 0);
--x;
x + type(uint).max;
@ -10,5 +12,5 @@ contract test {
assert(x > 0);
arr.pop();
arr[x];
}
}
}

View File

@ -1,2 +0,0 @@
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> model_checker_targets_pop_empty_bmc/input.sol

View File

@ -1,7 +1,9 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
contract test {
uint[] arr;
function f(address payable a, uint x) public {
function f(address payable a, uint x) public {
require(x >= 0);
--x;
x + type(uint).max;
@ -10,5 +12,5 @@ contract test {
assert(x > 0);
arr.pop();
arr[x];
}
}
}

View File

@ -1,5 +0,0 @@
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> <stdin>
Warning: Source file does not specify required compiler version!
--> <stdin>

View File

@ -1 +1,4 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
contract C {}

View File

@ -1,11 +1,5 @@
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> too_long_line/input.sol
Warning: Source file does not specify required compiler version!
--> too_long_line/input.sol
Error: Identifier not found or not unique.
--> too_long_line/input.sol:2:164:
--> too_long_line/input.sol:5:164:
|
2 | ... ffffffffffffffffffffffffffffffffff(announcementType Type, string Announcement, string ...
5 | ... ffffffffffffffffffffffffffffffffff(announcementType Type, string Announcement, string ...
| ^^^^^^^^^^^^^^^^

View File

@ -1,3 +1,6 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
contract C {
function ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff(announcementType Type, string Announcement, string Link, bool Oppositable, string _str, uint256 _uint, address _addr) onlyOwner external {
}

View File

@ -1,11 +1,5 @@
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> too_long_line_both_sides_short/input.sol
Warning: Source file does not specify required compiler version!
--> too_long_line_both_sides_short/input.sol
Error: Identifier not found or not unique.
--> too_long_line_both_sides_short/input.sol:2:15:
--> too_long_line_both_sides_short/input.sol:5:15:
|
2 | function f(announcementTypeXXXXXXXXXXXXXXXXXXX ... XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Type,
5 | function f(announcementTypeXXXXXXXXXXXXXXXXXXX ... XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Type,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,3 +1,6 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
contract C {
function f(announcementTypeXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Type,
string Announcement, string Link, bool Oppositable, string _str, uint256 _uint, address _addr) onlyOwner external {

View File

@ -1,11 +1,5 @@
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> too_long_line_edge_in/input.sol
Warning: Source file does not specify required compiler version!
--> too_long_line_edge_in/input.sol
Error: Identifier not found or not unique.
--> too_long_line_edge_in/input.sol:2:36:
--> too_long_line_edge_in/input.sol:5:36:
|
2 | function ffffffffffffffffffffff(announcementTypeTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT Ty, string A) onlyOwner external {
5 | function ffffffffffffffffffffff(announcementTypeTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT Ty, string A) onlyOwner external {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,3 +1,6 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
contract C {
function ffffffffffffffffffffff(announcementTypeTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT Ty, string A) onlyOwner external {
}

View File

@ -1,11 +1,5 @@
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> too_long_line_edge_out/input.sol
Warning: Source file does not specify required compiler version!
--> too_long_line_edge_out/input.sol
Error: Identifier not found or not unique.
--> too_long_line_edge_out/input.sol:2:37:
--> too_long_line_edge_out/input.sol:5:37:
|
2 | ... function fffffffffffffffffffffff(announcementTypeTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT Typ, string A) onlyOwner external ...
5 | ... function fffffffffffffffffffffff(announcementTypeTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT Typ, string A) onlyOwner external ...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,3 +1,6 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
contract C {
function fffffffffffffffffffffff(announcementTypeTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT Typ, string A) onlyOwner external {
}

View File

@ -1,11 +1,5 @@
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> too_long_line_left_short/input.sol
Warning: Source file does not specify required compiler version!
--> too_long_line_left_short/input.sol
Error: Identifier not found or not unique.
--> too_long_line_left_short/input.sol:2:15:
--> too_long_line_left_short/input.sol:5:15:
|
2 | function f(announcementType Type, string Announcement, string ...
5 | function f(announcementType Type, string Announcement, string ...
| ^^^^^^^^^^^^^^^^

View File

@ -1,3 +1,6 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
contract C {
function f(announcementType Type, string Announcement, string Link, bool Oppositable, string _str, uint256 _uint, address _addr) onlyOwner external {
}

View File

@ -1,11 +1,5 @@
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> too_long_line_multiline/input.sol
Error: No visibility specified. Did you intend to add "public"?
--> too_long_line_multiline/input.sol:2:5:
--> too_long_line_multiline/input.sol:5:5:
|
2 | function f() returns (bytes1 _b, by ... _b7, bytes22 _b22, bytes32 _b32) {
5 | function f() returns (bytes1 _b, by ... _b7, bytes22 _b22, bytes32 _b32) {
| ^ (Relevant source part starts here and spans across multiple lines).
Warning: Source file does not specify required compiler version!
--> too_long_line_multiline/input.sol

View File

@ -1,3 +1,6 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
contract C {
function f() returns (bytes1 _b, bytes2 _b2, bytes3 _b3, bytes memory _blit, bytes5 _b5, bytes6 _b6, string memory _str, bytes7 _b7, bytes22 _b22, bytes32 _b32) {
_b = 0x12;

View File

@ -1,11 +1,5 @@
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> too_long_line_right_short/input.sol
Warning: Source file does not specify required compiler version!
--> too_long_line_right_short/input.sol
Error: Identifier not found or not unique.
--> too_long_line_right_short/input.sol:2:164:
--> too_long_line_right_short/input.sol:5:164:
|
2 | ... ffffffffffffffffffffffffffffffffff(announcementType Type,
5 | ... ffffffffffffffffffffffffffffffffff(announcementType Type,
| ^^^^^^^^^^^^^^^^

View File

@ -1,3 +1,6 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.0;
contract C {
function ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff(announcementType Type,
string Announcement, string Link, bool Oppositable, string _str, uint256 _uint, address _addr) onlyOwner external {