mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Initial prototype of prb-math external tests using foundry rewritten in python
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
This commit is contained in:
Executable
+53
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# This file is part of solidity.
|
||||
#
|
||||
# solidity is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# solidity is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with solidity. If not, see <http://www.gnu.org/licenses/>
|
||||
#
|
||||
# (c) 2023 solidity contributors.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
# Our scripts/ is not a proper Python package so we need to modify PYTHONPATH to import from it
|
||||
# pragma pylint: disable=import-error,wrong-import-position
|
||||
PROJECT_ROOT = Path(__file__).parents[2]
|
||||
sys.path.insert(0, f"{PROJECT_ROOT}/scripts/externalTests")
|
||||
|
||||
from runners.base import run_test
|
||||
from runners.base import TestConfig
|
||||
from runners.foundry import FoundryRunner
|
||||
from test_helpers import SettingsPreset
|
||||
|
||||
test_config = TestConfig(
|
||||
name="PRBMath",
|
||||
repo_url="https://github.com/PaulRBerg/prb-math.git",
|
||||
ref_type="branch",
|
||||
ref="main",
|
||||
compile_only_presets=[
|
||||
# pylint: disable=line-too-long
|
||||
# SettingsPreset.IR_NO_OPTIMIZE, # Error: Yul exception:Variable expr_15699_address is 2 slot(s) too deep inside the stack. Stack too deep.
|
||||
# SettingsPreset.IR_OPTIMIZE_EVM_ONLY, # Error: Yul exception:Variable expr_15699_address is 2 slot(s) too deep inside the stack. Stack too deep.
|
||||
],
|
||||
settings_presets=[
|
||||
SettingsPreset.LEGACY_NO_OPTIMIZE,
|
||||
SettingsPreset.LEGACY_OPTIMIZE_EVM_ONLY,
|
||||
SettingsPreset.LEGACY_OPTIMIZE_EVM_YUL,
|
||||
SettingsPreset.IR_OPTIMIZE_EVM_YUL,
|
||||
],
|
||||
)
|
||||
|
||||
sys.exit(run_test(FoundryRunner(argv=sys.argv[1:], config=test_config)))
|
||||
@@ -36,7 +36,7 @@ def detect_external_tests() -> dict:
|
||||
return {
|
||||
file_path.stem: file_path
|
||||
for file_path in Path(EXTERNAL_TESTS_DIR).iterdir()
|
||||
if file_path.is_file() and file_path.suffix == ".sh"
|
||||
if file_path.is_file() and file_path.suffix in (".sh", ".py")
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user