diff options
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/test.sh | 59 | ||||
-rw-r--r-- | testsuite/test_sources.conf | 8 |
2 files changed, 56 insertions, 11 deletions
diff --git a/testsuite/test.sh b/testsuite/test.sh index 0a2a4092..4c2dc68c 100755 --- a/testsuite/test.sh +++ b/testsuite/test.sh @@ -17,7 +17,7 @@ else . "${topdir}/lib/common.sh" || exit 1 warning "no host.conf file! Synthesizing a framework for testing." - remote_snapshots=http://abe.validation.linaro.org/snapshots + remote_snapshots="${remote_snapshots:-/snapshots}" wget_bin=/usr/bin/wget NEWWORKDIR=/usr/local/bin/git-new-workdir sources_conf=${topdir}/testsuite/test_sources.conf @@ -114,6 +114,9 @@ totals() echo "Total test results:" echo " Passes: ${passes}" echo " Failures: ${failures}" + if test ${xpasses} -gt 0; then + echo " Unexpected Passes: ${xpasses}" + fi if test ${xfailures} -gt 0; then echo " Expected Failures: ${xfailures}" fi @@ -1352,6 +1355,7 @@ echo "================================================" # These can be painfully slow so test small repos. #confirm that checkout works with raw URLs +rm -rf "${local_snapshots}"/*.git* testing="http://abe.git@staging.git.linaro.org/git/toolchain/abe.git" in="${testing}" if test x"${debug}" = xyes; then @@ -1367,6 +1371,7 @@ fi #confirm that checkout fails approriately with a range of bad services in raw URLs for service in "foomatic://" "http:" "http:/fake.git" "http/" "http//" ""; do + rm -rf "${local_snapshots}"/*.git* in="${service}abe.git@staging.git.linaro.org/git/toolchain/abe.git" testing="checkout: ${in} should fail with 'proper URL required' message." if test x"${debug}" = xyes; then @@ -1386,6 +1391,7 @@ for service in "foomatic://" "http:" "http:/fake.git" "http/" "http//" ""; do done #confirm that checkout fails with bad repo - abe is so forgiving that I can only find one suitable input +rm -rf "${local_snapshots}"/*.git* in="http://" testing="checkout: ${in} should fail with 'cannot parse repo' message." if test x"${debug}" = xyes; then @@ -1403,6 +1409,33 @@ else fi fi +rm -rf "${local_snapshots}"/* +in="`get_URL abe.git`" +testing="checkout: abe.git should produce ${local_snapshots}/abe.git" +if (cd "${local_snapshots}" && \ + if test x"${debug}" = xyes; then checkout "${in}" > /dev/null; else checkout "${in}" > /dev/null 2>&1; fi && \ + test `ls | wc -l` -eq 1 && \ + ls abe.git > /dev/null); then + pass "${testing}" +else + fail "${testing}" +fi + +rm -rf "${local_snapshots}"/* +in="`get_URL abe.git`" +in="`get_git_url ${in}`" +testing="checkout: abe.git~staging should produce ${local_snapshots}/abe.git and ${local_snapshots}/abe.git~staging" +if (cd "${local_snapshots}" && \ + if test x"${debug}" = xyes; then checkout "${in}~staging" > /dev/null; else + checkout "${in}~staging" >/dev/null 2>&1; fi && \ + test `ls | wc -l` -eq 2 && \ + ls abe.git > /dev/null && \ + ls abe.git~staging > /dev/null); then + pass "${testing}" +else + fail "${testing}" +fi + test_checkout () { local should="$1" @@ -1425,6 +1458,11 @@ test_checkout () # We also support / designated branches, but want to move to ~ mostly. #tag="${tag}${branch:+~${branch}}${revision:+@${revision}}" + #Make sure there's no hanging state relating to this test before it runs + if ls "${local_snapshots}/${package}"* > /dev/null 2>&1; then + rm -rf "${local_snapshots}/${package}"* + fi + if test x"${debug}" = x"yes"; then if test x"${expected}" = x; then out="`(cd ${local_snapshots} && checkout ${tag})`" @@ -1453,6 +1491,11 @@ test_checkout () branch_test=`(cd ${srcdir} && git branch | grep -c "^\* local_${revision}$")` fi + #Make sure we leave no hanging state + if ls "${local_snapshots}/${package}"* > /dev/null 2>&1; then + rm -rf "${local_snapshots}/${package}"* + fi + if test x"${branch_test}" = x1 -a x"${should}" = xpass; then if test x"${expected}" = x; then pass "${testing}" @@ -1594,6 +1637,8 @@ else untested "${testing}" fi +rm -rf "${local_snapshots}"/*.git* + echo "============= misc tests ================" testing="pipefail" out="`false | tee /dev/null`" @@ -1656,11 +1701,11 @@ else if test x"${debug}" = x"yes"; then echo "${out}" fi - echo "${out}" | grep -- "${cmp_makeflags} 2>&1" > /dev/null + echo "${out}" | grep -- "${cmp_makeflags}" > /dev/null 2>&1 if test $? -eq 0; then - xpass "${testing}" + pass "${testing}" else - xfail "${testing}" + fail "${testing}" fi fi testing="postfix make args (make_install)" @@ -1672,11 +1717,11 @@ else if test x"${debug}" = x"yes"; then echo "${out}" fi - echo "${out}" | grep -- "${cmp_makeflags} 2>&1" > /dev/null + echo "${out}" | grep -- "${cmp_makeflags}" > /dev/null 2>&1 if test $? -eq 0; then - xpass "${testing}" + pass "${testing}" else - xfail "${testing}" + fail "${testing}" fi fi cmp_makeflags= diff --git a/testsuite/test_sources.conf b/testsuite/test_sources.conf index 876cb76b..f296a83c 100644 --- a/testsuite/test_sources.conf +++ b/testsuite/test_sources.conf @@ -6,17 +6,17 @@ gcc-svn-4.8 svn://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch gcc-svn-4.7 svn://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch -gcc.git http://staging.git.linaro.org/git/toolchain/gcc.git +gcc.git http://git.linaro.org/git/toolchain/gcc.git git_gcc.git http://git@staging.git.linaro.org/git/toolchain/gcc.git user_gcc.git http://user.name@staging.git.linaro.org/git/toolchain/gcc.git # gcc_tab.git has a tab between .git and git:// for testing. gcc_tab.git http://staging.git.linaro.org/git/toolchain/gcc.git binutils.git git://git.linaro.org/toolchain/binutils.git libgloss.git git://git.linaro.org/toolchain/newlib.git -newlib.git git://git.linaro.org/toolchain/newlib.git +newlib.git http://git.linaro.org/git/toolchain/newlib.git abe.git http://git@staging.git.linaro.org/git/toolchain/abe.git -eglibc.git git://git.linaro.org/toolchain/eglibc.git -glibc.git git://git.linaro.org/toolchain/glibc.git +eglibc.git http://git.linaro.org/git/toolchain/eglibc.git +glibc.git http://git.linaro.org/git/toolchain/glibc.git bitbake.git git://git.openembedded.org/bitbake # nomatch.git don't uncomment and don't use this identifier. foo.git git://testingrepository/foo |