In Replicant 6.0, ipc-modem is shipped in the images.

When it will make it in released images, it will be very useful for
regression testing and for tests that don't involve the full Android
stack[1].

For such tests to work, users are expected to disable the modem (with
'modem.sh off') before.

In this configuration, the test utilities like ipc-modem use the
system libsamsung-ipc as they are linked dynamically against it.

However if we want to also do regression testing with code that
is being worked on, it's very convenient to build test utilities
that have libsamsung-ipc built-in: This way it can test our the
code that is being worked on without interfering in any way with
the Android stack.

The static version of ipc-modem can for instance be built with the
following commands in the Replicant source code directory:
    $ source build/envsetup.sh
    $ lunch replicant_i9300-userdebug
    $ make ipc-modem-static

It can then be run with the following commands (for the GT-I9300):
    $ adb root
    $ adb remount
    $ adb push \
      out/target/product/i9300/system/bin/ipc-modem-static \
      /system/bin/
    $ adb shell "modem.sh off"
    $ adb wait-for-device
    $ adb root
    $ adb shell ipc-modem-static [...]

Signed-off-by: Denis 'GNUtoo' Carikli <gnu...@cyberdimension.org>
---
 Android.mk | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/Android.mk b/Android.mk
index ffa2bd8..8e44870 100644
--- a/Android.mk
+++ b/Android.mk
@@ -174,6 +174,23 @@ LOCAL_SHARED_LIBRARIES := libsamsung-ipc
 
 include $(BUILD_EXECUTABLE)
 
+#########################
+# ipc-modem-static tool #
+#########################
+include $(CLEAR_VARS)
+include $(LOCAL_PATH)/android_versions.mk
+
+LOCAL_MODULE := ipc-modem-static
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SRC_FILES := tools/ipc-modem.c
+
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
+LOCAL_STATIC_LIBRARIES := libsamsung-ipc
+LOCAL_SHARED_LIBRARIES := $(libsamsung_ipc_local_shared_libraries)
+
+include $(BUILD_EXECUTABLE)
+
 #################
 # ipc-test tool #
 #################
-- 
2.33.0

_______________________________________________
Replicant mailing list
Replicant@osuosl.org
https://lists.osuosl.org/mailman/listinfo/replicant

Reply via email to