aboutsummaryrefslogtreecommitdiff
path: root/tests/atlocal.in
blob: 0b7dffc53540231d92010bdbd1901490212759a0 (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
76
77
# @configure_input@                                     -*- shell-script -*-
# Configurable variable values for Wydawca test suite.
# Copyright (C) 2009, 2010, 2011, 2012, 2017, 2019 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

WY_CONFSRC=@abs_top_srcdir@/tests/etc
WY_DISTDIR=@abs_top_srcdir@/tests/dist
WY_SRC=@abs_top_builddir@/tests/source
WY_DST=@abs_top_builddir@/tests/dest
WY_TESTDIR=@abs_top_builddir@/tests
WY_MAILUTILS=@WY_MAILUTILS@
MKDIR_P="@MKDIR_P@"

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

wydawca_clean_testdirs() {
	rm -rf "$WY_SRC" "$WY_DST"
}

wydawca_expandmeta() {
	sed "s/@USER@/$USER/g;
             s,@WY_SRC@,$WY_SRC,g;
	     s,@WY_DST@,$WY_DST,g;
	     s,@WY_CONFSRC@,$WY_CONFSRC,g;
             s,@WY_TESTDIR@,$WY_TESTDIR,g;
	     s,@WY_MODDIR@,@abs_top_builddir@/modules/mailutils,g" $1 > $2
}

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

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

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

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

Return to:

Send suggestions and report system problems to the System administrator.