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>
Mon, 20 Oct 2014 21:19:19 +0000 (14:19 -0700)
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.

Change-Id: I03b60fd6d9cc6252651f25610e7c72bbc450670c

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 28a33c2762fa47bd6586ab16847031895f5770a2..6e9028e88241f494ade4509bd2b3b07bcf293d1e 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 f04916cb38aee23f72f48e115261727e5db4fa37..02cb57320c90d442076f02e3a1428ec8205dcd4e 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 54264c186e455aa1fb5650b7d60d758bfae4d6f6..d4015a3fea591100f3bfdd8e60db8cddfecf5713 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 33380c2c4ba404cd2cb17b9c5b2526b2d6716602..4da88a1f84f0bea27285defec5a40f2e10f63338 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 140339b71ced5a970f058ad695a6c2dac51d9660..84d09091b61b7ad425a72f981aa3ebce5110cbd8 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 f5befc8f603a6816a4b2034d69f9cfdc513bf7e1..05ee665f59add99e711533e1f981e0c2f74b58f2 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 37a3f52453ebf3916eb7e13919eca008d13f3ef5..2f3d7b292938845caeb97b0099ad756cdc1e8b7d 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 3d44c39c706e62e572f72e6f1d53b659e578dfe5..3b56e582ce882f4fdaf16fe1bea633ead6d3ae06 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 17d8017634586f4fdb902572402f1d0baaca7869..7989e56d0cab39ba2eafa6f8f4232542880f145b 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")