Adjust rpmdb path in python tests
[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 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_SETUP([$1])
25 AT_KEYWORDS([python])
26 AT_CHECK([RPMPY_RUN([[$2]])], [], [$3], [$4])
27 AT_CLEANUP
28 ])
29
30 AT_INIT