From bf2f86d3c6e01831b275fc1c9689773005cbf703 Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Thu, 17 Mar 2011 10:29:01 +0000 Subject: [PATCH] show evaluation errors in log of tests --- tests/Makefile.am | 2 +- tests/evaluation-tests.pl.in | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 2ab5e8f6..df6dbbdf 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -24,7 +24,7 @@ clean : chmod -R a+w nix rm -rf db.sqlite data nix git-repo hg-repo svn-repo svn-checkout svn-checkout-repo bzr-repo bzr-checkout-repo -$(TESTS) : db.sqlite dirs +$(TESTS) : db.sqlite repos db.sqlite : $(top_srcdir)/src/sql/hydra-sqlite.sql sqlite3 db.sqlite < $(top_srcdir)/src/sql/hydra-sqlite.sql diff --git a/tests/evaluation-tests.pl.in b/tests/evaluation-tests.pl.in index 54b4120d..f659498b 100755 --- a/tests/evaluation-tests.pl.in +++ b/tests/evaluation-tests.pl.in @@ -38,6 +38,8 @@ sub createJobsetWithOneSCMInput { $jobsetinput = $jobset->jobsetinputs->create({name => "src", type => $type}); $jobsetinputals = $jobsetinput->jobsetinputalts->create({altnr => 0, value => $uri}); + + return $jobset; } sub evalSucceeds { @@ -57,8 +59,10 @@ ok( nrBuildsForJobset("tests", "basic") == 3 , "Evaluating jobs/basic.nix should my @scminputs = ("svn", "svn-checkout", "git", "bzr", "bzr-checkout", "hg"); foreach my $scm (@scminputs) { - createJobsetWithOneSCMInput($scm, "$scm-input.nix", $scm, "$jobsBaseUri/$scm-repo"); + $jobset = createJobsetWithOneSCMInput($scm, "$scm-input.nix", $scm, "$jobsBaseUri/$scm-repo"); ok(evalSucceeds("tests", $scm), "Evaluating jobs/$scm-input.nix should exit with return code 0."); - ok(nrBuildsForJobset("tests", $scm) == 1, "Evaluating jobs/$scm-input.nix should result in 1 build") + print STDERR "Evaluation errors for jobset tests:$scm: \n".$jobset->errormsg."\n" if $jobset->errormsg; + + ok(nrBuildsForJobset("tests", $scm) == 1, "Evaluating jobs/$scm-input.nix should result in 1 build"); }