From 66f3e60e2a85081ebdc4862ced32429a3e525934 Mon Sep 17 00:00:00 2001 From: Petr Rockai Date: Wed, 10 Jul 2013 11:50:24 +0200 Subject: [PATCH] Add a test for darcs inputs. --- release.nix | 4 ++-- tests/evaluation-tests.pl | 9 ++++++++- tests/jobs/darcs-input.nix | 10 ++++++++++ tests/jobs/darcs-update.sh | 24 ++++++++++++++++++++++++ tests/query-all-tables.pl | 2 +- 5 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 tests/jobs/darcs-input.nix create mode 100755 tests/jobs/darcs-update.sh diff --git a/release.nix b/release.nix index 868ba424..05366f74 100644 --- a/release.nix +++ b/release.nix @@ -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 = '' diff --git a/tests/evaluation-tests.pl b/tests/evaluation-tests.pl index 2044c1be..90ae41df 100755 --- a/tests/evaluation-tests.pl +++ b/tests/evaluation-tests.pl @@ -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" } ); diff --git a/tests/jobs/darcs-input.nix b/tests/jobs/darcs-input.nix new file mode 100644 index 00000000..9374b1f6 --- /dev/null +++ b/tests/jobs/darcs-input.nix @@ -0,0 +1,10 @@ +with import ./config.nix; +{ src }: +{ + copy = + mkDerivation { + name = "git-input"; + builder = ./scm-builder.sh; + inherit src; + }; +} diff --git a/tests/jobs/darcs-update.sh b/tests/jobs/darcs-update.sh new file mode 100755 index 00000000..164a9e9d --- /dev/null +++ b/tests/jobs/darcs-update.sh @@ -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 diff --git a/tests/query-all-tables.pl b/tests/query-all-tables.pl index d786505c..3b25057d 100755 --- a/tests/query-all-tables.pl +++ b/tests/query-all-tables.pl @@ -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";