aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SyntaxTest.cpp
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-03-16 18:40:03 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-03-16 19:28:21 +0800
commite68c19c47b03eebb9af528bf2b03bb0086484c63 (patch)
treecdbef7c43a020d40e46821a92fb99804365ff5e5 /test/libsolidity/SyntaxTest.cpp
parent9e1095608d265ac941afbf1e4ed4c79d63a15926 (diff)
downloaddexon-solidity-e68c19c47b03eebb9af528bf2b03bb0086484c63.tar.gz
dexon-solidity-e68c19c47b03eebb9af528bf2b03bb0086484c63.tar.zst
dexon-solidity-e68c19c47b03eebb9af528bf2b03bb0086484c63.zip
Only consider files ending with .sol and not starting with ~ in syntax tests.
Diffstat (limited to 'test/libsolidity/SyntaxTest.cpp')
-rw-r--r--test/libsolidity/SyntaxTest.cpp10
1 files changed, 9 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