Skip to content
This repository has been archived by the owner on Dec 10, 2022. It is now read-only.

Add more tests #42

Open
intrigus opened this issue Jun 1, 2016 · 5 comments
Open

Add more tests #42

intrigus opened this issue Jun 1, 2016 · 5 comments
Milestone

Comments

@intrigus
Copy link
Contributor

intrigus commented Jun 1, 2016

We should add more tests.
I'm currently trying to setup the tests from https://github.com/robovm/robovm/tree/master/tests/dalvik, but I'll also have a look at the (original) tests from android.
I'll also have a look at https://github.com/robovm/drlvm-vts-bundle :)

(Comments for me)

030 Can't be fixed, due to finalizer
031 Can be fixed, fails, due to difference between javac/dx/jtransc
044 Failed, don't know why
046 Can be fixed, error, because they use other API
067 API diff between Android and Java SE
070 Not important

@soywiz
Copy link
Contributor

soywiz commented Jun 2, 2016

Cool :)

030:
Finalizers could be supported, but just on some targets directly (C++, C#, Java, Flash, PHP). Javascript won't allow to do this, even with WeakMaps I tried to do a hack similar to one I did on flash but it would require being able to iterate the map or getting its length. But it doesn't allow it. So there is no way (at least standard) to determine if an object has been collected on JS.

044:
Not tried. But right now jtransc dynamic proxies just allow one interface. Which is the most common. It could support more interfaces if required, but that probably will have a cost con runtime performance on casts.

Threads:
Threads are currently not supported. But it is possible to support it on some targets: C++, Java, C#. In the future, when javascripts supports concurrent shared heap, we could try too.
We could support already threads that do not share global state.

@intrigus
Copy link
Contributor Author

intrigus commented Jun 4, 2016

Hey, it's a little bit unclear, how exactly tests are run.

It would be great, if we can run the tests on all platforms haxe supports.
Could you maybe add a little example on how to do that?

@soywiz
Copy link
Contributor

soywiz commented Jun 4, 2016

Yep I wanted do to do it. But also it would be cool to run them in parallel, since for example C++ could take much longer due to compilation times.

Right now there is a test that run in JS y PHP:

https://github.com/jtransc/jtransc/blob/master/jtransc-main/test/HaxeGenSuiteMiscTest.kt#L36

Though starting with 3.3.0-rc ( http://gamehaxe.com/wp-content/uploads/2016/07/Wwx2016-Hxcpp.swf with HXCPP_COMPILE_CACHE) following compilations even in other projects reuse already compiled classes ( https://www.youtube.com/watch?v=e64T96OOzKQ&index=6&list=PLyIetEt7wxr6yo_ARVaQv9UpeGbAYp_Z2 )
So maybe we could run more tests just with a first great compilation.

Haxe itself uses the travis matrix + environment variables to run cpp in parallel: https://github.com/HaxeFoundation/haxe/blob/development/.travis.yml#L88
https://github.com/HaxeFoundation/haxe/blob/development/.travis.yml#L117

The way testing a specific target is like this:

https://github.com/jtransc/jtransc/blob/master/jtransc-main/test/HaxeGenSuiteMiscTest.kt#L38

There is a lang argument which specifies the target.

The actual code instructing JTransc to compile and run it at the test level (without entering other code) can be found here:
https://github.com/jtransc/jtransc/blob/master/jtransc-main/test/HaxeTestBase.kt#L108

@intrigus
Copy link
Contributor Author

intrigus commented Jun 6, 2016

I'm currently porting the tests from AndroidRT to OpenJDK, but there is one test, that is problematic, because the toString() method of an annotation isn't deterministic on OpenJDK, the test always fails...
I'm currently trying to fix it, but my approach is really hacky and heavily relies on reflection.
At least reflection is also heavily tested :D

@soywiz
Copy link
Contributor

soywiz commented Jun 7, 2016

Great. I think the reflection is fine, if it works :)

@soywiz soywiz added this to the 0.4.0 milestone Jun 15, 2016
@soywiz soywiz mentioned this issue Jun 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants