File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -96,3 +96,11 @@ organization will commit to maintaining that feature and responding to issues.
9696 distribution.
9797- Other new dependencies are strongly discouraged. The exception is that we
9898 may take dependencies on other modules maintained by the Bazel team.
99+
100+ ### Write for vendoring the source tree.
101+
102+ We presume that some users will vendor this entire rule set into their source
103+ tree and want to test it from their WORKSPACE. Towards that end we try to
104+ minimize the places where we assume the path to any package is absolute
105+ from WORKSPACE. See tests/package_naming_aggregate_test.sh for an example
106+ of how we can write a sh_test that works after re-rooting the sources.
Original file line number Diff line number Diff line change 1616# that we get the expected file names.
1717set -e
1818
19- declare -r DATA_DIR=" ${TEST_SRCDIR} /rules_pkg/tests"
19+ # Portably find the absolute path to the test data, even if this code has been
20+ # vendored in to a source tree and re-rooted.
21+ TEST_PACKAGE=" $( echo ${TEST_TARGET} | sed -e ' s/:.*$//' -e ' s@//@@' ) "
22+ declare -r DATA_DIR=" ${TEST_SRCDIR} /${TEST_WORKSPACE} /${TEST_PACKAGE} "
2023
2124for pkg in test_naming_some_value.deb test_naming_some_value.tar test_naming_some_value.zip ; do
2225 ls -l " ${DATA_DIR} /$pkg "
You can’t perform that action at this time.
0 commit comments