forked from premiere/premiere-libtorrent
Merge pull request #106 from arvidn/msvc-64bits
fix 64 bit builds on windows
This commit is contained in:
commit
73d6bc8380
97
appveyor.yml
97
appveyor.yml
|
@ -6,21 +6,44 @@ os: Visual Studio 2015
|
|||
clone_depth: 1
|
||||
environment:
|
||||
matrix:
|
||||
- variant: test_debug
|
||||
compiler: msvc-14.0
|
||||
sim: 1
|
||||
linkflags32: '"/LIBPATH:C:\\openssl-1.0.1p-vs2015\\lib"'
|
||||
linkflags64: '"/LIBPATH:C:\\openssl-1.0.1p-vs2015\\lib64"'
|
||||
include: '"c:\\openssl-1.0.1p-vs2015\\include"'
|
||||
- variant: test_debug
|
||||
compiler: msvc-12.0
|
||||
linkflags: '"/LIBPATH:C:\\OpenSSL-Win32\\lib"'
|
||||
x64: 1
|
||||
linkflags32: '"/LIBPATH:C:\\openssl-1.0.1p-vs2013\\lib"'
|
||||
linkflags64: '"/LIBPATH:C:\\openssl-1.0.1p-vs2013\\lib64"'
|
||||
include: '"c:\\openssl-1.0.1p-vs2013\\include"'
|
||||
- variant: test_debug
|
||||
compiler: msvc-12.0
|
||||
linkflags32: '"/LIBPATH:C:\\openssl-1.0.1p-vs2013\\lib"'
|
||||
linkflags64: '"/LIBPATH:C:\\openssl-1.0.1p-vs2013\\lib64"'
|
||||
include: '"c:\\openssl-1.0.1p-vs2013\\include"'
|
||||
- variant: test_debug
|
||||
compiler: msvc-10.0
|
||||
linkflags: '"/LIBPATH:C:\\OpenSSL-Win32\\lib"'
|
||||
- variant: test_debug
|
||||
compiler: msvc-14.0
|
||||
linkflags: '"/LIBPATH:C:\\OpenSSL-Win32\\lib"'
|
||||
linkflags32: '"/LIBPATH:C:\\openssl-1.0.1p-vs2010\\lib"'
|
||||
linkflags64: '"/LIBPATH:C:\\openssl-1.0.1p-vs2010\\lib64"'
|
||||
include: '"c:\\openssl-1.0.1p-vs2010\\include"'
|
||||
- variant: test_barebones
|
||||
compiler: msvc-12.0
|
||||
linkflags: '"/LIBPATH:C:\\OpenSSL-Win32\\lib"'
|
||||
linkflags32: '"/LIBPATH:C:\\openssl-1.0.1p-vs2013\\lib"'
|
||||
linkflags64: '"/LIBPATH:C:\\openssl-1.0.1p-vs2013\\lib64"'
|
||||
include: '"c:\\openssl-1.0.1p-vs2013\\include"'
|
||||
- variant: test_barebones
|
||||
compiler: msvc-12.0
|
||||
x64: 1
|
||||
linkflags32: '"/LIBPATH:C:\\openssl-1.0.1p-vs2013\\lib"'
|
||||
linkflags64: '"/LIBPATH:C:\\openssl-1.0.1p-vs2013\\lib64"'
|
||||
include: '"c:\\openssl-1.0.1p-vs2013\\include"'
|
||||
- variant: test_release
|
||||
compiler: msvc-12.0
|
||||
linkflags: '"/LIBPATH:C:\\OpenSSL-Win32\\lib"'
|
||||
linkflags32: '"/LIBPATH:C:\\openssl-1.0.1p-vs2013\\lib"'
|
||||
linkflags64: '"/LIBPATH:C:\\openssl-1.0.1p-vs2013\\lib64"'
|
||||
include: '"c:\\openssl-1.0.1p-vs2013\\include"'
|
||||
|
||||
# mingw and boost.random don't like each other. Comment this back in once there
|
||||
# is support
|
||||
|
@ -33,11 +56,36 @@ install:
|
|||
- git submodule update --init --recursive
|
||||
- set ROOT_DIRECTORY=%CD%
|
||||
- cd %ROOT_DIRECTORY%
|
||||
- if not exist c:\OpenSSL-Win32\nul (
|
||||
appveyor DownloadFile https://strcpy.net/packages/Win32OpenSSL-1_0_2a.exe
|
||||
&& Win32OpenSSL-1_0_2a.exe /silent /verysilent /sp- /suppressmsgboxes )
|
||||
- copy c:\OpenSSL-Win32\ssleay32.dll %WINDIR%\system32
|
||||
- copy c:\OpenSSL-Win32\libeay32.dll %WINDIR%\system32
|
||||
- if %compiler% == msvc-12.0 (
|
||||
if not exist openssl-1.0.1p-vs2013.7z (
|
||||
appveyor DownloadFile http://www.npcglib.org/~stathis/downloads/openssl-1.0.1p-vs2013.7z
|
||||
)
|
||||
& 7z x -oc:\ -aoa openssl-1.0.1p-vs2013.7z
|
||||
& copy c:\openssl-1.0.1p-vs2013\lib64\ssleay32MT.lib c:\openssl-1.0.1p-vs2013\lib64\ssleay32.lib
|
||||
& copy c:\openssl-1.0.1p-vs2013\lib64\libeay32MT.lib c:\openssl-1.0.1p-vs2013\lib64\libeay32.lib
|
||||
& copy c:\openssl-1.0.1p-vs2013\lib\ssleay32MT.lib c:\openssl-1.0.1p-vs2013\lib\ssleay32.lib
|
||||
& copy c:\openssl-1.0.1p-vs2013\lib\libeay32MT.lib c:\openssl-1.0.1p-vs2013\lib\libeay32.lib
|
||||
)
|
||||
- if %compiler% == msvc-10.0 (
|
||||
if not exist openssl-1.0.1p-vs2010.7z (
|
||||
appveyor DownloadFile http://www.npcglib.org/~stathis/downloads/openssl-1.0.1p-vs2010.7z
|
||||
)
|
||||
& 7z x -oc:\ -aoa openssl-1.0.1p-vs2010.7z
|
||||
& copy c:\openssl-1.0.1p-vs2010\lib64\ssleay32MT.lib c:\openssl-1.0.1p-vs2010\lib64\ssleay32.lib
|
||||
& copy c:\openssl-1.0.1p-vs2010\lib64\libeay32MT.lib c:\openssl-1.0.1p-vs2010\lib64\libeay32.lib
|
||||
& copy c:\openssl-1.0.1p-vs2010\lib\ssleay32MT.lib c:\openssl-1.0.1p-vs2010\lib\ssleay32.lib
|
||||
& copy c:\openssl-1.0.1p-vs2010\lib\libeay32MT.lib c:\openssl-1.0.1p-vs2010\lib\libeay32.lib
|
||||
)
|
||||
- if %compiler% == msvc-14.0 (
|
||||
if not exist openssl-1.0.1p-vs2015.7z (
|
||||
appveyor DownloadFile http://www.npcglib.org/~stathis/downloads/openssl-1.0.1p-vs2015.7z
|
||||
)
|
||||
& 7z x -oc:\ -aoa openssl-1.0.1p-vs2015.7z
|
||||
& copy c:\openssl-1.0.1p-vs2015\lib64\ssleay32MT.lib c:\openssl-1.0.1p-vs2015\lib64\ssleay32.lib
|
||||
& copy c:\openssl-1.0.1p-vs2015\lib64\libeay32MT.lib c:\openssl-1.0.1p-vs2015\lib64\libeay32.lib
|
||||
& copy c:\openssl-1.0.1p-vs2015\lib\ssleay32MT.lib c:\openssl-1.0.1p-vs2015\lib\ssleay32.lib
|
||||
& copy c:\openssl-1.0.1p-vs2015\lib\libeay32MT.lib c:\openssl-1.0.1p-vs2015\lib\libeay32.lib
|
||||
)
|
||||
- cd %ROOT_DIRECTORY%
|
||||
- set BOOST_ROOT=c:\Libraries\boost
|
||||
- set BOOST_BUILD_PATH=%BOOST_ROOT%\tools\build
|
||||
|
@ -55,16 +103,23 @@ install:
|
|||
- python --version
|
||||
- echo %ROOT_DIRECTORY%
|
||||
cache:
|
||||
- C:\OpenSSL-Win32
|
||||
- openssl-1.0.1p-vs2010.7z
|
||||
- openssl-1.0.1p-vs2013.7z
|
||||
- openssl-1.0.1p-vs2015.7z
|
||||
build_script:
|
||||
- cd %ROOT_DIRECTORY%\examples
|
||||
- b2.exe --hash -j2 %compiler% variant=%variant% linkflags=%linkflags% include="C:\\OpenSSL-Win32\\include"
|
||||
- cd %ROOT_DIRECTORY%\test
|
||||
- b2.exe --hash -j2 address-model=32 win-tests %compiler% variant=%variant% link=shared linkflags=%linkflags% include="C:\\OpenSSL-Win32\\include"
|
||||
- cd %ROOT_DIRECTORY%\bindings\python
|
||||
- b2.exe --hash -j2 %compiler% variant=%variant% linkflags=%linkflags% include="C:\\OpenSSL-Win32\\include" stage_module
|
||||
- python test.py
|
||||
- if %variant% == "test_debug" (
|
||||
- if defined x64 (
|
||||
b2.exe --hash -j2 address-model=64 win-tests %compiler% variant=%variant% link=shared linkflags=%linkflags64% include=%include%
|
||||
) else (
|
||||
b2.exe --hash -j2 address-model=32 win-tests %compiler% variant=%variant% link=shared linkflags=%linkflags32% include=%include%
|
||||
& cd %ROOT_DIRECTORY%\examples
|
||||
& b2.exe --hash -j2 %compiler% variant=%variant% linkflags=%linkflags32% include=%include%
|
||||
& cd %ROOT_DIRECTORY%\bindings\python
|
||||
& b2.exe --hash -j2 %compiler% stage_module variant=%variant% linkflags=%linkflags32% include=%include%
|
||||
& python test.py
|
||||
)
|
||||
- if defined sim (
|
||||
cd %ROOT_DIRECTORY%\simulation
|
||||
&& b2.exe --hash -j2 crypto=built-in %compiler% )
|
||||
& b2.exe --hash -j2 link=shared crypto=built-in %compiler%
|
||||
)
|
||||
|
||||
|
|
|
@ -193,7 +193,6 @@ test-suite libtorrent :
|
|||
alias win-tests :
|
||||
test_primitives
|
||||
test_pe_crypto
|
||||
test_utp
|
||||
test_remap_files
|
||||
test_auto_unchoke
|
||||
test_torrent
|
||||
|
|
|
@ -335,14 +335,22 @@ bool downloading_alert(libtorrent::alert const* a)
|
|||
|
||||
void wait_for_downloading(lt::session& ses, char const* name)
|
||||
{
|
||||
time_point start = clock_type::now();
|
||||
downloading_done = false;
|
||||
alert const* a = 0;
|
||||
do
|
||||
{
|
||||
print_alerts(ses, name, true, true, true, &downloading_alert, false);
|
||||
if (downloading_done) break;
|
||||
a = ses.wait_for_alert(milliseconds(500));
|
||||
if (total_seconds(clock_type::now() - start) > 10) break;
|
||||
a = ses.wait_for_alert(seconds(2));
|
||||
} while (a);
|
||||
if (!downloading_done)
|
||||
{
|
||||
fprintf(stderr, "did not receive a state_changed_alert indicating "
|
||||
"the torrent is downloading. waited: %d ms\n"
|
||||
, int(total_milliseconds(clock_type::now() - start)));
|
||||
}
|
||||
}
|
||||
|
||||
void print_ses_rate(float time
|
||||
|
|
|
@ -211,23 +211,31 @@ void test_swarm(int flags)
|
|||
alert const* ret;
|
||||
while ((ret = ses1.wait_for_alert(seconds(2))))
|
||||
{
|
||||
fprintf(stderr, "wait returned: %d ms\n"
|
||||
, int(total_milliseconds(clock_type::now() - start)));
|
||||
std::vector<alert*> alerts;
|
||||
ses1.pop_alerts(&alerts);
|
||||
for (std::vector<alert*>::iterator i = alerts.begin()
|
||||
, end(alerts.end()); i != end; ++i)
|
||||
{
|
||||
std::cerr << ret->message() << std::endl;
|
||||
fprintf(stderr, "%s\n", ret->message().c_str());
|
||||
}
|
||||
start = clock_type::now();
|
||||
}
|
||||
|
||||
fprintf(stderr, "loop returned: %d ms\n"
|
||||
, int(total_milliseconds(clock_type::now() - start)));
|
||||
|
||||
// this allows shutting down the sessions in parallel
|
||||
p1 = ses1.abort();
|
||||
p2 = ses2.abort();
|
||||
p3 = ses3.abort();
|
||||
|
||||
TEST_CHECK(clock_type::now() - start < seconds(3));
|
||||
TEST_CHECK(clock_type::now() - start >= seconds(2));
|
||||
time_point end = clock_type::now();
|
||||
|
||||
fprintf(stderr, "time: %d ms\n", int(total_milliseconds(end - start)));
|
||||
TEST_CHECK(end - start < seconds(3));
|
||||
TEST_CHECK(end - start >= seconds(2));
|
||||
|
||||
TEST_CHECK(!exists("tmp1_swarm/temporary"));
|
||||
TEST_CHECK(!exists("tmp2_swarm/temporary"));
|
||||
|
|
Loading…
Reference in New Issue