Add a test for darcs inputs.

This commit is contained in:
Petr Rockai 2013-07-10 11:50:24 +02:00
parent d31e4469bb
commit 66f3e60e2a
5 changed files with 45 additions and 4 deletions

View file

@ -112,14 +112,14 @@ in rec {
buildInputs =
[ makeWrapper libtool unzip nukeReferences pkgconfig boehmgc sqlite
gitAndTools.topGit mercurial subversion bazaar openssl bzip2
gitAndTools.topGit mercurial darcs subversion bazaar openssl bzip2
guile # optional, for Guile + Guix support
perlDeps perl
];
hydraPath = lib.makeSearchPath "bin" (
[ libxslt sqlite subversion openssh nix coreutils findutils
gzip bzip2 lzma gnutar unzip git gitAndTools.topGit mercurial gnused graphviz bazaar
gzip bzip2 lzma gnutar unzip git gitAndTools.topGit mercurial darcs gnused graphviz bazaar
] ++ lib.optionals stdenv.isLinux [ rpm dpkg cdrkit ] );
preCheck = ''

View file

@ -7,7 +7,7 @@ use Setup;
my $db = Hydra::Model::DB->new;
use Test::Simple tests => 68;
use Test::Simple tests => 72;
hydra_setup($db);
@ -102,6 +102,13 @@ my @scminputs = (
type => "hg",
uri => "$jobsBaseUri/hg-repo",
update => getcwd . "/jobs/hg-update.sh"
},
{
name => "darcs",
nixexpr => "darcs-input.nix",
type => "darcs",
uri => "$jobsBaseUri/darcs-repo",
update => getcwd . "/jobs/darcs-update.sh"
}
);

View file

@ -0,0 +1,10 @@
with import ./config.nix;
{ src }:
{
copy =
mkDerivation {
name = "git-input";
builder = ./scm-builder.sh;
inherit src;
};
}

24
tests/jobs/darcs-update.sh Executable file
View file

@ -0,0 +1,24 @@
#! /bin/sh
set -e
repo="$1"
STATE_FILE=$(pwd)/.hg-state
if test -e $STATE_FILE; then
state=$(cat $STATE_FILE)
test $state -gt 1 && state=0
else
state=0;
fi
case $state in
(0) echo "::Create repo. -- continue -- updated::"
mkdir darcs-repo
darcs init --repodir darcs-repo
touch darcs-repo/file
darcs add --repodir darcs-repo file
darcs record --repodir darcs-repo -a -l -m "add a file" file -A foobar@bar.bar
;;
(*) echo "::End. -- stop -- nothing::" ;;
esac
echo $(($state + 1)) > $STATE_FILE

View file

@ -7,7 +7,7 @@ my $db = Hydra::Model::DB->new;
my @sources = $db->schema->sources;
my $nrtables = scalar(@sources);
use Test::Simple tests => 45;
use Test::Simple tests => 42;
foreach my $source (@sources) {
my $title = "Basic select query for $source";