Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion test/libsolidity/SyntaxTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,13 @@ test_case *make_test_case(
}
#endif

bool SyntaxTest::isTestFilename(boost::filesystem::path const& _filename)
{
return _filename.extension().string() == ".sol" &&
!boost::starts_with(_filename.string(), "~") &&
!boost::starts_with(_filename.string(), ".");
}

int SyntaxTest::registerTests(
boost::unit_test::test_suite& _suite,
boost::filesystem::path const& _basepath,
Expand All @@ -220,7 +227,8 @@ int SyntaxTest::registerTests(
fs::directory_iterator(fullpath),
fs::directory_iterator()
))
numTestsAdded += registerTests(*sub_suite, _basepath, _path / entry.path().filename());
if (fs::is_directory(entry.path()) || isTestFilename(entry.path().filename()))
numTestsAdded += registerTests(*sub_suite, _basepath, _path / entry.path().filename());
_suite.add(sub_suite);
}
else
Expand Down
1 change: 1 addition & 0 deletions test/libsolidity/SyntaxTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class SyntaxTest: AnalysisFramework
boost::filesystem::path const& _basepath,
boost::filesystem::path const& _path
);
static bool isTestFilename(boost::filesystem::path const& _filename);
private:
bool matchesExpectations(ErrorList const& _errors) const;
static std::string errorMessage(Error const& _e);
Expand Down
4 changes: 3 additions & 1 deletion test/tools/isoltest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <test/libsolidity/AnalysisFramework.h>
#include <test/libsolidity/SyntaxTest.h>

#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/filesystem.hpp>
#include <boost/program_options.hpp>
Expand Down Expand Up @@ -218,7 +219,8 @@ SyntaxTestStats SyntaxTestTool::processPath(
fs::directory_iterator(fullpath),
fs::directory_iterator()
))
paths.push(currentPath / entry.path().filename());
if (fs::is_directory(entry.path()) || SyntaxTest::isTestFilename(entry.path().filename()))
paths.push(currentPath / entry.path().filename());
}
else
{
Expand Down