Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 76 lines (63 sloc) 1.836 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
set -e
set -o pipefail

function TEST_BUILDING_in_zip {
  version=$(get_junit_version)
  ant zip
  unzip -l junit${version}/junit${version}.zip | grep BUILDING >/dev/null
}

function TEST_get_junit_version {
  version=$(get_junit_version)
  if [[ ! ($version == 4.*) ]]; then
echo "Bad version: $version"
    return 1
  fi
}

function TEST_ant_dist {
  version=$(get_junit_version)
  ant dist
  ls junit${version}/junit-${version}.jar
}

function TEST_ant_profile {
  rm -rf java.hprof.txt
  ant profile
  ls java.hprof.txt
}

function TEST_jars {
  version=$(get_junit_version)
  binjar=junit${version}/junit-${version}.jar
  srcjar=junit${version}/junit-${version}-src.jar
  depjar=junit${version}/junit-dep-${version}.jar

  ant clean
  ant jars

  jar tf $binjar | grep -q class \
    && jar tf $srcjar | grep -q java \
    && jar tf $depjar | grep -q class \
    && jar tf $depjar | not grep hamcrest
}

function TEST_all_maven_jars {
  version=$(get_junit_version)
  binjar=junit${version}/junit-${version}.jar
  srcjar=junit${version}/junit-${version}-src.jar
  docjar=junit${version}/junit-${version}-javadoc.jar
  depbin=junit${version}/junit-dep-${version}.jar
  depsrc=junit${version}/junit-dep-${version}-src.jar
  depdoc=junit${version}/junit-dep-${version}-javadoc.jar

  ant clean
  ant all.maven.jars

  jar tf $binjar | grep -q class \
    && jar tf $srcjar | grep -q java \
    && jar tf $docjar | grep -q html \
    && jar tf $depbin | grep -q class \
    && jar tf $depsrc | grep -q java \
    && jar tf $depdoc | grep -q html \
    && jar tf $depbin | not grep hamcrest \
    && jar tf $depsrc | not grep hamcrest \
    && jar tf $depdoc | not grep hamcrest
}

function not {
  ! "$@"
}

function get_junit_version {
  ant print.version | grep echo | sed 's/.*echo..\([1-9].*\)/\1/'
}

source build/run_tests.sh
Something went wrong with that request. Please try again.