aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-03-15 01:05:48 +0800
committerGitHub <noreply@github.com>2018-03-15 01:05:48 +0800
commitd0c96d53e90be5e58d8fef2e77fbd71baf2027ba (patch)
treec7dae3f233e23389ad2eb569732e8dbc98b6cfb5 /test
parentabc7a45230614454d6ffb78447c112b63f712642 (diff)
parentd63d41b3b545b0e13e2ee7f880120b2ba852c654 (diff)
downloaddexon-solidity-d0c96d53e90be5e58d8fef2e77fbd71baf2027ba.tar.gz
dexon-solidity-d0c96d53e90be5e58d8fef2e77fbd71baf2027ba.tar.zst
dexon-solidity-d0c96d53e90be5e58d8fef2e77fbd71baf2027ba.zip
Merge pull request #3734 from ethereum/soltestOptions
test: Rename test/TestHelper.* to test/Options.* and add Options::val…
Diffstat (limited to 'test')
-rw-r--r--test/ExecutionFramework.h2
-rw-r--r--test/Options.cpp (renamed from test/TestHelper.cpp)16
-rw-r--r--test/Options.h (renamed from test/TestHelper.h)1
-rw-r--r--test/RPCSession.cpp2
-rw-r--r--test/boostTest.cpp7
-rw-r--r--test/libdevcore/Checksum.cpp2
-rw-r--r--test/libdevcore/IndentedWriter.cpp2
-rw-r--r--test/libdevcore/JSON.cpp2
-rw-r--r--test/libdevcore/StringUtils.cpp2
-rw-r--r--test/libdevcore/SwarmHash.cpp2
-rw-r--r--test/libdevcore/UTF8.cpp2
-rw-r--r--test/libdevcore/Whiskers.cpp2
-rw-r--r--test/libevmasm/Optimiser.cpp2
-rw-r--r--test/libevmasm/SourceLocation.cpp2
-rw-r--r--test/libjulia/Common.cpp2
-rw-r--r--test/libjulia/Parser.cpp2
-rw-r--r--test/liblll/Compiler.cpp2
-rw-r--r--test/liblll/EndToEndTest.cpp2
-rw-r--r--test/libsolidity/ASTJSON.cpp2
-rw-r--r--test/libsolidity/AnalysisFramework.cpp2
-rw-r--r--test/libsolidity/Assembly.cpp2
-rw-r--r--test/libsolidity/Imports.cpp2
-rw-r--r--test/libsolidity/InlineAssembly.cpp2
-rw-r--r--test/libsolidity/JSONCompiler.cpp4
-rw-r--r--test/libsolidity/Metadata.cpp4
-rw-r--r--test/libsolidity/SemVerMatcher.cpp2
-rw-r--r--test/libsolidity/SolidityABIJSON.cpp2
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp2
-rw-r--r--test/libsolidity/SolidityExpressionCompiler.cpp2
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp2
-rw-r--r--test/libsolidity/SolidityNatspecJSON.cpp2
-rw-r--r--test/libsolidity/SolidityParser.cpp4
-rw-r--r--test/libsolidity/ViewPureChecker.cpp2
33 files changed, 51 insertions, 39 deletions
diff --git a/test/ExecutionFramework.h b/test/ExecutionFramework.h
index a7971b81..ee8da322 100644
--- a/test/ExecutionFramework.h
+++ b/test/ExecutionFramework.h
@@ -22,7 +22,7 @@
#pragma once
-#include <test/TestHelper.h>
+#include <test/Options.h>
#include <test/RPCSession.h>
#include <libsolidity/interface/EVMVersion.h>
diff --git a/test/TestHelper.cpp b/test/Options.cpp
index 77fa204f..ff4a7c98 100644
--- a/test/TestHelper.cpp
+++ b/test/Options.cpp
@@ -19,9 +19,10 @@
* @date 2014
*/
-#include <test/TestHelper.h>
+#include <test/Options.h>
#include <libsolidity/interface/EVMVersion.h>
+#include <libsolidity/interface/Exceptions.h>
#include <boost/test/framework.hpp>
@@ -71,6 +72,19 @@ Options::Options()
testPath = path;
}
+void Options::validate() const
+{
+ solAssert(
+ !dev::test::Options::get().testPath.empty(),
+ "No test path specified. The --testpath argument is required."
+ );
+ if (!disableIPC)
+ solAssert(
+ !dev::test::Options::get().ipcPath.empty(),
+ "No ipc path specified. The --ipcpath argument is required, unless --no-ipc is used."
+ );
+}
+
dev::solidity::EVMVersion Options::evmVersion() const
{
if (!evmVersionString.empty())
diff --git a/test/TestHelper.h b/test/Options.h
index f7b1d94c..9bc69876 100644
--- a/test/TestHelper.h
+++ b/test/Options.h
@@ -41,6 +41,7 @@ struct Options: boost::noncopyable
bool disableIPC = false;
bool disableSMT = false;
+ void validate() const;
solidity::EVMVersion evmVersion() const;
static Options const& get();
diff --git a/test/RPCSession.cpp b/test/RPCSession.cpp
index 54871057..03b1341c 100644
--- a/test/RPCSession.cpp
+++ b/test/RPCSession.cpp
@@ -21,7 +21,7 @@
#include <test/RPCSession.h>
-#include <test/TestHelper.h>
+#include <test/Options.h>
#include <libsolidity/interface/EVMVersion.h>
diff --git a/test/boostTest.cpp b/test/boostTest.cpp
index 8ad97db3..f16973b5 100644
--- a/test/boostTest.cpp
+++ b/test/boostTest.cpp
@@ -35,7 +35,7 @@
#pragma GCC diagnostic pop
-#include <test/TestHelper.h>
+#include <test/Options.h>
#include <test/libsolidity/SyntaxTest.h>
using namespace boost::unit_test;
@@ -55,10 +55,7 @@ test_suite* init_unit_test_suite( int /*argc*/, char* /*argv*/[] )
{
master_test_suite_t& master = framework::master_test_suite();
master.p_name.value = "SolidityTests";
- solAssert(
- !dev::test::Options::get().testPath.empty(),
- "No test path specified. The --testpath argument is required."
- );
+ dev::test::Options::get().validate();
solAssert(dev::solidity::test::SyntaxTest::registerTests(
master,
dev::test::Options::get().testPath / "libsolidity",
diff --git a/test/libdevcore/Checksum.cpp b/test/libdevcore/Checksum.cpp
index 4eedbd99..95066b69 100644
--- a/test/libdevcore/Checksum.cpp
+++ b/test/libdevcore/Checksum.cpp
@@ -22,7 +22,7 @@
#include <libdevcore/Exceptions.h>
-#include "../TestHelper.h"
+#include <test/Options.h>
using namespace std;
diff --git a/test/libdevcore/IndentedWriter.cpp b/test/libdevcore/IndentedWriter.cpp
index a694aa1b..916c99d0 100644
--- a/test/libdevcore/IndentedWriter.cpp
+++ b/test/libdevcore/IndentedWriter.cpp
@@ -20,7 +20,7 @@
#include <libdevcore/IndentedWriter.h>
-#include "../TestHelper.h"
+#include <test/Options.h>
using namespace std;
diff --git a/test/libdevcore/JSON.cpp b/test/libdevcore/JSON.cpp
index 39d71b42..39d958f5 100644
--- a/test/libdevcore/JSON.cpp
+++ b/test/libdevcore/JSON.cpp
@@ -21,7 +21,7 @@
#include <libdevcore/JSON.h>
-#include "../TestHelper.h"
+#include <test/Options.h>
using namespace std;
diff --git a/test/libdevcore/StringUtils.cpp b/test/libdevcore/StringUtils.cpp
index 597457cc..9ee93d02 100644
--- a/test/libdevcore/StringUtils.cpp
+++ b/test/libdevcore/StringUtils.cpp
@@ -20,7 +20,7 @@
#include <libdevcore/StringUtils.h>
-#include "../TestHelper.h"
+#include <test/Options.h>
using namespace std;
diff --git a/test/libdevcore/SwarmHash.cpp b/test/libdevcore/SwarmHash.cpp
index 1ed1da18..913586f8 100644
--- a/test/libdevcore/SwarmHash.cpp
+++ b/test/libdevcore/SwarmHash.cpp
@@ -20,7 +20,7 @@
#include <libdevcore/SwarmHash.h>
-#include "../TestHelper.h"
+#include <test/Options.h>
using namespace std;
diff --git a/test/libdevcore/UTF8.cpp b/test/libdevcore/UTF8.cpp
index 719ada72..6de4570f 100644
--- a/test/libdevcore/UTF8.cpp
+++ b/test/libdevcore/UTF8.cpp
@@ -21,7 +21,7 @@
#include <libdevcore/CommonData.h>
#include <libdevcore/UTF8.h>
-#include "../TestHelper.h"
+#include <test/Options.h>
using namespace std;
diff --git a/test/libdevcore/Whiskers.cpp b/test/libdevcore/Whiskers.cpp
index 84149173..b12acdd7 100644
--- a/test/libdevcore/Whiskers.cpp
+++ b/test/libdevcore/Whiskers.cpp
@@ -20,7 +20,7 @@
#include <libdevcore/Whiskers.h>
-#include "../TestHelper.h"
+#include <test/Options.h>
using namespace std;
diff --git a/test/libevmasm/Optimiser.cpp b/test/libevmasm/Optimiser.cpp
index e6abcb53..f630b304 100644
--- a/test/libevmasm/Optimiser.cpp
+++ b/test/libevmasm/Optimiser.cpp
@@ -20,7 +20,7 @@
* Tests for the Solidity optimizer.
*/
-#include <test/TestHelper.h>
+#include <test/Options.h>
#include <libevmasm/CommonSubexpressionEliminator.h>
#include <libevmasm/PeepholeOptimiser.h>
diff --git a/test/libevmasm/SourceLocation.cpp b/test/libevmasm/SourceLocation.cpp
index 6889b3e6..764da3cd 100644
--- a/test/libevmasm/SourceLocation.cpp
+++ b/test/libevmasm/SourceLocation.cpp
@@ -22,7 +22,7 @@
#include <libevmasm/SourceLocation.h>
-#include "../TestHelper.h"
+#include <test/Options.h>
namespace dev
{
diff --git a/test/libjulia/Common.cpp b/test/libjulia/Common.cpp
index 41f5d320..24519b01 100644
--- a/test/libjulia/Common.cpp
+++ b/test/libjulia/Common.cpp
@@ -21,7 +21,7 @@
#include <test/libjulia/Common.h>
-#include <test/TestHelper.h>
+#include <test/Options.h>
#include <libjulia/optimiser/Disambiguator.h>
diff --git a/test/libjulia/Parser.cpp b/test/libjulia/Parser.cpp
index df905dd6..9d66658e 100644
--- a/test/libjulia/Parser.cpp
+++ b/test/libjulia/Parser.cpp
@@ -19,7 +19,7 @@
* Unit tests for parsing Julia.
*/
-#include "../TestHelper.h"
+#include <test/Options.h>
#include <test/libsolidity/ErrorCheck.h>
diff --git a/test/liblll/Compiler.cpp b/test/liblll/Compiler.cpp
index 6c6eae3f..ebdea185 100644
--- a/test/liblll/Compiler.cpp
+++ b/test/liblll/Compiler.cpp
@@ -20,7 +20,7 @@
* Unit tests for the LLL compiler.
*/
-#include <test/TestHelper.h>
+#include <test/Options.h>
#include <libdevcore/FixedHash.h>
diff --git a/test/liblll/EndToEndTest.cpp b/test/liblll/EndToEndTest.cpp
index e5e70cf8..fd8099f2 100644
--- a/test/liblll/EndToEndTest.cpp
+++ b/test/liblll/EndToEndTest.cpp
@@ -21,7 +21,7 @@
*/
#include <test/liblll/ExecutionFramework.h>
-#include <test/TestHelper.h>
+#include <test/Options.h>
#include <boost/test/unit_test.hpp>
diff --git a/test/libsolidity/ASTJSON.cpp b/test/libsolidity/ASTJSON.cpp
index 9bf60b64..b44dd331 100644
--- a/test/libsolidity/ASTJSON.cpp
+++ b/test/libsolidity/ASTJSON.cpp
@@ -20,7 +20,7 @@
* Tests for the json ast output.
*/
-#include <test/TestHelper.h>
+#include <test/Options.h>
#include <libsolidity/interface/Exceptions.h>
#include <libsolidity/interface/CompilerStack.h>
diff --git a/test/libsolidity/AnalysisFramework.cpp b/test/libsolidity/AnalysisFramework.cpp
index 7c335a48..4538757d 100644
--- a/test/libsolidity/AnalysisFramework.cpp
+++ b/test/libsolidity/AnalysisFramework.cpp
@@ -20,7 +20,7 @@
#include <test/libsolidity/AnalysisFramework.h>
-#include <test/TestHelper.h>
+#include <test/Options.h>
#include <libsolidity/interface/CompilerStack.h>
#include <libsolidity/interface/SourceReferenceFormatter.h>
diff --git a/test/libsolidity/Assembly.cpp b/test/libsolidity/Assembly.cpp
index aff610a4..5519ae0d 100644
--- a/test/libsolidity/Assembly.cpp
+++ b/test/libsolidity/Assembly.cpp
@@ -20,7 +20,7 @@
* Unit tests for Assembly Items from evmasm/Assembly.h
*/
-#include <test/TestHelper.h>
+#include <test/Options.h>
#include <libevmasm/SourceLocation.h>
#include <libevmasm/Assembly.h>
diff --git a/test/libsolidity/Imports.cpp b/test/libsolidity/Imports.cpp
index bc81b3b1..1b5dd4a5 100644
--- a/test/libsolidity/Imports.cpp
+++ b/test/libsolidity/Imports.cpp
@@ -21,7 +21,7 @@
*/
#include <test/libsolidity/ErrorCheck.h>
-#include <test/TestHelper.h>
+#include <test/Options.h>
#include <libsolidity/interface/Exceptions.h>
#include <libsolidity/interface/CompilerStack.h>
diff --git a/test/libsolidity/InlineAssembly.cpp b/test/libsolidity/InlineAssembly.cpp
index a4dcc4d5..34ca33e3 100644
--- a/test/libsolidity/InlineAssembly.cpp
+++ b/test/libsolidity/InlineAssembly.cpp
@@ -20,7 +20,7 @@
* Unit tests for inline assembly.
*/
-#include "../TestHelper.h"
+#include <test/Options.h>
#include <libsolidity/interface/AssemblyStack.h>
#include <libsolidity/parsing/Scanner.h>
diff --git a/test/libsolidity/JSONCompiler.cpp b/test/libsolidity/JSONCompiler.cpp
index 285c5604..aed0a370 100644
--- a/test/libsolidity/JSONCompiler.cpp
+++ b/test/libsolidity/JSONCompiler.cpp
@@ -25,8 +25,8 @@
#include <libsolidity/interface/Version.h>
#include <libsolc/libsolc.h>
-#include "../Metadata.h"
-#include "../TestHelper.h"
+#include <test/Metadata.h>
+#include <test/Options.h>
using namespace std;
diff --git a/test/libsolidity/Metadata.cpp b/test/libsolidity/Metadata.cpp
index f1edeeb7..808bd1e1 100644
--- a/test/libsolidity/Metadata.cpp
+++ b/test/libsolidity/Metadata.cpp
@@ -19,8 +19,8 @@
* Unit tests for the metadata output.
*/
-#include "../Metadata.h"
-#include "../TestHelper.h"
+#include <test/Metadata.h>
+#include <test/Options.h>
#include <libsolidity/interface/CompilerStack.h>
#include <libdevcore/SwarmHash.h>
#include <libdevcore/JSON.h>
diff --git a/test/libsolidity/SemVerMatcher.cpp b/test/libsolidity/SemVerMatcher.cpp
index 08ef5277..07f8fba6 100644
--- a/test/libsolidity/SemVerMatcher.cpp
+++ b/test/libsolidity/SemVerMatcher.cpp
@@ -25,7 +25,7 @@
#include <tuple>
#include <libsolidity/parsing/Scanner.h>
#include <libsolidity/analysis/SemVerHandler.h>
-#include "../TestHelper.h"
+#include <test/Options.h>
using namespace std;
diff --git a/test/libsolidity/SolidityABIJSON.cpp b/test/libsolidity/SolidityABIJSON.cpp
index 0d471b32..107abc26 100644
--- a/test/libsolidity/SolidityABIJSON.cpp
+++ b/test/libsolidity/SolidityABIJSON.cpp
@@ -20,7 +20,7 @@
* Unit tests for the solidity compiler JSON Interface output.
*/
-#include "../TestHelper.h"
+#include <test/Options.h>
#include <libsolidity/interface/CompilerStack.h>
#include <libdevcore/Exceptions.h>
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index a080fe71..d72f3350 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -23,7 +23,7 @@
#include <test/libsolidity/SolidityExecutionFramework.h>
-#include <test/TestHelper.h>
+#include <test/Options.h>
#include <libsolidity/interface/Exceptions.h>
#include <libsolidity/interface/EVMVersion.h>
diff --git a/test/libsolidity/SolidityExpressionCompiler.cpp b/test/libsolidity/SolidityExpressionCompiler.cpp
index 5f044b44..c8adfc6e 100644
--- a/test/libsolidity/SolidityExpressionCompiler.cpp
+++ b/test/libsolidity/SolidityExpressionCompiler.cpp
@@ -30,7 +30,7 @@
#include <libsolidity/ast/AST.h>
#include <libsolidity/analysis/TypeChecker.h>
#include <libsolidity/interface/ErrorReporter.h>
-#include "../TestHelper.h"
+#include <test/Options.h>
using namespace std;
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 1f76c01b..c757037c 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -22,7 +22,7 @@
#include <test/libsolidity/AnalysisFramework.h>
-#include <test/TestHelper.h>
+#include <test/Options.h>
#include <libsolidity/ast/AST.h>
diff --git a/test/libsolidity/SolidityNatspecJSON.cpp b/test/libsolidity/SolidityNatspecJSON.cpp
index 49a725e0..eeebeb74 100644
--- a/test/libsolidity/SolidityNatspecJSON.cpp
+++ b/test/libsolidity/SolidityNatspecJSON.cpp
@@ -20,7 +20,7 @@
* Unit tests for the solidity compiler JSON Interface output.
*/
-#include "../TestHelper.h"
+#include <test/Options.h>
#include <string>
#include <libdevcore/JSON.h>
#include <libsolidity/interface/CompilerStack.h>
diff --git a/test/libsolidity/SolidityParser.cpp b/test/libsolidity/SolidityParser.cpp
index f03b30e1..4e862f60 100644
--- a/test/libsolidity/SolidityParser.cpp
+++ b/test/libsolidity/SolidityParser.cpp
@@ -25,8 +25,8 @@
#include <libsolidity/parsing/Scanner.h>
#include <libsolidity/parsing/Parser.h>
#include <libsolidity/interface/ErrorReporter.h>
-#include "../TestHelper.h"
-#include "ErrorCheck.h"
+#include <test/Options.h>
+#include <test/libsolidity/ErrorCheck.h>
using namespace std;
diff --git a/test/libsolidity/ViewPureChecker.cpp b/test/libsolidity/ViewPureChecker.cpp
index 26ff461c..a6ce6d91 100644
--- a/test/libsolidity/ViewPureChecker.cpp
+++ b/test/libsolidity/ViewPureChecker.cpp
@@ -20,7 +20,7 @@
#include <test/libsolidity/AnalysisFramework.h>
-#include <test/TestHelper.h>
+#include <test/Options.h>
#include <boost/test/unit_test.hpp>