Move around experimental tests

Exclude list for AST JSON tests

Fix type inference shellcheck failure

Disable shellcheck SC2086
This commit is contained in:
Nikola Matic 2023-08-29 14:35:58 +02:00
parent 7c2f5ee171
commit 319a6c4999
19 changed files with 53 additions and 8 deletions

View File

@ -64,6 +64,7 @@ public:
bool visit(SourceUnit const&) override { return true; }
bool visit(ContractDefinition const&) override { return true; }
bool visit(InlineAssembly const& _inlineAssembly) override;
bool visit(ImportDirective const&) override { return true; }
bool visit(PragmaDirective const&) override { return false; }
bool visit(IfStatement const&) override { return true; }

View File

@ -240,6 +240,13 @@ public:
/// @returns false on error.
bool compile(State _stopAfter = State::CompilationSuccessful);
/// Checks whether experimental analysis is on; used in SyntaxTests to skip compilation in case it's ``true``.
/// @returns true if experimental analysis is set
bool isExperimentalAnalysis() const
{
return !!m_experimentalAnalysis;
}
/// @returns the list of sources (paths) used
std::vector<std::string> sourceNames() const;

View File

@ -209,7 +209,14 @@ esac
# boost_filesystem_bug specifically tests a local fix for a boost::filesystem
# bug. Since the test involves a malformed path, there is no point in running
# tests on it. See https://github.com/boostorg/filesystem/issues/176
IMPORT_TEST_FILES=$(find "${TEST_DIRS[@]}" -name "*.sol" -and -not -name "boost_filesystem_bug.sol" -not -path "*/experimental/*")
# In addition, exclude all experimental Solidity tests (new type inference system)
EXCLUDE_FILES=(
boost_filesystem_bug.sol
pragma_experimental_solidity.sol
)
EXCLUDE_FILES_JOINED=$(printf "! -name %s " "${EXCLUDE_FILES[@]}")
# shellcheck disable=SC2086
IMPORT_TEST_FILES=$(find "${TEST_DIRS[@]}" -name "*.sol" -and $EXCLUDE_FILES_JOINED -not -path "*/experimental/*")
NSOURCES="$(echo "${IMPORT_TEST_FILES}" | wc -l)"
echo "Looking at ${NSOURCES} .sol files..."

View File

@ -67,7 +67,7 @@ void SyntaxTest::parseAndAnalyze()
{
setupCompiler();
if (compiler().parse() && compiler().analyze())
if (compiler().parse() && compiler().analyze() && !compiler().isExperimentalAnalysis())
try
{
if (!compiler().compile())

View File

@ -85,6 +85,8 @@ contract C {
}
}
// ====
// EVMVersion: >=constantinople
// ====
// compileViaYul: true
// ----
// (): 0 -> 0

View File

@ -3,4 +3,3 @@ pragma experimental solidity;
// EVMVersion: >=constantinople
// ----
// Warning 2264: (0-29): Experimental features are turned on. Do not use experimental features on live deployments.
// UnimplementedFeatureError 6547: Experimental Analysis is not implemented yet.

View File

@ -6,4 +6,5 @@ import std.stub;
// ----
// Warning 2264: (std.stub:63-92): Experimental features are turned on. Do not use experimental features on live deployments.
// Warning 2264: (0-29): Experimental features are turned on. Do not use experimental features on live deployments.
// UnimplementedFeatureError 6547: Experimental Analysis is not implemented yet.
// Info 4164: (std.stub:94-117): Inferred type: () -> ()
// Info 4164: (std.stub:111-113): Inferred type: ()

View File

@ -6,4 +6,5 @@ import std.stub as stub;
// ----
// Warning 2264: (std.stub:63-92): Experimental features are turned on. Do not use experimental features on live deployments.
// Warning 2264: (0-29): Experimental features are turned on. Do not use experimental features on live deployments.
// UnimplementedFeatureError 6547: Experimental Analysis is not implemented yet.
// Info 4164: (std.stub:94-117): Inferred type: () -> ()
// Info 4164: (std.stub:111-113): Inferred type: ()

View File

@ -6,4 +6,6 @@ import { identity } from std.stub;
// ----
// Warning 2264: (std.stub:63-92): Experimental features are turned on. Do not use experimental features on live deployments.
// Warning 2264: (0-29): Experimental features are turned on. Do not use experimental features on live deployments.
// UnimplementedFeatureError 6547: Experimental Analysis is not implemented yet.
// Info 4164: (std.stub:94-117): Inferred type: () -> ()
// Info 4164: (std.stub:111-113): Inferred type: ()
// Info 4164: (40-48): Inferred type: () -> ()

View File

@ -6,4 +6,5 @@ import * as stub from std.stub;
// ----
// Warning 2264: (std.stub:63-92): Experimental features are turned on. Do not use experimental features on live deployments.
// Warning 2264: (0-29): Experimental features are turned on. Do not use experimental features on live deployments.
// UnimplementedFeatureError 6547: Experimental Analysis is not implemented yet.
// Info 4164: (std.stub:94-117): Inferred type: () -> ()
// Info 4164: (std.stub:111-113): Inferred type: ()

View File

@ -0,0 +1,24 @@
pragma experimental solidity;
import { identity as id } from std.stub;
contract C
{
fallback() external
{
id();
}
}
// ====
// EVMVersion: >=constantinople
// ----
// Warning 2264: (std.stub:63-92): Experimental features are turned on. Do not use experimental features on live deployments.
// Warning 2264: (0-29): Experimental features are turned on. Do not use experimental features on live deployments.
// Info 4164: (std.stub:94-117): Inferred type: () -> ()
// Info 4164: (std.stub:111-113): Inferred type: ()
// Info 4164: (40-48): Inferred type: () -> ()
// Info 4164: (90-135): Inferred type: () -> ()
// Info 4164: (98-100): Inferred type: ()
// Info 4164: (124-128): Inferred type: ()
// Info 4164: (124-126): Inferred type: () -> ()

View File

@ -70,5 +70,5 @@ while read -r file; do
echo "$file"
exit 1
fi
done < <(find "${REPO_ROOT}/test" -iname "*.sol" -and -not -name "documentation.sol" -and -not -name "boost_filesystem_bug.sol")
done < <(find "${REPO_ROOT}/test" -iname "*.sol" -and -not -name "documentation.sol" -and -not -name "boost_filesystem_bug.sol" -not -path "*/experimental/*")
echo