summaryrefslogtreecommitdiff
path: root/trunk/src/echangelog/test
diff options
context:
space:
mode:
authorfuzzyray <fuzzyray@gentoo.org>2009-05-05 17:39:24 +0000
committerfuzzyray <fuzzyray@gentoo.org>2009-05-05 17:39:24 +0000
commitc819d146be6bce86d97019494173253e71b85d2f (patch)
tree200d00c2b9a420540ff9c4e0d8b3080b762fb562 /trunk/src/echangelog/test
parent61823fe68081c6f8edf24455bbb34123598c5bb4 (diff)
downloadgentoolkit-c819d146be6bce86d97019494173253e71b85d2f.tar.gz
Rearrange trunk to support gentoolkit version 0.3. Split into gentoolkit, gentoolkit-dev, and deprecated. Import djanderson's work on the gentoolkit library and equery
svn path=/trunk/gentoolkit/; revision=589
Diffstat (limited to 'trunk/src/echangelog/test')
-rw-r--r--trunk/src/echangelog/test/TEST.pm26
-rw-r--r--trunk/src/echangelog/test/templates/test.patch6
-rw-r--r--trunk/src/echangelog/test/templates/vcstest-0.0.1.ebuild16
-rwxr-xr-xtrunk/src/echangelog/test/test.sh178
4 files changed, 0 insertions, 226 deletions
diff --git a/trunk/src/echangelog/test/TEST.pm b/trunk/src/echangelog/test/TEST.pm
deleted file mode 100644
index 6632148..0000000
--- a/trunk/src/echangelog/test/TEST.pm
+++ /dev/null
@@ -1,26 +0,0 @@
-# We just return a static/predefined date because we're working with
-# static md5 checksums.
-
-package TEST;
-
-use strict;
-use warnings;
-
-BEGIN {
- use Exporter();
- our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
-
- $VERSION = 1.00;
-
- @ISA = qw(Exporter);
- @EXPORT = qw(&strftime);
- %EXPORT_TAGS = ( );
- @EXPORT_OK = qw();
-}
-our @EXPORT_OK;
-
-sub strftime {
- return "01 Jan 2009";
-}
-
-1;
diff --git a/trunk/src/echangelog/test/templates/test.patch b/trunk/src/echangelog/test/templates/test.patch
deleted file mode 100644
index 72d46fa..0000000
--- a/trunk/src/echangelog/test/templates/test.patch
+++ /dev/null
@@ -1,6 +0,0 @@
---- test.patch 2009-04-28 14:13:26.171225175 +0200
-+++ test.patch 2009-04-28 14:12:26.246497830 +0200
-@@ -0,0 +1,3 @@
-+This is just an example.
-+Its used for several echangelog tests.
-+
diff --git a/trunk/src/echangelog/test/templates/vcstest-0.0.1.ebuild b/trunk/src/echangelog/test/templates/vcstest-0.0.1.ebuild
deleted file mode 100644
index 2824b83..0000000
--- a/trunk/src/echangelog/test/templates/vcstest-0.0.1.ebuild
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: $
-
-DESCRIPTION="echangelog test ebuild"
-HOMEPAGE=""
-SRC_URI=""
-
-LICENSE=""
-SLOT="0"
-KEYWORDS=""
-IUSE=""
-
-DEPEND=""
-RDEPEND=""
-
diff --git a/trunk/src/echangelog/test/test.sh b/trunk/src/echangelog/test/test.sh
deleted file mode 100755
index f2052f3..0000000
--- a/trunk/src/echangelog/test/test.sh
+++ /dev/null
@@ -1,178 +0,0 @@
-#!/bin/sh
-
-source /etc/init.d/functions.sh
-
-SUPPORTED_VCS=( "cvs" "svn" "git" )
-VCSTEST="echangelog-test/vcstest"
-_ROOT=$(pwd)
-
-export ECHANGELOG_USER="Just a test <echangelogtest@gentoo.org>"
-
-MD5_INIT="34d54bc2ab1a2154b0c7bd5cdd7f6119"
-MD5_PATCH="db1ab89bb7374824d0f198078f79a83f"
-MD5_REVBUMP="31ddfa60d2ae4dd1fccd7e3d2bd2c06c"
-MD5_COPYRIGHT="6f39fa409ea14bb6506347c53f6dee50"
-MD5_OBSOLETE="0aedadf159c6f3add97a3f79fb867221"
-MD5_FINAL="17eb0df69f501cc6fdaffebd118b7764"
-
-function md5() {
- local fname=$1
- echo $(md5sum ${fname} | awk '{ print $1 }')
-}
-
-function ech() {
- local bin=$1
- local msg=$2
-
- perl -I$(dirname $(dirname ${bin})) ${bin} "${msg}"
-}
-
-function make_test() {
- local root=$1
- local vcs=$2
-
- local echangelog="${root}/tmp/echangelog"
- local tmp="${root}/tmp/${vcs}"
- local template="${root}/templates"
-
- cd $root
- mkdir -p ${tmp}
- cd ${tmp}
-
- [[ "${vcs}" == "cvs" ]] && mkdir -p ${tmp}/cvsroot
- [[ "${vcs}" == "svn" ]] && mkdir -p ${tmp}/svnroot
-
- if [[ "${vcs}" == "git" ]];
- then
- git init
- touch .gitignore
- git add .gitignore
- git commit -a -m 'Initial Commit'
- elif [[ "${vcs}" == "svn" ]];
- then
- svnadmin create svnroot
- svn co file://${tmp}/svnroot svn
- cd svn
- elif [[ "${vcs}" == "cvs" ]];
- then
- CVSROOT="${tmp}/cvsroot" cvs init
- mkdir cvsroot/cvs
- cvs -d:local:${tmp}/cvsroot co cvs
- cd cvs
- fi
-
- mkdir -p ${VCSTEST}
-
- cp ${template}/vcstest-0.0.1.ebuild ${VCSTEST}
- ${vcs} add $(dirname ${VCSTEST})
- if [[ "${vcs}" == "cvs" ]];
- then
- ${vcs} add ${VCSTEST}
- ${vcs} add "${VCSTEST}/vcstest-0.0.1.ebuild"
- fi
-
- cd ${VCSTEST}
- ech ${echangelog} 'New ebuild for bug <id>.'
-
- if [[ "${MD5_INIT}" != "$(md5 ChangeLog)" ]];
- then
- eerror "WRONG MD5_INIT!"
- fi
-
- mkdir files
- cp ${template}/test.patch files
- if [[ "${vcs}" == "cvs" ]];
- then
- ${vcs} add files/
- ${vcs} add files/test.patch
- else
- ${vcs} add files
- fi
-
- ech ${echangelog} "Added adittional patch to fix foo."
-
- if [[ "${MD5_PATCH}" != "$(md5 ChangeLog)" ]];
- then
- eerror "WRONG MD5_PATCH!"
- fi
-
- if [[ "${vcs}" == "svn" ]];
- then
- ${vcs} commit -m 'New ebuild for bug <id>.' ../
- else
- ${vcs} commit -m 'New ebuild for bug <id>.'
- fi
-
- [[ "${vcs}" == "cvs" ]] && sed -i -e 's:# $Header\: .*$:# $Header\: $:' ChangeLog
-
- cp vcstest-0.0.1.ebuild vcstest-0.0.1-r1.ebuild
- ${vcs} add vcstest-0.0.1-r1.ebuild
-
- ech ${echangelog} "Revbump..."
-
- if [[ "${MD5_REVBUMP}" != "$(md5 ChangeLog)" ]];
- then
- eerror "WRONG MD5_REVBUMP!"
- fi
-
- sed -i -e 's:# Copyright 1999-2009 Gentoo Foundation:# Copyright 1999-2010 Gentoo Foundation:' vcstest-0.0.1.ebuild
- ech ${echangelog} "Revbump...; Just copyright changed."
-
- if [[ "${MD5_COPYRIGHT}" != "$(md5 ChangeLog)" ]];
- then
- eerror "WRONG MD5_COPYRIGHT!"
- fi
-
- if [[ "${vcs}" == "cvs" ]];
- then
- rm -f files/test.patch
- ${vcs} remove files/test.patch
- else
- ${vcs} rm files/test.patch
- fi
-
- ech ${echangelog} "Revbump...; Just copyright changed; Removed obsolete patch."
-
- if [[ "${MD5_OBSOLETE}" != "$(md5 ChangeLog)" ]];
- then
- eerror "WRONG MD5_OBSOLETE!"
- fi
-
- echo>>vcstest-0.0.1.ebuild
- ech ${echangelog} "Revbump...; Just copyright changed; Removed obsolete patch; Modified more then just the copyright."
-
- if [[ "${MD5_FINAL}" != "$(md5 ChangeLog)" ]];
- then
- eerror "WRONG MD5_FINAL!"
- fi
-}
-
-[[ -d "${_ROOT}/tmp" ]] && rm -rf ${_ROOT}/tmp
-mkdir -p ${_ROOT}/tmp
-
-ebegin "Preparing echangelog"
-
-if [[ -e ../echangelog ]];
-then
- cp ../echangelog "${_ROOT}/tmp" || set $?
- sed -i -e 's:use POSIX qw.*:use POSIX qw(setlocale getcwd);\nuse TEST qw(strftime);:' "${_ROOT}/tmp/echangelog" || set $?
- eend ${1:-0} || exit ${1}
-else
- eerror "error"
- eend ${1:-1}
- exit 1
-fi
-
-for vcs in ${SUPPORTED_VCS[*]};
-do
- if [[ -x "$(which ${vcs} 2>/dev/null)" ]];
- then
- ebegin "Starting test with ${vcs}"
- make_test $_ROOT "${vcs}" || set $?
- eend ${1:-0}
- else
- ewarn "No ${vcs} executable found, skipping test..."
- fi
-done
-
-rm -rf "${_ROOT}/tmp"