Add Sanity/antunit-tests as Tier2 test
This commit is contained in:
parent
6282b1948f
commit
dc35baebdd
2 changed files with 64 additions and 0 deletions
9
Sanity/antunit-tests/main.fmf
Normal file
9
Sanity/antunit-tests/main.fmf
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
summary: Run AntUnit tests
|
||||
description: |
|
||||
Run upstream Ant AntUnit tests that are packaged in the SRPM.
|
||||
duration: 15m
|
||||
tier: 2
|
||||
require:
|
||||
- ant-testutil
|
||||
- ant-junit
|
||||
- junit
|
||||
55
Sanity/antunit-tests/runtest.sh
Executable file
55
Sanity/antunit-tests/runtest.sh
Executable file
|
|
@ -0,0 +1,55 @@
|
|||
#!/bin/bash
|
||||
# Author: Mikolaj Izdebski <mizdebsk@redhat.com>
|
||||
. /usr/share/beakerlib/beakerlib.sh
|
||||
|
||||
# Tests to explicitly exclude.
|
||||
# Script tests won't work with OpenJDK because OpenJDK, unlike Oracle
|
||||
# Java, does not include Rhino JavaScript engine
|
||||
EXCLUDES=**/script-test.xml,**/scriptcondition-test.xml
|
||||
|
||||
rlJournalStart
|
||||
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm ant
|
||||
rlAssertBinaryOrigin ant ant
|
||||
rlRun "pushd \$(mktemp -d)"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "prepare test sources"
|
||||
rlFetchSrcForInstalled ant
|
||||
srpm=$(echo ant-*.src.rpm)
|
||||
rlAssertExists ${srpm}
|
||||
rlRun "rpm2cpio ${srpm} | cpio -id"
|
||||
tarball=$(echo apache-ant-*.tar.bz2)
|
||||
rlAssertExists ${tarball}
|
||||
rlRun "tar xf ${tarball}"
|
||||
basedir=$(find -type d -name apache-ant-\*)
|
||||
rlAssertExists ${basedir}/
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "prepare test dependencies"
|
||||
# Fetch AntUnit JAR
|
||||
rlRun "ant -f ${basedir}/fetch.xml antunit -Ddest=optional"
|
||||
antunit=$(readlink -f ${basedir}/lib/optional/ant-antunit*.jar)
|
||||
rlAssertExists ${antunit}
|
||||
# Many tests expect ant classes to be under build/classe/
|
||||
rlRun "mkdir -p ${basedir}/build/classes/"
|
||||
for jar in ant.jar ant-testutil.jar; do
|
||||
rlAssertExists "/usr/share/ant/lib/${jar}"
|
||||
rlRun "(cd ${basedir}/build/classes/ && jar xf /usr/share/ant/lib/${jar})"
|
||||
done
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest "run AntUnit tests"
|
||||
# Don't run JUnit tests, only AntUnit tests
|
||||
rlRun "sed -i '/<target name=\"test\"/s/junit-report,//' ${basedir}/build.xml"
|
||||
# Don't build Ant, but test the ant package installed in the system
|
||||
rlRun "sed -i '/<target name=\"antunit-tests\"/s/build,//' ${basedir}/build.xml"
|
||||
export CLASSPATH=${antunit}
|
||||
rlRun -s "ant -v -f ${basedir}/build.xml -Dantunit.excludes=${EXCLUDES} test"
|
||||
rlAssertGrep "au:antunit" $rlRun_LOG
|
||||
rlAssertGrep "BUILD SUCCESSFUL" $rlRun_LOG
|
||||
rlPhaseEnd
|
||||
|
||||
rlJournalEnd
|
||||
rlJournalPrintText
|
||||
Loading…
Add table
Add a link
Reference in a new issue