Fix Mono.Posix tests on Windows
authorNiklas Therning <niklas@therning.org>
Thu, 17 Nov 2016 12:34:09 +0000 (13:34 +0100)
committerNiklas Therning <niklas@therning.org>
Thu, 17 Nov 2016 13:10:49 +0000 (14:10 +0100)
commit3df6f5c3f3ba949f5cb144be3d70c7ec60a70660
tree5f4f33d9aff8afdc48cae47cd84308ee65dc6110
parentb34a3d6b7833f662c69bbc88a3e226096a1c8289
Fix Mono.Posix tests on Windows

Cleaned up Mono_Posix_FromSeekFlags() in support/map.c. It didn't properly
handle the case when L_INCR, L_SET, L_XTND aren't available, like on Windows.

Added Mono_Posix_Stdlib_GetLastError() to support/errno.c and changed
Stdlib.GetlastError() use it. Without this Stdlib.GetlastError() wouldn't take
errno in the C runtime used by libMonoPosixHelper.dll into account.

On Windows the Syscall class failed to initialize due to missing functions,
e.g. Mono_Posix_Syscall_get_at_fdcwd(), in libMonoPosixHelper.dll. Those
readonly static fields which were initialized at class initialization have now
been converted to static readonly properties so that the Syscall class can be
initialized despite those functions not being defined.

Cleaned up temp file handling in StdioFileStreamTest to avoid failures due to
sharing violations on Windows.

Fixed a bug in the StdioFileStreamTest.Write() test method when reading back
the batch of bytes written in the second part of the test.

Enabled the Mono.Posix test suite to run on PR builds. This test suite should
from now on be green.
mcs/class/Mono.Posix/Mono.Unix.Native/Stdlib.cs
mcs/class/Mono.Posix/Mono.Unix.Native/Syscall.cs
mcs/class/Mono.Posix/Test/Mono.Unix/StdioFileStreamTest.cs
msvc/monoposixhelper.def
scripts/ci/run-test-default.sh
support/errno.c
support/map.c
support/map.h
support/stdio.c