Symbol: Add presubmit testing
Add symbol's unit tests to presubmit. Test: atest python-symbol_test Change-Id: I37eb4151365507ab2a95d7789408504cca78153c
This commit is contained in:
@@ -37,3 +37,13 @@ python_test_host {
|
|||||||
test_config: "native_heapdump_viewer-tests.xml",
|
test_config: "native_heapdump_viewer-tests.xml",
|
||||||
test_suites: ["general-tests"],
|
test_suites: ["general-tests"],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
python_test_host {
|
||||||
|
name: "python-symbol_test",
|
||||||
|
main: "symbol.py",
|
||||||
|
// Would be nice to use the library above, but as it's single-source
|
||||||
|
// this doesn't work.
|
||||||
|
srcs: ["symbol.py"],
|
||||||
|
test_config: "symbol-tests.xml",
|
||||||
|
test_suites: ["general-tests"],
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
"presubmit": [
|
"presubmit": [
|
||||||
{
|
{
|
||||||
"name": "python-native_heapdump_viewer_test"
|
"name": "python-native_heapdump_viewer_test"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "python-symbol_test"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
7
scripts/symbol-tests.xml
Normal file
7
scripts/symbol-tests.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<configuration description="Config for python tradefed symbol test">
|
||||||
|
<option name="test-suite-tag" value="python-symbol_test" />
|
||||||
|
<test class="com.android.tradefed.testtype.python.PythonBinaryHostTest" >
|
||||||
|
<option name="par-file-name" value="python-symbol_test" />
|
||||||
|
<option name="test-timeout" value="2m" />
|
||||||
|
</test>
|
||||||
|
</configuration>
|
||||||
@@ -28,8 +28,11 @@ import signal
|
|||||||
import subprocess
|
import subprocess
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
ANDROID_BUILD_TOP = str(os.environ["ANDROID_BUILD_TOP"])
|
try:
|
||||||
if not ANDROID_BUILD_TOP:
|
ANDROID_BUILD_TOP = str(os.environ["ANDROID_BUILD_TOP"])
|
||||||
|
if not ANDROID_BUILD_TOP:
|
||||||
|
ANDROID_BUILD_TOP = "."
|
||||||
|
except:
|
||||||
ANDROID_BUILD_TOP = "."
|
ANDROID_BUILD_TOP = "."
|
||||||
|
|
||||||
def FindSymbolsDir():
|
def FindSymbolsDir():
|
||||||
@@ -550,6 +553,7 @@ class FindToolchainTests(unittest.TestCase):
|
|||||||
ARCH = abi
|
ARCH = abi
|
||||||
FindToolchain() # Will throw on failure.
|
FindToolchain() # Will throw on failure.
|
||||||
|
|
||||||
|
@unittest.skipIf(ANDROID_BUILD_TOP == '.', 'Test only supported in an Android tree.')
|
||||||
def test_toolchains_found(self):
|
def test_toolchains_found(self):
|
||||||
self.assert_toolchain_found("arm")
|
self.assert_toolchain_found("arm")
|
||||||
self.assert_toolchain_found("arm64")
|
self.assert_toolchain_found("arm64")
|
||||||
|
|||||||
Reference in New Issue
Block a user