test: Rename test/TestHelper.* to test/Options.* and add Options::validate().

This commit is contained in:
Daniel Kirchner 2018-03-14 12:04:04 +01:00
parent a5d9b05acb
commit d63d41b3b5
33 changed files with 51 additions and 39 deletions

View File

@ -22,7 +22,7 @@
#pragma once
#include <test/TestHelper.h>
#include <test/Options.h>
#include <test/RPCSession.h>
#include <libsolidity/interface/EVMVersion.h>

View File

@ -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())

View File

@ -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();

View File

@ -21,7 +21,7 @@
#include <test/RPCSession.h>
#include <test/TestHelper.h>
#include <test/Options.h>
#include <libsolidity/interface/EVMVersion.h>

View File

@ -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",

View File

@ -22,7 +22,7 @@
#include <libdevcore/Exceptions.h>
#include "../TestHelper.h"
#include <test/Options.h>
using namespace std;

View File

@ -20,7 +20,7 @@
#include <libdevcore/IndentedWriter.h>
#include "../TestHelper.h"
#include <test/Options.h>
using namespace std;

View File

@ -21,7 +21,7 @@
#include <libdevcore/JSON.h>
#include "../TestHelper.h"
#include <test/Options.h>
using namespace std;

View File

@ -20,7 +20,7 @@
#include <libdevcore/StringUtils.h>
#include "../TestHelper.h"
#include <test/Options.h>
using namespace std;

View File

@ -20,7 +20,7 @@
#include <libdevcore/SwarmHash.h>
#include "../TestHelper.h"
#include <test/Options.h>
using namespace std;

View File

@ -21,7 +21,7 @@
#include <libdevcore/CommonData.h>
#include <libdevcore/UTF8.h>
#include "../TestHelper.h"
#include <test/Options.h>
using namespace std;

View File

@ -20,7 +20,7 @@
#include <libdevcore/Whiskers.h>
#include "../TestHelper.h"
#include <test/Options.h>
using namespace std;

View File

@ -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>

View File

@ -22,7 +22,7 @@
#include <libevmasm/SourceLocation.h>
#include "../TestHelper.h"
#include <test/Options.h>
namespace dev
{

View File

@ -21,7 +21,7 @@
#include <test/libjulia/Common.h>
#include <test/TestHelper.h>
#include <test/Options.h>
#include <libjulia/optimiser/Disambiguator.h>

View File

@ -19,7 +19,7 @@
* Unit tests for parsing Julia.
*/
#include "../TestHelper.h"
#include <test/Options.h>
#include <test/libsolidity/ErrorCheck.h>

View File

@ -20,7 +20,7 @@
* Unit tests for the LLL compiler.
*/
#include <test/TestHelper.h>
#include <test/Options.h>
#include <libdevcore/FixedHash.h>

View File

@ -21,7 +21,7 @@
*/
#include <test/liblll/ExecutionFramework.h>
#include <test/TestHelper.h>
#include <test/Options.h>
#include <boost/test/unit_test.hpp>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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;

View File

@ -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>

View File

@ -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;

View File

@ -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>

View File

@ -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>

View File

@ -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;

View File

@ -22,7 +22,7 @@
#include <test/libsolidity/AnalysisFramework.h>
#include <test/TestHelper.h>
#include <test/Options.h>
#include <libsolidity/ast/AST.h>

View File

@ -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>

View File

@ -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;

View File

@ -20,7 +20,7 @@
#include <test/libsolidity/AnalysisFramework.h>
#include <test/TestHelper.h>
#include <test/Options.h>
#include <boost/test/unit_test.hpp>