summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-11-22 11:22:01 +0200
committerPanu Matilainen <pmatilai@redhat.com>2008-11-22 11:22:01 +0200
commit1c57e1d337c00b475253c522461f689e911bc426 (patch)
treec208af248197caac9a255223cc599a5de207d39d /tests
parenta5ff12cc192f7a2a4bf0506006b50f7452be4cab (diff)
downloadlibrpm-tizen-1c57e1d337c00b475253c522461f689e911bc426.tar.gz
librpm-tizen-1c57e1d337c00b475253c522461f689e911bc426.tar.bz2
librpm-tizen-1c57e1d337c00b475253c522461f689e911bc426.zip
Add some (trivial) macro evaluation tests
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/rpmmacro.at39
-rw-r--r--tests/rpmtests.at1
3 files changed, 41 insertions, 0 deletions
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])