Add some (trivial) macro evaluation tests

This commit is contained in:
Panu Matilainen 2008-11-22 11:22:01 +02:00
parent a5ff12cc19
commit 1c57e1d337
3 changed files with 41 additions and 0 deletions

View File

@ -22,6 +22,7 @@ TESTSUITE_AT += rpmi.at
TESTSUITE_AT += rpmvercmp.at
TESTSUITE_AT += rpmconflict.at
TESTSUITE_AT += rpmconfig.at
TESTSUITE_AT += rpmmacro.at
EXTRA_DIST += $(TESTSUITE_AT)
## testsuite data

39
tests/rpmmacro.at Normal file
View File

@ -0,0 +1,39 @@
# rpmmacro.at: test rpm macros
#
# ------------------------------
AT_SETUP([simple rpm --eval])
AT_CHECK([
run rpm --define "this that" --eval '%{this}'
],
[0],
[that
])
AT_CLEANUP
AT_SETUP([simple true conditional rpm --eval])
AT_CHECK([
run rpm --define "this that" --eval '%{?this}'
],
[0],
[that
])
AT_CLEANUP
AT_SETUP([simple false conditional rpm --eval])
AT_CHECK([
run rpm --define "this that" --eval '%{?that}'
],
[0],
[
])
AT_CLEANUP
AT_SETUP([simple lua --eval])
AT_CHECK([
run rpm --eval '%{lua:print(5*5)}'
],
[0],
[25
])
AT_CLEANUP

View File

@ -6,3 +6,4 @@ m4_include([rpmbuild.at])
m4_include([rpmvercmp.at])
m4_include([rpmconflict.at])
m4_include([rpmconfig.at])
m4_include([rpmmacro.at])