mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-06-13 01:11:09 +00:00
test
This commit is contained in:
+3
-1
@@ -8,4 +8,6 @@ node_modules
|
|||||||
# added to the .gitignore file.
|
# added to the .gitignore file.
|
||||||
*.log
|
*.log
|
||||||
|
|
||||||
profile.json.gz
|
profile.json.gz
|
||||||
|
resolc-compiler-tests
|
||||||
|
workdir
|
||||||
|
|||||||
@@ -499,6 +499,10 @@ impl ResolverApi for GethNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Node for GethNode {
|
impl Node for GethNode {
|
||||||
|
fn name() -> &'static str {
|
||||||
|
"geth"
|
||||||
|
}
|
||||||
|
|
||||||
fn new(config: &Arguments) -> Self {
|
fn new(config: &Arguments) -> Self {
|
||||||
let geth_directory = config.directory().join(Self::BASE_DIRECTORY);
|
let geth_directory = config.directory().join(Self::BASE_DIRECTORY);
|
||||||
let id = NODE_COUNT.fetch_add(1, Ordering::SeqCst);
|
let id = NODE_COUNT.fetch_add(1, Ordering::SeqCst);
|
||||||
|
|||||||
@@ -105,7 +105,11 @@ impl KitchensinkNode {
|
|||||||
.arg("export-chain-spec")
|
.arg("export-chain-spec")
|
||||||
.arg("--chain")
|
.arg("--chain")
|
||||||
.arg("dev")
|
.arg("dev")
|
||||||
.output()?;
|
.output()
|
||||||
|
.context(format!(
|
||||||
|
"Failed to export chain spec with {}",
|
||||||
|
self.substrate_binary.display()
|
||||||
|
))?;
|
||||||
|
|
||||||
if !output.status.success() {
|
if !output.status.success() {
|
||||||
anyhow::bail!(
|
anyhow::bail!(
|
||||||
@@ -515,6 +519,10 @@ impl ResolverApi for KitchensinkNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Node for KitchensinkNode {
|
impl Node for KitchensinkNode {
|
||||||
|
fn name() -> &'static str {
|
||||||
|
"kitchensink"
|
||||||
|
}
|
||||||
|
|
||||||
fn new(config: &Arguments) -> Self {
|
fn new(config: &Arguments) -> Self {
|
||||||
let kitchensink_directory = config.directory().join(Self::BASE_DIRECTORY);
|
let kitchensink_directory = config.directory().join(Self::BASE_DIRECTORY);
|
||||||
let id = NODE_COUNT.fetch_add(1, Ordering::SeqCst);
|
let id = NODE_COUNT.fetch_add(1, Ordering::SeqCst);
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ pub const GENESIS_JSON: &str = include_str!("../../../genesis.json");
|
|||||||
|
|
||||||
/// An abstract interface for testing nodes.
|
/// An abstract interface for testing nodes.
|
||||||
pub trait Node: EthereumNode {
|
pub trait Node: EthereumNode {
|
||||||
|
/// The name of the node implementation.
|
||||||
|
fn name() -> &'static str;
|
||||||
|
|
||||||
/// Create a new uninitialized instance.
|
/// Create a new uninitialized instance.
|
||||||
fn new(config: &Arguments) -> Self;
|
fn new(config: &Arguments) -> Self;
|
||||||
|
|
||||||
|
|||||||
+7
-10
@@ -14,9 +14,8 @@ NC='\033[0m' # No Color
|
|||||||
# Configuration
|
# Configuration
|
||||||
TEST_REPO_URL="https://github.com/paritytech/resolc-compiler-tests"
|
TEST_REPO_URL="https://github.com/paritytech/resolc-compiler-tests"
|
||||||
TEST_REPO_DIR="resolc-compiler-tests"
|
TEST_REPO_DIR="resolc-compiler-tests"
|
||||||
CORPUS_FILE="corpus.json"
|
CORPUS_FILE="./corpus.json"
|
||||||
WORKDIR="workdir"
|
WORKDIR="workdir"
|
||||||
NUMBER_OF_NODES=5
|
|
||||||
|
|
||||||
echo -e "${GREEN}=== Revive Differential Tests Quick Start ===${NC}"
|
echo -e "${GREEN}=== Revive Differential Tests Quick Start ===${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
@@ -34,7 +33,8 @@ fi
|
|||||||
|
|
||||||
# Create corpus file with absolute path resolved at runtime
|
# Create corpus file with absolute path resolved at runtime
|
||||||
echo -e "${GREEN}Creating corpus file...${NC}"
|
echo -e "${GREEN}Creating corpus file...${NC}"
|
||||||
ABSOLUTE_PATH=$(realpath "$TEST_REPO_DIR/fixtures/solidity")
|
ABSOLUTE_PATH=$(realpath "$TEST_REPO_DIR/fixtures/solidity/simple/yul_instructions/codesize.sol")
|
||||||
|
|
||||||
cat > "$CORPUS_FILE" << EOF
|
cat > "$CORPUS_FILE" << EOF
|
||||||
{
|
{
|
||||||
"name": "MatterLabs Solidity Simple, Complex, and Semantic Tests",
|
"name": "MatterLabs Solidity Simple, Complex, and Semantic Tests",
|
||||||
@@ -48,17 +48,14 @@ echo -e "${GREEN}Corpus file created: $CORPUS_FILE${NC}"
|
|||||||
mkdir -p "$WORKDIR"
|
mkdir -p "$WORKDIR"
|
||||||
|
|
||||||
echo -e "${GREEN}Starting differential tests...${NC}"
|
echo -e "${GREEN}Starting differential tests...${NC}"
|
||||||
echo "This may take a while. Logs will be saved to logs.log and output.log"
|
echo "This may take a while..."
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Run the tool
|
# Run the tool
|
||||||
RUST_LOG="info" cargo run --release -- \
|
RUST_LOG="error" cargo run --release -- \
|
||||||
|
--kitchensink "$(realpath ~/polkadot-sdk/target/debug/substrate-node)" \
|
||||||
|
--eth_proxy "$(realpath ~/polkadot-sdk/target/debug/eth-rpc)" \
|
||||||
--corpus "$CORPUS_FILE" \
|
--corpus "$CORPUS_FILE" \
|
||||||
--workdir "$WORKDIR" \
|
--workdir "$WORKDIR" \
|
||||||
--number-of-nodes "$NUMBER_OF_NODES" \
|
|
||||||
> logs.log \
|
|
||||||
2> output.log
|
|
||||||
|
|
||||||
echo -e "${GREEN}=== Test run completed! ===${NC}"
|
echo -e "${GREEN}=== Test run completed! ===${NC}"
|
||||||
echo -e "Check ${GREEN}output.log${NC} for test results"
|
|
||||||
echo -e "Check ${GREEN}logs.log${NC} for detailed execution logs"
|
|
||||||
Reference in New Issue
Block a user