diff --git a/tests/Makefile.am b/tests/Makefile.am index f777640a8..212f7352d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 diff --git a/tests/rpmmacro.at b/tests/rpmmacro.at new file mode 100644 index 000000000..a39c3d50e --- /dev/null +++ b/tests/rpmmacro.at @@ -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 diff --git a/tests/rpmtests.at b/tests/rpmtests.at index f18b78928..37c7ec4ed 100644 --- a/tests/rpmtests.at +++ b/tests/rpmtests.at @@ -6,3 +6,4 @@ m4_include([rpmbuild.at]) m4_include([rpmvercmp.at]) m4_include([rpmconflict.at]) m4_include([rpmconfig.at]) +m4_include([rpmmacro.at])