summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2012-02-21 17:57:54 +0100
committerMichael Schroeder <mls@suse.de>2012-02-21 17:57:54 +0100
commit84891eea1ecba1ff9e0a942da9a54f2dbf3c373e (patch)
tree48f39bf7d9118419f618fd04fb79c57e86e61ec3 /test
parentb5d3813a51b1beeacf8f63dfce7b143ab997ed6b (diff)
downloadlibsolv-84891eea1ecba1ff9e0a942da9a54f2dbf3c373e.tar.gz
libsolv-84891eea1ecba1ff9e0a942da9a54f2dbf3c373e.tar.bz2
libsolv-84891eea1ecba1ff9e0a942da9a54f2dbf3c373e.zip
- add a simple testcase
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt9
-rwxr-xr-xtest/runtestcases18
-rw-r--r--test/testcases/sat/mm-packages.repo.gzbin0 -> 120 bytes
-rw-r--r--test/testcases/sat/mm-system.repo.gzbin0 -> 143 bytes
-rw-r--r--test/testcases/sat/mm-test.t17
5 files changed, 44 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
new file mode 100644
index 0000000..713c1f7
--- /dev/null
+++ b/test/CMakeLists.txt
@@ -0,0 +1,9 @@
+FOREACH(tcdir testcases libsolv_zypptestcases)
+ IF(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${tcdir}")
+ FILE(GLOB dirs "${CMAKE_CURRENT_SOURCE_DIR}/${tcdir}/*")
+ FOREACH(dir ${dirs})
+ FILE(RELATIVE_PATH myname "${CMAKE_CURRENT_SOURCE_DIR}/${tcdir}" ${dir})
+ ADD_TEST(${myname} ${CMAKE_CURRENT_SOURCE_DIR}/runtestcases ${CMAKE_BINARY_DIR}/tools/testsolv ${dir})
+ ENDFOREACH(dir)
+ ENDIF(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${tcdir}")
+ENDFOREACH(tcdir)
diff --git a/test/runtestcases b/test/runtestcases
new file mode 100755
index 0000000..0764a6a
--- /dev/null
+++ b/test/runtestcases
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+cmd=$1
+dir=$2
+
+if test -z "$dir"; then
+ echo "Usage: runtestcases <cmd> <dir>";
+ exit 1
+fi
+
+ex=0
+for tc in $(find $dir -name \*.t) ; do
+ if ! $cmd $tc > /dev/null ; then
+ echo "${tc#$dir} failed"
+ ex=1
+ fi
+done
+exit $ex
diff --git a/test/testcases/sat/mm-packages.repo.gz b/test/testcases/sat/mm-packages.repo.gz
new file mode 100644
index 0000000..fd4aa08
--- /dev/null
+++ b/test/testcases/sat/mm-packages.repo.gz
Binary files differ
diff --git a/test/testcases/sat/mm-system.repo.gz b/test/testcases/sat/mm-system.repo.gz
new file mode 100644
index 0000000..ef1ac5f
--- /dev/null
+++ b/test/testcases/sat/mm-system.repo.gz
Binary files differ
diff --git a/test/testcases/sat/mm-test.t b/test/testcases/sat/mm-test.t
new file mode 100644
index 0000000..ea7b574
--- /dev/null
+++ b/test/testcases/sat/mm-test.t
@@ -0,0 +1,17 @@
+#
+# testcase to check enabling/disabling of learnt rules
+#
+repo system 0 susetags mm-system.repo.gz
+repo test 0 susetags mm-packages.repo.gz
+system i686 rpm system
+job install provides E
+job verify all packages
+result transaction,problems <inline>
+#>erase D-1.0-1.noarch@system
+#>erase D2-1.0-1.noarch@system
+#>problem a3755a16 info package E-2.0-1.noarch requires foo, but none of the providers can be installed
+#>problem a3755a16 solution 6d40bce1 deljob install provides E
+#>problem a3755a16 solution c06ed43e erase D-1.0-1.noarch@system
+#>problem a3755a16 solution c8a04f77 erase D2-1.0-1.noarch@system
+#>upgrade A-1.0-1.noarch@system A-2.0-1.noarch@test
+#>upgrade A2-1.0-1.noarch@system A2-2.0-1.noarch@test