Rename libtestercore.so to libdeqp.so
authorPyry Haulos <phaulos@google.com>
Mon, 20 Oct 2014 20:01:20 +0000 (13:01 -0700)
committerPyry Haulos <phaulos@google.com>
Tue, 11 Nov 2014 16:45:53 +0000 (16:45 +0000)
Since dEQP is now being built as part of the Android CTS as well,
the name libtestercore.so isn't very descriptive any more. This change
renames the library to libdeqp.so.

This change also drops some dead code related to API level < 9 support.

Bug: 18329517
Change-Id: I03b60fd6d9cc6252651f25610e7c72bbc450670c
(cherry picked from commit 03700a8505debaeae47e63e156ec15350398ce83)

Android.mk
CMakeLists.txt
android/package/Android.mk
android/package/AndroidManifest.xml
android/package/src/com/drawelements/deqp/execserver/ExecService.java
android/package/src/com/drawelements/deqp/testercore/TestLogParser.java
android/scripts/build.py
android/scripts/common.py
android/scripts/debug.py

index 28a33c2..6e9028e 100644 (file)
@@ -5,7 +5,7 @@ delibs_dir := $(LOCAL_PATH)/framework/delibs
 deqp_dir := $(LOCAL_PATH)/
 
 LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE := libtestercore
+LOCAL_MODULE := libdeqp
 LOCAL_SRC_FILES := \
        execserver/xsDefs.cpp \
        execserver/xsExecutionServer.cpp \
index f04916c..02cb573 100644 (file)
@@ -320,8 +320,8 @@ if (DE_OS_IS_ANDROID)
        include_directories(framework/platform/android)
        include_directories(executor)
 
-       add_library(testercore SHARED framework/platform/android/tcuAndroidMain.cpp framework/platform/android/tcuAndroidJNI.cpp framework/platform/android/tcuTestLogParserJNI.cpp ${DEQP_MODULE_ENTRY_POINTS})
-       target_link_libraries(testercore tcutil-platform xecore ${DEQP_MODULE_LIBRARIES})
+       add_library(deqp SHARED framework/platform/android/tcuAndroidMain.cpp framework/platform/android/tcuAndroidJNI.cpp framework/platform/android/tcuTestLogParserJNI.cpp ${DEQP_MODULE_ENTRY_POINTS})
+       target_link_libraries(deqp tcutil-platform xecore ${DEQP_MODULE_LIBRARIES})
 
 elseif (DE_OS_IS_IOS)
        # Code sign identity
index 54264c1..d4015a3 100644 (file)
@@ -4,7 +4,7 @@ include $(CLEAR_VARS)
 LOCAL_MODULE_TAGS := tests
 
 LOCAL_SRC_FILES := $(call all-java-files-under,src)
-LOCAL_JNI_SHARED_LIBRARIES := libtestercore
+LOCAL_JNI_SHARED_LIBRARIES := libdeqp
 
 LOCAL_ASSET_DIR := $(LOCAL_PATH)/../../data
 LOCAL_PACKAGE_NAME := com.drawelements.deqp
index 33380c2..4da88a1 100644 (file)
@@ -33,7 +33,7 @@
                                  android:exported="true"
                                  android:process=":testercore">
                        <meta-data android:name="android.app.lib_name"
-                                          android:value="testercore" />
+                                          android:value="deqp" />
                        <meta-data android:name="android.app.func_name"
                                           android:value="createTestActivity" />
                </activity>
index 140339b..84d0909 100644 (file)
@@ -38,12 +38,7 @@ import com.drawelements.deqp.R;
 
 public class ExecService extends Service {
        static {
-               if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
-                       System.loadLibrary("testercore");
-               } else {
-                       // Pre-gingerbread version without EGL tests.
-                       System.loadLibrary("testercore_legacy");
-               }
+               System.loadLibrary("deqp");
        }
 
        long m_server = 0; //!< Server pointer.
index f5befc8..05ee665 100644 (file)
@@ -32,7 +32,7 @@ import java.io.IOException;
 public class TestLogParser
 {
        static {
-               System.loadLibrary("testercore");
+               System.loadLibrary("deqp");
        }
 
        private long                            m_nativePointer;
index 37a3f52..2f3d7b2 100644 (file)
@@ -33,12 +33,24 @@ def getNativeBuildDir (nativeLib, buildType):
 def getAssetsDir (nativeLib, buildType):
        return os.path.join(getNativeBuildDir(nativeLib, buildType), "assets")
 
+def getPrebuiltsDirName (abiName):
+       PREBUILT_DIRS = {
+                       'x86':                  'android-x86',
+                       'armeabi-v7a':  'android-arm',
+                       'arm64-v8a':    'android-arm64'
+               }
+
+       if not abiName in PREBUILT_DIRS:
+               raise Exception("Unknown ABI %s, don't know where prebuilts are" % abiName)
+
+       return PREBUILT_DIRS[abiName]
+
 def buildNative (nativeLib, buildType):
        deqpDir         = os.path.normpath(os.path.join(common.ANDROID_DIR, ".."))
        buildDir        = getNativeBuildDir(nativeLib, buildType)
        libsDir         = os.path.join(BASE_LIBS_DIR, nativeLib.abiVersion)
-       srcLibFile      = os.path.join(buildDir, "libtestercore.so")
-       dstLibFile      = os.path.join(libsDir, "lib%s.so" % nativeLib.libName)
+       srcLibFile      = os.path.join(buildDir, common.NATIVE_LIB_NAME)
+       dstLibFile      = os.path.join(libsDir, common.NATIVE_LIB_NAME)
 
        # Make build directory if necessary
        if not os.path.exists(buildDir):
@@ -63,20 +75,15 @@ def buildNative (nativeLib, buildType):
        if not os.path.exists(libsDir):
                os.makedirs(libsDir)
 
-       # Copy libtestercore.so
        shutil.copyfile(srcLibFile, dstLibFile)
 
        # Copy gdbserver for debugging
        if buildType.lower() == "debug":
-               if nativeLib.abiVersion == "x86":
-                       shutil.copyfile(os.path.join(common.ANDROID_NDK_PATH, "prebuilt/android-x86/gdbserver/gdbserver"), os.path.join(libsDir, "gdbserver"))
-               elif nativeLib.abiVersion == "armeabi-v7a":
-                       shutil.copyfile(os.path.join(common.ANDROID_NDK_PATH, "prebuilt/android-arm/gdbserver/gdbserver"), os.path.join(libsDir, "gdbserver"))
-               else:
-                       print("Unknown ABI. Won't copy gdbserver to package")
-       elif os.path.exists(os.path.join(libsDir, "gdbserver")):
-               # Make sure there is no gdbserver if build is not debug build
-               os.unlink(os.path.join(libsDir, "gdbserver"))
+               srcGdbserverPath        = os.path.join(common.ANDROID_NDK_PATH, 'prebuilt', getPrebuiltsDirName(nativeLib.abiVersion), 'gdbserver', 'gdbserver')
+               dstGdbserverPath        = os.path.join(libsDir, 'gdbserver')
+               shutil.copyfile(srcGdbserverPath, dstGdbserverPath)
+       else:
+               assert not os.path.exists(os.path.join(libsDir, "gdbserver"))
 
 def buildApp (isRelease):
        appDir  = os.path.join(common.ANDROID_DIR, "package")
index 3d44c39..3b56e58 100644 (file)
@@ -8,10 +8,9 @@ import subprocess
 import multiprocessing
 
 class NativeLib:
-       def __init__ (self, libName, apiVersion, abiVersion):
-               self.libName            = libName
-               self.apiVersion         = apiVersion
-               self.abiVersion         = abiVersion
+       def __init__ (self, apiVersion, abiVersion):
+               self.apiVersion = apiVersion
+               self.abiVersion = abiVersion
 
 def getPlatform ():
        if sys.platform.startswith('linux'):
@@ -148,12 +147,13 @@ ANDROID_DIR                               = os.path.realpath(os.path.join(os.path.dirname(os.path.abspath(_
 
 # Build configuration
 NATIVE_LIBS                            = [
-               #                 library name          API             ABI
-               NativeLib("testercore",         13,             "armeabi-v7a"),         # ARM v7a ABI
-               NativeLib("testercore",         13,             "x86"),                         # x86
-               NativeLib("testercore",         21,             "arm64-v8a"),           # ARM64 v8a ABI
+               #                 API           ABI
+               NativeLib(13,           "armeabi-v7a"),         # ARM v7a ABI
+               NativeLib(13,           "x86"),                         # x86
+               NativeLib(21,           "arm64-v8a"),           # ARM64 v8a ABI
        ]
 ANDROID_JAVA_API               = "android-13"
+NATIVE_LIB_NAME                        = "libdeqp.so"
 
 # NDK paths
 ANDROID_NDK_PATH               = selectFirstExistingDir([
index 17d8017..7989e56 100644 (file)
@@ -117,8 +117,8 @@ def debug(
                        print("Pull library %s from device" % lib)
                        common.execute("%s pull %s" % (adbCmd, lib))
 
-               print("Copy libtestercore.so from build dir")
-               shutil.copyfile(os.path.join(buildDir, "libtestercore.so"), "libtestercore.so")
+               print("Copy %s from build dir" % common.NATIVE_LIB_NAME)
+               shutil.copyfile(os.path.join(buildDir, common.NATIVE_LIB_NAME), common.NATIVE_LIB_NAME)
 
                # Forward local port for jdb
                print("Forward local port to jdb port")