mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Merge branch 'win64-fixes'
* win64-fixes: test/et/et: fix it by using appropriate type for the SOCKET (evutil_socket_t) test/et/et: verify return codes appveyor: switch to new VS/MinGW and x64
This commit is contained in:
commit
97a3e7f580
37
appveyor.yml
37
appveyor.yml
@ -1,6 +1,8 @@
|
||||
version: 2.2.0.{build}
|
||||
|
||||
os: Visual Studio 2015
|
||||
os: Visual Studio 2017
|
||||
platform:
|
||||
- x64
|
||||
|
||||
branches:
|
||||
except:
|
||||
@ -16,7 +18,9 @@ skip_commits:
|
||||
environment:
|
||||
global:
|
||||
APPVEYOR_SAVE_CACHE_ON_ERROR: true
|
||||
CYG_ROOT: C:/MinGW/msys/1.0
|
||||
MINGW_ROOT: C:/mingw-w64/x86_64-7.2.0-posix-seh-rt_v5-rev1
|
||||
OPENSSL_ROOT: C:/OpenSSL-Win64
|
||||
MPATH: C:/mingw-w64/x86_64-7.2.0-posix-seh-rt_v5-rev1/bin;C:/msys64/bin;C:/cygwin64/bin
|
||||
EVENT_TESTS_PARALLEL: 20
|
||||
EVENT_BUILD_PARALLEL: 10
|
||||
matrix:
|
||||
@ -63,29 +67,32 @@ matrix:
|
||||
fast_finish: true
|
||||
|
||||
init:
|
||||
- 'echo Building libevent %version% for Windows'
|
||||
- 'echo System architecture: %PLATFORM%'
|
||||
- 'echo Repo build branch is: %APPVEYOR_REPO_BRANCH%'
|
||||
- 'echo Build folder is: %APPVEYOR_BUILD_FOLDER%'
|
||||
- 'echo Repo build commit is: %APPVEYOR_REPO_COMMIT%'
|
||||
- 'echo Cygwin root is: %CYG_ROOT%'
|
||||
install:
|
||||
- C:\MinGW\bin\mingw-get install autotools autoconf automake
|
||||
- 'echo PATH is: %PATH%'
|
||||
|
||||
build_script:
|
||||
- ps: |
|
||||
if ($env:EVENT_BUILD_METHOD -eq 'autotools') {
|
||||
$env:PATH="$env:CYG_ROOT\bin;C:\MinGW\bin;$($env:PATH)"
|
||||
bash -lc "echo 'C:\MinGW /mingw' > /etc/fstab"
|
||||
bash -lc "echo 'C:\OpenSSL-Win32 /ssl' >> /etc/fstab"
|
||||
$env:APPVEYOR_BUILD_FOLDER = $env:APPVEYOR_BUILD_FOLDER -replace "\\", "/"
|
||||
bash -lc "exec 0</dev/null; exec 2>&1; cd $env:APPVEYOR_BUILD_FOLDER; bash -x ./autogen.sh && mkdir -p build-autotools && cd build-autotools && ../configure LDFLAGS='-L/ssl -L/ssl/lib -L/ssl/lib/MinGW' CFLAGS=-I/ssl/include $env:EVENT_CONFIGURE_OPTIONS && make -j $env:EVENT_BUILD_PARALLEL && make verify -j$env:EVENT_TESTS_PARALLEL"
|
||||
$env:PATH="$env:MPATH;$env:OPENSSL_ROOT/bin;$env:PATH"
|
||||
$env:LDFLAGS="-L$($env:OPENSSL_ROOT)/lib -L$($env:OPENSSL_ROOT)"
|
||||
$env:CFLAGS="-I$($env:OPENSSL_ROOT)/include"
|
||||
|
||||
bash ./autogen.sh 2>&1 3>&1
|
||||
|
||||
md build-autotools 2> $null
|
||||
cd build-autotools
|
||||
|
||||
bash ../configure $env:EVENT_CONFIGURE_OPTIONS 2>&1
|
||||
make -j $env:EVENT_BUILD_PARALLEL 2>&1
|
||||
make verify -j $env:EVENT_TESTS_PARALLEL 2>&1
|
||||
} else {
|
||||
md build-cmake 2> $null
|
||||
cd build-cmake
|
||||
cmake .. $env:EVENT_CMAKE_OPTIONS
|
||||
cmake -G "Visual Studio 15 2017 Win64" .. $env:EVENT_CMAKE_OPTIONS
|
||||
cmake --build . -j $env:EVENT_BUILD_PARALLEL
|
||||
$env:CTEST_PARALLEL_LEVEL=$env:EVENT_TESTS_PARALLEL
|
||||
ctest --output-on-failure
|
||||
ctest --output-on-failure -j $env:EVENT_TESTS_PARALLEL
|
||||
}
|
||||
|
||||
cache:
|
||||
|
@ -95,7 +95,7 @@ test_edgetriggered(void *data_)
|
||||
called = was_et = 0;
|
||||
|
||||
tt_int_op(send(pair[0], test, (int)strlen(test)+1, 0), >, 0);
|
||||
shutdown(pair[0], EVUTIL_SHUT_WR);
|
||||
tt_int_op(shutdown(pair[0], EVUTIL_SHUT_WR), ==, 0);
|
||||
|
||||
supports_et = base_supports_et(base);
|
||||
TT_BLATHER(("Checking for edge-triggered events with %s, which should %s"
|
||||
@ -104,8 +104,8 @@ test_edgetriggered(void *data_)
|
||||
|
||||
/* Initalize one event */
|
||||
ev = event_new(base, pair[1], EV_READ|EV_ET|EV_PERSIST, read_cb, &ev);
|
||||
|
||||
event_add(ev, NULL);
|
||||
tt_assert(ev != NULL);
|
||||
tt_int_op(event_add(ev, NULL), ==, 0);
|
||||
|
||||
/* We're going to call the dispatch function twice. The first invocation
|
||||
* will read a single byte from pair[1] in either case. If we're edge
|
||||
@ -114,8 +114,8 @@ test_edgetriggered(void *data_)
|
||||
* do nothing. If we're level triggered, the second invocation of
|
||||
* event_base_loop will also activate the event (because there's still
|
||||
* data to read). */
|
||||
event_base_loop(base,EVLOOP_NONBLOCK|EVLOOP_ONCE);
|
||||
event_base_loop(base,EVLOOP_NONBLOCK|EVLOOP_ONCE);
|
||||
tt_int_op(event_base_loop(base,EVLOOP_NONBLOCK|EVLOOP_ONCE), ==, 0);
|
||||
tt_int_op(event_base_loop(base,EVLOOP_NONBLOCK|EVLOOP_ONCE), ==, 0);
|
||||
|
||||
if (supports_et) {
|
||||
tt_int_op(called, ==, 1);
|
||||
@ -209,7 +209,7 @@ test_edge_triggered_multiple_events(void *data_)
|
||||
struct event *write_ev = NULL;
|
||||
const char c = 'A';
|
||||
struct event_base *base = data->base;
|
||||
int *pair = data->pair;
|
||||
evutil_socket_t *pair = data->pair;
|
||||
|
||||
if (!base_supports_et(base)) {
|
||||
tt_skip();
|
||||
|
Loading…
x
Reference in New Issue
Block a user