Skip to content

Commit

Permalink
update r8 test
Browse files Browse the repository at this point in the history
  • Loading branch information
JiaYan Lin committed Jan 25, 2024
1 parent 0999e41 commit 80fa1fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
3 changes: 2 additions & 1 deletion test/rules/android_binary_internal/r8_integration/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ load("@rules_python//python:py_test.bzl", "py_test")
py_test(
name = "r8_integration_test",
srcs = ["r8_integration_test.py"],
args = ["$(location @androidsdk//:dexdump)"],
data = [
"//test/rules/android_binary_internal/r8_integration/java/com/basicapp:basic_app_R8_no_shrink",
"//test/rules/android_binary_internal/r8_integration/java/com/basicapp:basic_app_R8_shrink",
"//test/rules/android_binary_internal/r8_integration/java/com/basicapp:basic_app_no_R8",
"@androidsdk//:files",
"@androidsdk//:dexdump",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import subprocess
import unittest
import zipfile
import sys



Expand All @@ -39,17 +40,6 @@ def _r8_integration_check(
expect_unused_activity_resource,
"res/layout/unused_activity.xml" in apk_files,
)
RUNFILES_DIR = os.environ["RUNFILES_DIR"]
build_tools_dir = RUNFILES_DIR + "/androidsdk/build-tools/"
print("############# Content of ", build_tools_dir, "\t", os.scandir(build_tools_dir))
print(">>>>>>>>>>>>> ", [f for f in os.scandir(build_tools_dir)])
print(">>>>>>>>>>>>> ", [f for f in os.scandir(build_tools_dir) if f.is_dir()])
tok = "TEST_SRCDIR"
print("------------- ", os.environ[tok], os.scandir(os.environ[tok]))
print("------------- ", [ f for f in os.scandir(os.environ[tok]) ] )
print(">>>>>>>>>>>>> ", [ f for f in os.scandir( os.environ[tok] + "/androidsdk/build-tools" )])
dexdump = '$(PYTHON_RUNFILES)/androidsdk/dexdump'

dexdump_proc = subprocess.run(
[dexdump, classes_dex],
stdout=subprocess.PIPE,
Expand Down Expand Up @@ -95,4 +85,5 @@ def test_r8_integration(self):


if __name__ == "__main__":
unittest.main()
dexdump = sys.argv.pop()
unittest.main(argv=None)

0 comments on commit 80fa1fe

Please sign in to comment.