Opened 3 years ago

Last modified 3 years ago

#4416 new change

Libadblockplus-android tests duplicate libadblockplus tests

Reported by: asmirnov Assignee:
Priority: P3 Milestone:
Module: Libadblockplus-Android Keywords:
Cc: fhd, rjeschke, diegocarloslima Blocked By:
Blocking: Platform: Android
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description

Background

Actually libadblockplus-android is JNI-glue for libadblockplus c++ code. We're having android instrumentation tests (https://hg.adblockplus.org/libadblockplus-android/file/tip/libadblockplus-android-tests/src/org/adblockplus/libadblockplus/tests) pretty similar to c++ tests (https://hg.adblockplus.org/libadblockplus/file/tip/test) which sounds like code duplicating.

What to change

Find a solution not to duplicate code or better approach.

Change History (1)

comment:1 Changed 3 years ago by fhd

  • Cc rjeschke diegocarloslima added
  • Ready unset

I don't really see an obvious way forward here, but we should tackle it at some point. My thoughts so far:

We could turn the tests into JS and then run that code through both the C++ and the Java interface. However, that defeats the purpose of the tests, which is not to test the JS code under the hood, but all the glue code.

I see only two alternatives at this point:

  1. We define the actual tests in a common format (e.g. JSON) and have both the C++ and the Android test suite interpret that format and execute all the tests through the C++/Java API respectively.
  2. We define the tests in a common language/format and generate both C++ and Java code from it.

Both options sound pretty bad to me, but I guess out of those two, I'm leaning towards the first one. More ideas welcome...

Note: See TracTickets for help on using tickets.