From 470cf3f63b4d284dbaaef8da936e716438063ac1 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 27 Jul 2015 12:37:11 +0100 Subject: Test suite: rename list-tests to enumerate-tests for ease of completion over tests/lib* --- tests/Makefile | 2 +- tests/enumerate-tests | 107 +++++++++++++++++++++++++++++++++++++++++ tests/list-tests | 107 ----------------------------------------- tests/tests/test-list-uptodate | 2 +- 4 files changed, 109 insertions(+), 109 deletions(-) create mode 100755 tests/enumerate-tests delete mode 100755 tests/list-tests (limited to 'tests') diff --git a/tests/Makefile b/tests/Makefile index 157b487..5bd3eee 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,7 +1,7 @@ # usage: tests/using-intree make -f tests/Makefile # (optionally setting TESTSCRIPTS='tests/tests/foo tests/tests/bar') -TESTSCRIPTS ?= $(shell tests/list-tests) +TESTSCRIPTS ?= $(shell tests/enumerate-tests) TESTNAMES := $(notdir $(TESTSCRIPTS)) all: $(foreach t,$(TESTNAMES),tests/tmp/$t.ok) diff --git a/tests/enumerate-tests b/tests/enumerate-tests new file mode 100755 index 0000000..912ee4f --- /dev/null +++ b/tests/enumerate-tests @@ -0,0 +1,107 @@ +#!/bin/bash + +set -e + +. tests/lib-core +. tests/lib-restricts + +mode=$1 + +test-begin- () { + whynots='' +} + +restriction- () { + set +e + whynot=$(t-restriction-$r) + rc=$? + set -e + case "$rc.$whynot" in + 0.) ;; + 1.?*) whynots="$whynots${whynots:+; }$whynot" ;; + *) fail "restriction $r for $t gave $rc $whynot !" + esac +} + +dependencies- () { + : +} + +test-done- () { + case "$whynots" in + '') echo $t ;; + ?*) echo >&2 "SKIP $t $whynots" ;; + esac +} + +finish- () { + : +} + +test-begin-gencontrol () { + restrictions='' + dependencies='' +} + +restriction-gencontrol () { + restrictions+=" $r" +} + +dependencies-gencontrol () { + dependencies+=", $deps" +} + +test-done-gencontrol () { + stanza=$( + add_Depends="$dependencies" \ + perl &2 "SKIP $t $whynots" ;; - esac -} - -finish- () { - : -} - -test-begin-gencontrol () { - restrictions='' - dependencies='' -} - -restriction-gencontrol () { - restrictions+=" $r" -} - -dependencies-gencontrol () { - dependencies+=", $deps" -} - -test-done-gencontrol () { - stanza=$( - add_Depends="$dependencies" \ - perl $tmp/control-expected +$troot/enumerate-tests gencontrol >$tmp/control-expected diff debian/tests/control $tmp/control-expected -- cgit v1.2.3