Skip to content

Commit

Permalink
allow helper files in test src folders.
Browse files Browse the repository at this point in the history
  • Loading branch information
winsvega committed Oct 23, 2023
1 parent 5dcc2c7 commit cec0f32
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
3 changes: 3 additions & 0 deletions retesteth/EthChecks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ Debug::Debug()
else if (flag == "WARNING")
m_channels[DC::WARNING] = true; // Warning messages
else if (flag == "PYSPEC")
{
m_channels[DC::PYSPEC] = true; // Python script errorlog
m_channels[DC::WARNING] = true;
}
else
ETH_STDOUT_MESSAGEC("WARNING: Debug channel `" + flag + "` not found!", cYellow);
}
Expand Down
12 changes: 9 additions & 3 deletions retesteth/testSuiteRunner/TestSuite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ string getTestNameFromFillerFilename(fs::path const& _fillerTestFilePath)
return fillerName;

static string const requireStr = " require: Filler.json/Filler.yml/Copier.json/.py";
ETH_FAIL_REQUIRE_MESSAGE(false,
"Incorrect file suffix in the filler folder! " + _fillerTestFilePath.string() + requireStr);
return fillerName;
ETH_WARNING("Incorrect file suffix in the filler folder! " + _fillerTestFilePath.string() + requireStr);
return string();
}
} // namespace

Expand Down Expand Up @@ -158,6 +157,13 @@ void TestSuite::_executeTest(string const& _testFolder, fs::path const& _fillerT

// Construct output test file name
string const testName = getTestNameFromFillerFilename(_fillerTestFilePath);
if (testName.empty()) // allow files that are not tests
{
ETH_WARNING("Skipping unsupported file: " + _fillerTestFilePath.string());
RPCSession::sessionEnd(TestOutputHelper::getThreadID(), RPCSession::SessionStatus::HasFinished);
return;
}

size_t const threadID = std::hash<std::thread::id>()(TestOutputHelper::getThreadID());
ETH_DC_MESSAGE(DC::STATS2, "Running " + testName + ": " + "(" + test::fto_string(threadID) + ")");
AbsoluteFilledTestPath const filledTestPath = getFullPathFilled(_testFolder).path() / fs::path(testName + ".json");
Expand Down
9 changes: 8 additions & 1 deletion retesteth/testSuiteRunner/TestSuiteHelperFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,17 @@ vector<string> const& getGeneratedTestNames(fs::path const& _filler)
{
string fillerName = _filler.stem().string();
if (fillerName.find(c_fillerPostf) != string::npos)
{
fillerName = fillerName.substr(0, fillerName.length() - c_fillerPostf.size());
generatedTestNames.emplace_back(fillerName);
}
else if (fillerName.find(c_copierPostf) != string::npos)
{
fillerName = fillerName.substr(0, fillerName.length() - c_copierPostf.size());
generatedTestNames.emplace_back(fillerName);
generatedTestNames.emplace_back(fillerName);
}
else
ETH_WARNING("Skipping unsupported test file: " + _filler.string());
}
else if (_filler.extension() == ".py")
{
Expand Down

0 comments on commit cec0f32

Please sign in to comment.