[foreign] Running tests on Windows
jbvernee at xs4all.nl
Wed Sep 19 12:00:38 UTC 2018
I'm making good progress with getting things to work on windows and now
have mixed arguments and float varargs working.
I'm currently running the jdk_foreign tests (of which 31 are being run)
to see which ones are failing. I'm getting currently 14 out of 31.
One of the problems I'm running into is that the tests depend on POSIX
functions, which are not in the C standard library on windows. The main
culprit being getpid (although it is in the C++ standard library under
the mangled name _getpid, but name mangling in C++ is non-portable
either). I'm wondering how you'd like to handle these? I don't know if
there is a way to make platform specific tests?
There is also a use of alloca, for which there is a replacement in C99,
but I don't know which C and C++ standards the jdk is on? (iirc C++ was
before std11, which is pretty old). I wanted to change alloca to using a
variable sized array, but the compiler is rejecting that. (currently
using _alloca to test with)
I was seeing the warning 'Not building java.foreign tests' coming from
make/test/native/JtregNativeJdk.gmk, so I've added a filter and flags
for windows as well. But, it doesn't look like these filter were doing
anything in the first place, since `make test` was already outputting a
bunch of dlls, just through some other path it seems. I'm seeing a lot
of warnings like
JtregNativeJdk.gmk:96: warning: ignoring old recipe for target
So I don't know if that filter is still relevant? What is it actually
(supposed to be) doing?
Another thing with the native test files is that dlls require you to
explicitly export symbols. There are 4 different ways to do this, either
through a command line option, a side file, using a decorator
`__declspec(dllexport)`, or using a #pragma comment. I wonder if there
is an established way of doing that for tests that you know of?
And then of course one of the biggest things is getting jextract to
build and run. Currently the build system is not picking up libclang.
When explicitly specifying it with --with-libclang='/cygdrive/j/LLVM' I
still get the "Cannot locate libclang!" warning. I wanted to ask what
value and files it's actually looking for? (I've also tried some of the
additional flags from makeautoconf/lib-clang.m4, but to no avail).
More information about the panama-dev