minor fixes, tests update
This commit is contained in:
parent
d84906d84f
commit
0b92beda57
@ -39,5 +39,5 @@ exe getting_started
|
||||
;
|
||||
|
||||
exe load_self
|
||||
: load_self.cpp
|
||||
: tutorail3/load_self.cpp
|
||||
;
|
||||
|
@ -1,38 +0,0 @@
|
||||
#
|
||||
# Copyright Renato Tegon Forti 2011 - 2013.
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
#
|
||||
|
||||
project
|
||||
: source-location .
|
||||
: requirements
|
||||
|
||||
# linux
|
||||
<target-os>linux:<linkflags>"-ldl"
|
||||
|
||||
# others
|
||||
<link>shared:<define>BOOST_ALL_DLL
|
||||
<library>/boost/system//boost_system
|
||||
<library>/boost/filesystem//boost_filesystem
|
||||
<threading>multi
|
||||
;
|
||||
|
||||
# our example plugin lib
|
||||
lib plugin_library : plugin_library.cpp ;
|
||||
lib getting_started_library : getting_started_library.cpp ;
|
||||
install install-bin
|
||||
: plugin_library getting_started_library :
|
||||
<target-os>windows:<location>"C:/test/boost/application"
|
||||
<target-os>linux:<location>/test/boost/application ;
|
||||
|
||||
|
||||
# shared library sub-system
|
||||
exe shared_library_load_plugin
|
||||
: shared_library_load_plugin.cpp
|
||||
;
|
||||
|
||||
exe getting_started
|
||||
: getting_started.cpp
|
||||
;
|
@ -13,11 +13,6 @@
|
||||
#include <boost/plugin.hpp>
|
||||
#include <iostream>
|
||||
|
||||
extern "C" BOOST_SYMBOL_EXPORT int sumexe(int x, int y)
|
||||
{
|
||||
return x+y;
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
std::cout << "Application started" << std::endl;
|
||||
|
17
example/tutorial3/static_plugin.cpp
Normal file
17
example/tutorial3/static_plugin.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
// Copyright 2011-2012 Renato Tegon Forti
|
||||
// Copyright 2014 Renato Tegon Forti, Antony Polukhin.
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt
|
||||
// or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/plugin/alias.hpp>
|
||||
|
||||
extern "C" BOOST_SYMBOL_EXPORT int sumexe(int x, int y)
|
||||
{
|
||||
return x+y;
|
||||
}
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include <boost/plugin/shared_library_types.hpp>
|
||||
#include <boost/plugin/shared_library_load_mode.hpp>
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/move/move.hpp>
|
||||
#include <boost/swap.hpp>
|
||||
|
||||
@ -40,7 +39,7 @@
|
||||
|
||||
namespace boost { namespace plugin {
|
||||
|
||||
class shared_library_impl : noncopyable {
|
||||
class shared_library_impl {
|
||||
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(shared_library_impl)
|
||||
|
||||
@ -94,7 +93,7 @@ public:
|
||||
// "handle" for the dynamic library. If filename is NULL, then the
|
||||
// returned handle is for the main program.
|
||||
|
||||
handle_ = dlopen(NULL, DLOPEN_LAZY | DLOPEN_GLOBAL | RTLD_DEEPBIND);
|
||||
handle_ = dlopen(NULL, RTLD_LAZY);
|
||||
|
||||
if (!handle_) {
|
||||
ec = boost::system::error_code(
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include <boost/plugin/shared_library_types.hpp>
|
||||
#include <boost/plugin/shared_library_load_mode.hpp>
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/move/move.hpp>
|
||||
#include <boost/swap.hpp>
|
||||
#include <boost/filesystem/path.hpp>
|
||||
@ -29,7 +28,7 @@
|
||||
|
||||
namespace boost { namespace plugin {
|
||||
|
||||
class shared_library_impl : noncopyable {
|
||||
class shared_library_impl {
|
||||
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(shared_library_impl)
|
||||
|
||||
|
@ -201,7 +201,7 @@ public:
|
||||
base_t::load_self(ec);
|
||||
|
||||
if (ec) {
|
||||
boost::plugin::detail::report_error(ec, "load() failed");
|
||||
boost::plugin::detail::report_error(ec, "load_self() failed");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,10 @@
|
||||
import testing ;
|
||||
import path ;
|
||||
|
||||
path-constant TEST_DIR : $(BOOST_ROOT)/bin.v2/libs/application/test ;
|
||||
path-constant TEST_DIR : $(BOOST_ROOT)/bin.v2/libs/plugin/test ;
|
||||
|
||||
# Static library that is not linked with any of the boost libs
|
||||
lib static_plugin : ../example/tutorial3/static_plugin.cpp : <link>static : : <target-os>linux:<cxxflags>"-rdynamic" ;
|
||||
|
||||
project
|
||||
: source-location .
|
||||
@ -21,11 +24,10 @@ project
|
||||
<target-os>linux:<linkflags>"-ldl"
|
||||
|
||||
# others
|
||||
<link>shared:<define>BOOST_ALL_DLL
|
||||
<link>shared:<define>BOOST_ALL_DLL
|
||||
<library>/boost/system//boost_system
|
||||
<library>/boost/filesystem//boost_filesystem
|
||||
<threading>multi
|
||||
|
||||
;
|
||||
{
|
||||
|
||||
@ -39,11 +41,12 @@ project
|
||||
test-suite application
|
||||
:
|
||||
[ run shared_library_load_test.cpp : $(TEST_DIR) ]
|
||||
[ run shared_library_search_symbol_test.cpp : $(TEST_DIR) ]
|
||||
[ run shared_library_get_symbol_test.cpp : $(TEST_DIR) ]
|
||||
[ run shared_library_search_symbol_test.cpp : $(TEST_DIR) : : <target-os>linux:<linkflags>"-rdynamic" ]
|
||||
[ run shared_library_get_symbol_test.cpp : $(TEST_DIR) : : <target-os>linux:<linkflags>"-rdynamic" ]
|
||||
[ run shared_library_errors.cpp : $(TEST_DIR) : : <test-info>always_show_run_output ]
|
||||
[ run ../example/getting_started.cpp : $(TEST_DIR) ]
|
||||
[ run ../example/tutorial1/tutorial1.cpp : $(TEST_DIR) ]
|
||||
[ run ../example/tutorial2/tutorial2.cpp : $(TEST_DIR) ]
|
||||
[ run ../example/tutorial3/load_self.cpp : : : <library>static_plugin ]
|
||||
;
|
||||
}
|
||||
|
@ -1,47 +0,0 @@
|
||||
#
|
||||
# Copyright Renato Tegon Forti 2011 - 2013.
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
#
|
||||
|
||||
# For more information, see http://www.boost.org
|
||||
|
||||
# bring in rules for testing
|
||||
import testing ;
|
||||
import path ;
|
||||
|
||||
path-constant TEST_DIR : $(BOOST_ROOT)/bin.v2/libs/application/test ;
|
||||
|
||||
project
|
||||
: source-location .
|
||||
: requirements
|
||||
|
||||
# linux
|
||||
<target-os>linux:<linkflags>"-ldl"
|
||||
|
||||
# others
|
||||
<link>shared:<define>BOOST_ALL_DLL
|
||||
<library>/boost/system//boost_system
|
||||
<library>/boost/filesystem//boost_filesystem
|
||||
<threading>multi
|
||||
|
||||
;
|
||||
{
|
||||
|
||||
# our test lib for shared library tests
|
||||
lib test_library : test_library.cpp ;
|
||||
lib getting_started_library : ../example/getting_started_library.cpp ;
|
||||
lib plugin_library : ../example/plugin_library.cpp ;
|
||||
install install-bin : test_library plugin_library getting_started_library : <location>$(TEST_DIR) ;
|
||||
|
||||
test-suite application
|
||||
:
|
||||
[ run shared_library_load_test.cpp : $(TEST_DIR) ]
|
||||
[ run shared_library_search_symbol_test.cpp : $(TEST_DIR) ]
|
||||
[ run shared_library_get_symbol_test.cpp : $(TEST_DIR) ]
|
||||
[ run shared_library_errors.cpp : $(TEST_DIR) : : <test-info>always_show_run_output ]
|
||||
[ run ../example/shared_library_load_plugin.cpp : $(TEST_DIR) ]
|
||||
[ run ../example/getting_started.cpp : $(TEST_DIR) ]
|
||||
;
|
||||
}
|
@ -105,7 +105,7 @@ void refcountable_test(boost::filesystem::path shared_library_path) {
|
||||
}
|
||||
|
||||
// exe function
|
||||
extern "C" BOOST_SYMBOL_EXPORT int exef() {
|
||||
extern "C" int BOOST_SYMBOL_EXPORT exef() {
|
||||
return 15;
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "../example/shared_lib_path.hpp"
|
||||
// Unit Tests
|
||||
|
||||
extern "C" BOOST_SYMBOL_EXPORT void exef() {
|
||||
extern "C" void BOOST_SYMBOL_EXPORT exef() {
|
||||
}
|
||||
|
||||
int test_main(int argc, char* argv[])
|
||||
|
Loading…
Reference in New Issue
Block a user