b299a7778bc5f942eb9de837a0f964d9a061ceea
[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`run rpm --eval '%_dbpath'`/*
9 ]])
10
11 m4_define([RPMPY_RUN],[
12 cat << EOF > test.py
13 import rpm, sys
14 def myprint(msg = ''):
15     sys.stdout.write('%s\n' % msg)
16 $1
17 EOF
18 python test.py
19 ])
20
21 m4_define([RPMPY_CHECK],[
22 AT_SETUP([$1])
23 AT_KEYWORDS([python])
24 AT_CHECK([RPMPY_RUN([[$2]])], [], [$3], [$4])
25 AT_CLEANUP
26 ])
27
28 AT_INIT