From b5b7375eea15614d984c1696fbe74895719260dd Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 9 Jan 2011 18:56:11 +0000 Subject: [PATCH] * If a subtest fails, mark the build as failed. svn path=/nixos/trunk/; revision=25474 --- lib/test-driver/test-driver.pl | 4 +++- lib/testing.nix | 15 +++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/test-driver/test-driver.pl b/lib/test-driver/test-driver.pl index 1007546804b..0162832db87 100644 --- a/lib/test-driver/test-driver.pl +++ b/lib/test-driver/test-driver.pl @@ -100,7 +100,7 @@ sub runTests { if ($nrTests != 0) { $log->log("$nrSucceeded out of $nrTests tests succeeded", - ($nrSucceeded != $nrTests ? { error => 1 } : { })); + ($nrSucceeded < $nrTests ? { error => 1 } : { })); } } @@ -126,3 +126,5 @@ END { runTests; + +exit ($nrSucceeded < $nrTests ? 1 : 0); diff --git a/lib/testing.nix b/lib/testing.nix index 16e38771172..1cc237cba9d 100644 --- a/lib/testing.nix +++ b/lib/testing.nix @@ -51,13 +51,9 @@ rec { '' ensureDir $out/nix-support - LOGFILE=$out/log.xml ${testDriver}/bin/nixos-test-driver ${network}/vms/*/bin/run-*-vm - - for i in */coverage-data; do - ensureDir $out/coverage-data - mv $i $out/coverage-data/$(dirname $i) - done + LOGFILE=$out/log.xml ${testDriver}/bin/nixos-test-driver ${network}/vms/*/bin/run-*-vm || failed=1 + # Generate a pretty-printed log. xsltproc --output $out/log.html ${./test-driver/log2html.xsl} $out/log.xml ln -s ${./test-driver/logfile.css} $out/logfile.css ln -s ${./test-driver/treebits.js} $out/treebits.js @@ -66,6 +62,13 @@ rec { touch $out/nix-support/hydra-build-products echo "report testlog $out log.html" >> $out/nix-support/hydra-build-products + + for i in */coverage-data; do + ensureDir $out/coverage-data + mv $i $out/coverage-data/$(dirname $i) + done + + [ -z "$failed" ] || touch $out/nix-support/failed ''; # */ };