1
0
Selaa lähdekoodia

HADOOP-3653. Fix test-patch target to properly account for Eclipse classpath jars. Contributed by Brice Arnould.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@674720 13f79535-47bb-0310-9956-ffa450edef68
Nigel Daley 17 vuotta sitten
vanhempi
commit
f8013a7714
2 muutettua tiedostoa jossa 12 lisäystä ja 3 poistoa
  1. 3 0
      CHANGES.txt
  2. 9 3
      src/test/bin/test-patch.sh

+ 3 - 0
CHANGES.txt

@@ -771,6 +771,9 @@ Release 0.18.0 - Unreleased
     HADOOP-3693. Fix archives, distcp and native library documentation to
     conform to style guidelines. (Amareshwari Sriramadasu via cdouglas)
 
+    HADOOP-3653. Fix test-patch target to properly account for Eclipse
+    classpath jars. (Brice Arnould via nigel)
+
 Release 0.17.1 - Unreleased
 
   INCOMPATIBLE CHANGES

+ 9 - 3
src/test/bin/test-patch.sh

@@ -468,10 +468,16 @@ runCoreTests () {
 ###############################################################################
 ### Tests parts of contrib specific to the eclipse files
 runContribTestOnEclipseFiles () {
-  export ECLIPSE_DECLARED_JARS=$(sed -n 's@.*kind="lib".*path="\(.*jar\)".*@\1@p' < .eclipse.templates/.classpath |sort)
-  export PRESENT_JARS=$(find lib/ -name '*.jar' |sort)
+  export DECLARED_JARS=$(sed -n 's@.*kind="lib".*path="\(.*jar\)".*@\1@p' < .eclipse.templates/.classpath)
+  export PRESENT_JARS=$(find lib/ src/test/lib/ -name '*.jar' |sort)
+  # When run by Hudson, consider libs from ${SUPPORT_DIR} declared
+  if [[ ${HUDSON} == "true" ]]; then
+      DECLARED_JARS="${DECLARED_JARS} $(cd "${SUPPORT_DIR}"; find lib -name '*.jar')"
+  fi
+  DECLARED_JARS=$(sed 'y/ /\n/' <<< ${DECLARED_JARS} | sort)
   export ECLIPSE_DECLARED_SRC=$(sed -n 's@.*kind="src".*path="\(.*\)".*@\1@p' < .eclipse.templates/.classpath |sort)
-  if [ "${ECLIPSE_DECLARED_JARS}" != "${PRESENT_JARS}" ]; then
+
+  if [ "${DECLARED_JARS}" != "${PRESENT_JARS}" ]; then
     echo "Some jars are not declared in the Eclipse project."
     return 1
   fi