msm: consistency for equally ranked keys
[platform/upstream/rpm.git] / tests / local.at
1 AT_TESTED([rpm rpmbuild rpmquery])
2
3 m4_define([RPMDB_INIT],[[
4 runroot rpm --initdb
5 ]])
6
7 m4_define([RPMDB_CLEAR],[[
8 rm -rf "${abs_builddir}"/testing`rpm --eval '%_dbpath'`/*
9 ]])
10
11 m4_define([RPMPY_RUN],[[
12 cat << EOF > test.py
13 import rpm, sys
14 dbpath=rpm.expandMacro('%_dbpath')
15 rpm.addMacro('_dbpath', '${abs_builddir}/testing%s' % dbpath)
16 def myprint(msg = ''):
17     sys.stdout.write('%s\n' % msg)
18 $1
19 EOF
20 python test.py
21 ]])
22
23 m4_define([RPMPY_CHECK],[
24 AT_CHECK([RPMPY_RUN([$1])], [], [$2], [$3])
25 ])
26
27 m4_define([RPMPY_TEST],[
28 AT_SETUP([$1])
29 AT_KEYWORDS([python])
30 RPMDB_CLEAR
31 RPMDB_INIT
32 RPMPY_CHECK([$2], [$3], [$4])
33 AT_CLEANUP
34 ])
35
36 AT_INIT