diff options
Diffstat (limited to 'test/libsolidity')
-rw-r--r-- | test/libsolidity/SyntaxTest.cpp | 10 | ||||
-rw-r--r-- | test/libsolidity/SyntaxTest.h | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/test/libsolidity/SyntaxTest.cpp b/test/libsolidity/SyntaxTest.cpp index acfdff29..ca051138 100644 --- a/test/libsolidity/SyntaxTest.cpp +++ b/test/libsolidity/SyntaxTest.cpp @@ -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, @@ -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 diff --git a/test/libsolidity/SyntaxTest.h b/test/libsolidity/SyntaxTest.h index 441cc4f8..cb6ee05c 100644 --- a/test/libsolidity/SyntaxTest.h +++ b/test/libsolidity/SyntaxTest.h @@ -71,6 +71,7 @@ public: 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); |