Skip to content

Commit

Permalink
statetest: Set default test filter
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Oct 20, 2022
1 parent 134eddc commit ca7e3aa
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/statetest/statetest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ class StateTest : public testing::Test

int main(int argc, char* argv[])
{
static constexpr std::string_view filter_flag_name = "--gtest_filter";
const auto has_user_filter = std::find_if(argv, argv + argc, [](std::string_view arg) noexcept {
return arg.starts_with(filter_flag_name);
}) != (argv + argc);

testing::InitGoogleTest(&argc, argv); // Process GoogleTest flags.

if (argc != 2)
Expand All @@ -36,6 +41,21 @@ int main(int argc, char* argv[])
return -1;
}

if (!has_user_filter)
{
// Set default test filter if none provided.
// To enable all tests use `--gtest_filter=*`.
testing::FLAGS_gtest_filter =
"-"
// Slow tests:
"stCreateTest.CreateOOGafterMaxCodesize:" // pass
"stQuadraticComplexityTest.Call50000_sha256:" // pass
"stTimeConsuming.static_Call50000_sha256:" // pass
"stTimeConsuming.CALLBlake2f_MaxRounds:" // pass
"VMTests/vmPerformance.*:" // pass
;
}

evmc::VM vm{evmc_create_evmone(), {{"O", "0"}, /*{"trace", "1"}*/}};

std::vector<fs::path> test_files;
Expand Down

0 comments on commit ca7e3aa

Please sign in to comment.