When running a test, export RUNFILES_MANIFEST_FILE only if the MANIFEST file exists.
Exporting the path to a file that does not exist seems wrong.
RELNOTES: none
PiperOrigin-RevId: 210534766
diff --git a/tools/test/test-setup.sh b/tools/test/test-setup.sh
index d7bb931..2a26c37 100755
--- a/tools/test/test-setup.sh
+++ b/tools/test/test-setup.sh
@@ -126,10 +126,10 @@
export -f rlocation
export -f is_absolute
-export RUNFILES_MANIFEST_FILE
-# If the runfiles manifest exist, then test programs should use it to find
+# If the runfiles manifest exists, then test programs should use it to find
# runfiles.
if [[ -e "$RUNFILES_MANIFEST_FILE" ]]; then
+ export RUNFILES_MANIFEST_FILE
export RUNFILES_MANIFEST_ONLY=1
fi