summaryrefslogtreecommitdiffabout
path: root/tests/atlocal.in
blob: 2f01c304c7e8469b0dbce3811fc9581c3f2a83b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# @configure_input@                                     -*- shell-script -*-
# Configurable variable values for Wydawca test suite.
# Copyright (C) 2009-2012 Sergey Poznyakoff

PATH=@abs_builddir@:@abs_top_builddir@/src:@abs_top_srcdir@/build-aux:$top_srcdir:$srcdir:$PATH

XFAILFILE=$abs_builddir/.badversion

trap "cleanup; test -r $XFAILFILE && cat $XFAILFILE; exit $?" 1 2 13 15

WD_CONFSRC=@abs_top_srcdir@/tests/etc
WD_DISTDIR=@abs_top_srcdir@/tests/dist
WD_SRC=@abs_top_builddir@/tests/source
WD_DST=@abs_top_builddir@/tests/dest
WD_MAILUTILS=@WD_MAILUTILS@
MKDIR_P="@MKDIR_P@"

wydawca_init_testdirs() {
	for dir in "$WD_SRC" "$WD_SRC/test" "${WD_SRC}/fail" "${WD_SRC}/ok" "$WD_DST"
	do
		if test -d "$dir"; then
			rm -rf "$dir"/*
		else
			mkdir "$dir"
	        fi
	done
}

wydawca_clean_testdirs() {
	rm -rf "$WD_SRC" "$WD_DST"
}

wydawca_expandmeta() {
	sed "s/@USER@/$USER/g;
             s,@WD_SRC@,$WD_SRC,g;
	     s,@WD_DST@,$WD_DST,g;
	     s,@WD_CONFSRC@,$WD_CONFSRC,g;
	     s,@WD_MODDIR@,@abs_top_builddir@/modules/mailutils,g" $1 > $2
}

wydawca_config() {
	wydawca_expandmeta $WD_CONFSRC/${1}in $1
}

wydawca_upload() {
	dir="$WD_SRC/$1"
	shift
	file=$1
	shift
	cp "$WD_DISTDIR/$file" "$dir"
	cp "$WD_DISTDIR/$file.sig" "$dir"
	if test -n "$1"; then
	  cp "$WD_DISTDIR/$1" "$dir/$file.directive.asc"
	else
	  cp "$WD_DISTDIR/$file.directive.asc" "$dir"
	fi
}

wydawca_cmp() {
	p=$1
	shift
	for file in $@
	do
		cmp "$WD_DISTDIR/$file" "$WD_DST/$p/$file" || exit 1
	done
}

wydawca_cmparc() {
	p=$1
	shift
	for file in $@
	do
		cmp "$WD_DISTDIR/$file" "$WD_DST/$p/archive/$file" || exit 1
	done
}

Return to:

Send suggestions and report system problems to the System administrator.