From 19a67e88cc2ecf31a8bcbb1ca9d7e88779cf60d7 Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Wed, 15 Feb 2012 15:40:26 -0500 Subject: [PATCH] Bug 727504 - Fix up error messages displayed on missing environment variables when running tests. r=jmaher --- testing/testsuite-targets.mk | 38 ++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/testing/testsuite-targets.mk b/testing/testsuite-targets.mk index 8345d1a154d7..1bc40e6ed628 100644 --- a/testing/testsuite-targets.mk +++ b/testing/testsuite-targets.mk @@ -97,20 +97,24 @@ endif mochitest-remote: DM_TRANS?=adb mochitest-remote: - @if test -f ${MOZ_HOST_BIN}/xpcshell && [ "${TEST_DEVICE}" != "usb" -o "$(DM_TRANS)" = "adb" ]; \ - then $(RUN_MOCHITEST_REMOTE); \ - else \ - echo "please prepare your host with environment variables for TEST_DEVICE and MOZ_HOST_BIN"; \ - fi + @if [ ! -f ${MOZ_HOST_BIN}/xpcshell ]; then \ + echo "please prepare your host with the environment variable MOZ_HOST_BIN"; \ + elif [ "${TEST_DEVICE}" = "" -a "$(DM_TRANS)" != "adb" ]; then \ + echo "please prepare your host with the environment variable TEST_DEVICE"; \ + else \ + $(RUN_MOCHITEST_REMOTE); \ + fi mochitest-robotium: robotium-id-map mochitest-robotium: DM_TRANS?=adb mochitest-robotium: - @if test -f ${MOZ_HOST_BIN}/xpcshell && [ "${TEST_DEVICE}" != "usb" -o "$(DM_TRANS)" = "adb" ]; \ - then $(RUN_MOCHITEST_ROBOTIUM); \ - else \ - echo "please prepare your host with environment variables for TEST_DEVICE and MOZ_HOST_BIN"; \ - fi + @if [ ! -f ${MOZ_HOST_BIN}/xpcshell ]; then \ + echo "please prepare your host with the environment variable MOZ_HOST_BIN"; \ + elif [ "${TEST_DEVICE}" = "" -a "$(DM_TRANS)" != "adb" ]; then \ + echo "please prepare your host with the environment variable TEST_DEVICE"; \ + else \ + $(RUN_MOCHITEST_ROBOTIUM); \ + fi mochitest-plain: $(RUN_MOCHITEST) @@ -172,11 +176,15 @@ reftest: reftest-remote: TEST_PATH?=layout/reftests/reftest.list reftest-remote: DM_TRANS?=adb reftest-remote: - @if test -f ${MOZ_HOST_BIN}/xpcshell && [ "${TEST_DEVICE}" != "" -o "$(DM_TRANS)" = "adb" ]; \ - then ln -s $(abspath $(topsrcdir)) _tests/reftest/tests;$(call REMOTE_REFTEST,tests/$(TEST_PATH)); $(CHECK_TEST_ERROR); \ - else \ - echo "please prepare your host with environment variables for TEST_DEVICE and MOZ_HOST_BIN"; \ - fi + @if [ ! -f ${MOZ_HOST_BIN}/xpcshell ]; then \ + echo "please prepare your host with the environment variable MOZ_HOST_BIN"; \ + elif [ "${TEST_DEVICE}" = "" -a "$(DM_TRANS)" != "adb" ]; then \ + echo "please prepare your host with the environment variable TEST_DEVICE"; \ + else \ + ln -s $(abspath $(topsrcdir)) _tests/reftest/tests; \ + $(call REMOTE_REFTEST,tests/$(TEST_PATH)); \ + $(CHECK_TEST_ERROR); \ + fi reftest-ipc: TEST_PATH?=layout/reftests/reftest.list reftest-ipc: