aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-07-18 21:40:24 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-07-18 22:33:38 +0800
commit6e4150a5cf919f6e1cbdc8167baaba48915954ae (patch)
tree08f2dd5a1cd0160451d019afdf8791612b9072ac /test/libsolidity
parente9226225d7675e5d5cd03759a813ef79e3d3c590 (diff)
downloaddexon-solidity-6e4150a5cf919f6e1cbdc8167baaba48915954ae.tar.gz
dexon-solidity-6e4150a5cf919f6e1cbdc8167baaba48915954ae.tar.zst
dexon-solidity-6e4150a5cf919f6e1cbdc8167baaba48915954ae.zip
Test for version/license in jsonCompiler
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/JSONCompiler.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/libsolidity/JSONCompiler.cpp b/test/libsolidity/JSONCompiler.cpp
index aa690f0b..a6a7bc5b 100644
--- a/test/libsolidity/JSONCompiler.cpp
+++ b/test/libsolidity/JSONCompiler.cpp
@@ -24,6 +24,7 @@
#include <regex>
#include <boost/test/unit_test.hpp>
#include <libdevcore/JSON.h>
+#include <libsolidity/interface/Version.h>
#include "../Metadata.h"
#include "../TestHelper.h"
@@ -32,6 +33,8 @@ using namespace std;
extern "C"
{
+extern char const* version();
+extern char const* license();
extern char const* compileJSONMulti(char const* _input, bool _optimize);
}
@@ -57,6 +60,18 @@ Json::Value compile(string const& _input)
BOOST_AUTO_TEST_SUITE(JSONCompiler)
+BOOST_AUTO_TEST_CASE(read_version)
+{
+ string output(version());
+ BOOST_CHECK(output.find(VersionString) == 0);
+}
+
+BOOST_AUTO_TEST_CASE(read_license)
+{
+ string output(license());
+ BOOST_CHECK(output.find("GNU GENERAL PUBLIC LICENSE") != string::npos);
+}
+
BOOST_AUTO_TEST_CASE(basic_compilation)
{
char const* input = R"(