aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-04-09 23:22:19 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-04-09 23:22:19 +0000
commit1aa26603f91139265f3e47a00ab3c359799fdf9f (patch)
tree28c024f1527f5123447918add42f9ff36bd6e847
parent40afe26852c38374d9dd6b6dcf145b2e28cd256f (diff)
parentc52ba3c26b794617f96049be56fc8f72220ce81f (diff)
downloadtreble-sdk-release.tar.gz
Snap for 11692525 from c52ba3c26b794617f96049be56fc8f72220ce81f to sdk-releasesdk-release
Change-Id: I06a52e7e51626e2f2fba17d59a8fd524a3d0e364
-rw-r--r--build/Android.bp23
-rw-r--r--build/test.py11
-rw-r--r--split/Android.bp5
-rw-r--r--split/manifest_diff_test.py2
-rw-r--r--split/manifest_split_test.py2
-rw-r--r--split/test.py11
-rw-r--r--split/xml_diff_test.py2
7 files changed, 38 insertions, 18 deletions
diff --git a/build/Android.bp b/build/Android.bp
index 32c5bf5..9f62bbf 100644
--- a/build/Android.bp
+++ b/build/Android.bp
@@ -8,15 +8,15 @@ python_defaults {
}
python_library_host {
- name: "treble_build_lib",
- defaults: ["treble_build_default"],
- srcs: [
- "sandbox/build_android_sandboxed.py",
- "sandbox/config.py",
- "sandbox/nsjail.py",
- "sandbox/overlay.py",
- "sandbox/rbe.py",
- ],
+ name: "treble_build_lib",
+ defaults: ["treble_build_default"],
+ srcs: [
+ "sandbox/build_android_sandboxed.py",
+ "sandbox/config.py",
+ "sandbox/nsjail.py",
+ "sandbox/overlay.py",
+ "sandbox/rbe.py",
+ ],
}
python_test_host {
@@ -39,4 +39,9 @@ python_test_host {
test_options: {
unit_test: true,
},
+ version: {
+ py3: {
+ embedded_launcher: true,
+ },
+ },
}
diff --git a/build/test.py b/build/test.py
index b12934e..1955ca5 100644
--- a/build/test.py
+++ b/build/test.py
@@ -17,12 +17,17 @@
import unittest
import os
+import pkgutil
import sys
def run():
- start_dir = os.path.dirname(os.path.abspath(__file__))
- loader = unittest.TestLoader()
- suite = loader.discover(start_dir, pattern='*_test.py')
+ test_modules = [
+ mod.name
+ for mod in pkgutil.walk_packages()
+ if mod.name.endswith('_test')
+ ]
+
+ suite = unittest.defaultTestLoader.loadTestsFromNames(test_modules)
runner = unittest.TextTestRunner(verbosity=2)
result = runner.run(suite)
diff --git a/split/Android.bp b/split/Android.bp
index d742681..210e731 100644
--- a/split/Android.bp
+++ b/split/Android.bp
@@ -62,4 +62,9 @@ python_test_host {
],
test_config: "test.xml",
test_suites: ["general-tests"],
+ version: {
+ py3: {
+ embedded_launcher: true,
+ },
+ },
}
diff --git a/split/manifest_diff_test.py b/split/manifest_diff_test.py
index ca1e742..0727877 100644
--- a/split/manifest_diff_test.py
+++ b/split/manifest_diff_test.py
@@ -15,7 +15,7 @@
import unittest
import xml.etree.ElementTree as ET
-import manifest_diff
+from treble.split import manifest_diff
class ManifestDiffTest(unittest.TestCase):
diff --git a/split/manifest_split_test.py b/split/manifest_split_test.py
index c07c870..27dd556 100644
--- a/split/manifest_split_test.py
+++ b/split/manifest_split_test.py
@@ -22,7 +22,7 @@ import unittest
import unittest.mock
import xml.etree.ElementTree as ET
-import manifest_split
+from treble.split import manifest_split
class ManifestSplitTest(unittest.TestCase):
diff --git a/split/test.py b/split/test.py
index 36087ef..59a3d40 100644
--- a/split/test.py
+++ b/split/test.py
@@ -16,12 +16,17 @@
import unittest
import os
+import pkgutil
import sys
def run():
- start_dir = os.path.dirname(os.path.abspath(__file__))
- loader = unittest.TestLoader()
- suite = loader.discover(start_dir, pattern='*_test.py')
+ test_modules = [
+ mod.name
+ for mod in pkgutil.walk_packages()
+ if mod.name.endswith('_test')
+ ]
+
+ suite = unittest.defaultTestLoader.loadTestsFromNames(test_modules)
runner = unittest.TextTestRunner(verbosity=2)
result = runner.run(suite)
diff --git a/split/xml_diff_test.py b/split/xml_diff_test.py
index aef4562..82d5e62 100644
--- a/split/xml_diff_test.py
+++ b/split/xml_diff_test.py
@@ -15,7 +15,7 @@
import unittest
import xml.etree.ElementTree as ET
-import xml_diff
+from treble.split import xml_diff
class XmlDiffTest(unittest.TestCase):