From 8b7a60e12a3b806356c0a2f3048b7576650a2328 Mon Sep 17 00:00:00 2001 From: Martin Paulucci Date: Thu, 30 Nov 2023 18:40:46 +0100 Subject: [PATCH] test: implement random test runner. (#489) --- lib/spec/runners/random.ex | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 lib/spec/runners/random.ex diff --git a/lib/spec/runners/random.ex b/lib/spec/runners/random.ex new file mode 100644 index 000000000..7edcaa113 --- /dev/null +++ b/lib/spec/runners/random.ex @@ -0,0 +1,37 @@ +defmodule RandomTestRunner do + @moduledoc """ + Runner for random test cases. See: https://github.com/ethereum/consensus-specs/tree/dev/tests/formats/random + """ + + use ExUnit.CaseTemplate + use TestRunner + + @disabled_cases [ + "randomized_0", + # "randomized_1", + "randomized_2", + "randomized_3", + # "randomized_4", + "randomized_5", + "randomized_6", + "randomized_7", + # "randomized_8", + # "randomized_9", + "randomized_10", + # "randomized_11", + "randomized_12", + "randomized_13", + "randomized_14", + "randomized_15" + ] + + @impl TestRunner + def skip?(%SpecTestCase{fork: "capella", case: testcase}) do + Enum.member?(@disabled_cases, testcase) + end + + @impl TestRunner + def run_test_case(testcase) do + Helpers.ProcessBlocks.process_blocks(testcase) + end +end