You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

diff-build-results.sh 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #!/bin/bash
  2. # Regression test when changing the build script.
  3. # Compare new.zip and old.zip, assuming they contain build results
  4. # aj-build/dist/ide/eclipse for two different versions of the build script
  5. # (and comparing only the contents of the .jar files).
  6. # [There must be a better way: diff support that recurses into .jar/.zip files]
  7. [ -n "$DEBUG" ] && set -vx
  8. jar="${JAVA_HOME}/bin/jar"
  9. errExit() {
  10. echo "ERROR $1: $2"
  11. exit "$1"
  12. }
  13. # make this empty to avoid unzipping new.zip and old.zip
  14. dozip="yes"
  15. if [ -z "${dozip}" ] ; then
  16. cd temp
  17. else
  18. rm -rf temp
  19. mkdir temp
  20. cd temp
  21. for d in new old; do
  22. [ -f ../$d.zip ] || errExit 2 "make $d.zip";
  23. mkdir $d
  24. cd $d
  25. $jar -xf ../../$d.zip
  26. cd eclipse
  27. ls *.jar | sort > ../../$d-names.txt
  28. cd ../..
  29. done
  30. fi
  31. diff *-names.txt > /dev/null || errExit 3 "expected same products"
  32. for j in `cat new-names.txt`; do
  33. mkdir $j-dir;
  34. cd $j-dir
  35. for d in new old; do
  36. mkdir $d
  37. cd $d
  38. $jar xf ../../$d/eclipse/$j
  39. dirpath=`pwd | sed 's|/cygdrive/c|c:|'`
  40. for z in `find . -type f -name \*.jar -o -name \*.zip`; do
  41. mkdir ${z}-dir
  42. pushd ${z}-dir
  43. $jar -xf $dirpath/${z}
  44. popd
  45. done
  46. cd ..
  47. done
  48. diff -qr new old > diffs.txt
  49. cd ..
  50. done
  51. cat */diffs.txt
  52. wc -l */diffs.txt