aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSpandan Das <spandandas@google.com>2023-03-10 02:32:18 +0000
committerSpandan Das <spandandas@google.com>2023-03-10 02:32:18 +0000
commit68bcbb588af08cd06a147ea6830af0c02e731a9f (patch)
tree579539fa7304ac0da6fca2e53a7d4ab25d7e11d3 /tests
parent98cb85624c44e2e6b31f55ea18e9f87163a7b788 (diff)
downloadsoong-68bcbb588af08cd06a147ea6830af0c02e731a9f.tar.gz
Add an integration test for API export from another bazel package
This test ensures that API export works ok if the api file exists in a different directory (precisely, package) than the *_api_contribution target. Test: tests/run_integration_tests.sh Change-Id: I1ff171b93773b514a9a081f962606f4c28abe42e
Diffstat (limited to 'tests')
-rwxr-xr-xtests/bp2build_bazel_test.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/bp2build_bazel_test.sh b/tests/bp2build_bazel_test.sh
index 1ff1b5bca..68d7f8d19 100755
--- a/tests/bp2build_bazel_test.sh
+++ b/tests/bp2build_bazel_test.sh
@@ -343,4 +343,29 @@ function test_api_bp2build_empty_build() {
run_bazel build --config=android --config=api_bp2build //:empty
}
+# Verify that an *_api_contribution target can refer to an api file from
+# another Bazel package.
+function test_api_export_from_another_bazel_package() {
+ setup
+ # Parent dir Android.bp
+ mkdir -p foo
+ cat > foo/Android.bp << 'EOF'
+cc_library {
+ name: "libfoo",
+ stubs: {
+ symbol_file: "api/libfoo.map.txt",
+ },
+}
+EOF
+ # Child dir Android.bp
+ mkdir -p foo/api
+ cat > foo/api/Android.bp << 'EOF'
+package{}
+EOF
+ touch foo/api/libfoo.map.txt
+ # Run test
+ run_soong api_bp2build
+ run_bazel build --config=android --config=api_bp2build //foo:libfoo.contribution
+}
+
scan_and_run_tests