Skip to content

Commit

Permalink
modify travis to run ut
Browse files Browse the repository at this point in the history
  • Loading branch information
bxq2011hust committed Apr 8, 2019
1 parent 24e2731 commit ae0023a
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ addons:
install: |
bash tools/ci/check-commit.sh;
script: |
mkdir -p build && cd build && CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake .. && make -j2 && \
cd ../tools && bash ci/ci_check.sh
mkdir -p build && cd build && CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake .. && \
make -j2 && cd ../tools && bash ci/ci_check.sh
after_success:
# if [ $TRAVIS_OS_NAME == linux ]; then
# cd $TRAVIS_BUILD_DIR && bash <(curl -s https://codecov.io/bash)
Expand Down
6 changes: 5 additions & 1 deletion fisco-bcos/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,15 @@ string initCommandLine(int argc, const char* argv[])
version();
exit(0);
}
string configPath;
string configPath("./config.ini");
if (vm.count("config") || vm.count("c"))
{
configPath = vm["config"].as<std::string>();
}
else if (boost::filesystem::exists(configPath))
{
std::cout << "use default configPath : " << configPath << std::endl;
}
else
{
std::cout << main_options << std::endl;
Expand Down
10 changes: 3 additions & 7 deletions libblockchain/BlockChainImp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1143,12 +1143,8 @@ CommitResult BlockChainImp::commitBlock(Block& block, std::shared_ptr<ExecutiveC
/// leveldb caused exception: database corruption or the disk has no space left
catch (StorageException& e)
{
if (e.errorCode() == -1)
{
BLOCKCHAIN_LOG(FATAL) << LOG_BADGE("CommitBlock: leveldb exception")
<< LOG_KV("EINFO", boost::diagnostic_information(e));
exit(-1);
}
throw;
BLOCKCHAIN_LOG(FATAL) << LOG_BADGE("CommitBlock: leveldb exception")
<< LOG_KV("EINFO", boost::diagnostic_information(e));
exit(1);
}
}
12 changes: 6 additions & 6 deletions libexecutive/Executive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,11 @@ bool Executive::go(OnOpFunc const& _onOp)
m_excepted = toTransactionException(_e);
revert();
}
catch (PermissionDenied const& _e)
{
revert();
m_excepted = TransactionException::PermissionDenied;
}
catch (InternalVMError const& _e)
{
using errinfo_evmcStatusCode =
Expand All @@ -367,12 +372,7 @@ bool Executive::go(OnOpFunc const& _onOp)
<< *boost::get_error_info<errinfo_evmcStatusCode>(_e) << ")\n"
<< diagnostic_information(_e);
revert();
throw _e;
}
catch (PermissionDenied const& _e)
{
revert();
m_excepted = TransactionException::PermissionDenied;
exit(1);
}
catch (Exception const& _e)
{
Expand Down
1 change: 1 addition & 0 deletions libstorage/LevelDBStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ size_t LevelDBStorage::commit(
}
catch (std::exception& e)
{
// This should never happen, if happened exit.
STORAGE_LEVELDB_LOG(ERROR) << LOG_DESC("Commit leveldb exception")
<< LOG_KV("msg", boost::diagnostic_information(e));
BOOST_THROW_EXCEPTION(e);
Expand Down
2 changes: 1 addition & 1 deletion libsync/SyncMaster.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class SyncMaster : public SyncInterface, public Worker
PROTOCOL_ID const& _protocolId, NodeID const& _nodeId, h256 const& _genesisHash,
unsigned _idleWaitMs = 200)
: SyncInterface(),
Worker("SyncMaster-" + std::to_string(_protocolId), _idleWaitMs),
Worker("Sync-" + std::to_string(_protocolId), _idleWaitMs),
m_service(_service),
m_txPool(_txPool),
m_blockChain(_blockChain),
Expand Down
16 changes: 8 additions & 8 deletions test/unittests/libnetwork/FakeSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ class FakeSocket : public SocketFace, public std::enable_shared_from_this<FakeSo
}
~FakeSocket() { close(); }

virtual bool isConnected() const override { return m_wsSocket->lowest_layer().is_open(); }
bool isConnected() const override { return m_wsSocket->lowest_layer().is_open(); }

virtual void close() override
void close() override
{
try
{
Expand All @@ -67,20 +67,20 @@ class FakeSocket : public SocketFace, public std::enable_shared_from_this<FakeSo
}
}

virtual bi::tcp::endpoint remoteEndpoint() override
bi::tcp::endpoint remoteEndpoint() override
{
return m_wsSocket->lowest_layer().remote_endpoint();
}

virtual bi::tcp::socket& ref() override { return m_wsSocket->next_layer().next_layer(); }
virtual ba::ssl::stream<bi::tcp::socket>& sslref() override { return m_wsSocket->next_layer(); }
virtual boost::beast::websocket::stream<ba::ssl::stream<bi::tcp::socket>>& wsref() override
bi::tcp::socket& ref() override { return m_wsSocket->next_layer().next_layer(); }
ba::ssl::stream<bi::tcp::socket>& sslref() override { return m_wsSocket->next_layer(); }
boost::beast::websocket::stream<ba::ssl::stream<bi::tcp::socket>>& wsref() override
{
return *m_wsSocket;
}

virtual const NodeIPEndpoint& nodeIPEndpoint() const override { return m_nodeIPEndpoint; }
virtual void setNodeIPEndpoint(NodeIPEndpoint _nodeIPEndpoint) override
const NodeIPEndpoint& nodeIPEndpoint() const override { return m_nodeIPEndpoint; }
void setNodeIPEndpoint(NodeIPEndpoint _nodeIPEndpoint) override
{
m_nodeIPEndpoint = _nodeIPEndpoint;
}
Expand Down
2 changes: 1 addition & 1 deletion tools/build_chain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ if [ ! -z \${node_pid} ];then
exit 0
else
${start_cmd} &
sleep 2
sleep 2.5
fi
node_pid=${ps_cmd}
if [ ! -z \${node_pid} ];then
Expand Down

0 comments on commit ae0023a

Please sign in to comment.