Author: aschnell Date: Thu Aug 23 15:51:54 2007 New Revision: 6835 URL: http://svn.opensuse.org/viewcvs/zypp?rev=6835&view=rev Log: - check output Added: trunk/libzypp-testsuite/pokus/tests/arch-tests/all.ref.out trunk/libzypp-testsuite/pokus/tests/parse-tests/yum1.ref.out Modified: trunk/libzypp-testsuite/pokus/pokus.test/pokus_test.exp trunk/libzypp-testsuite/pokus/src/testsuite.rb trunk/libzypp-testsuite/pokus/tests/arch-tests/all.rb Modified: trunk/libzypp-testsuite/pokus/pokus.test/pokus_test.exp URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/pokus/pokus.test/pokus_test.exp?rev=6835&r1=6834&r2=6835&view=diff ============================================================================== --- trunk/libzypp-testsuite/pokus/pokus.test/pokus_test.exp (original) +++ trunk/libzypp-testsuite/pokus/pokus.test/pokus_test.exp Thu Aug 23 15:51:54 2007 @@ -37,6 +37,9 @@ set testBase_name [lindex $testFname 0] puts "Running $testDirname/$testFilename" + set refoutfile ./$testBase_name.ref.out + set referrfile ./$testBase_name.ref.err + set tmpoutfile ./$testBase_name.tmp.out set tmperrfile ./$testBase_name.tmp.err @@ -51,6 +54,30 @@ continue } + # check optional referr + if { [ file exists $dircase/$referrfile ] != 0 } { + if { [ diff $dircase/$referrfile $dircase/$tmperrfile ] != 1 } { + puts "Output doesn't match expected data:" + puts [ exec sh -c "cd $dircase ; diff -u $referrfile $tmperrfile || true" ] + fail $testBase_name + set errorOccured 0 + continue + } + } + + # check required refout + if { [ file exists $dircase/$refoutfile ] == 0 } { + perror "Missing file $dircase/$refoutfile" 0 + } else { + if { [ diff $dircase/$refoutfile $dircase/$tmpoutfile ] != 1 } { + puts "Output doesn't match expected data:" + puts [ exec sh -c "cd $dircase ; diff -u $refoutfile $tmpoutfile || true" ] + fail $testBase_name + set errorOccured 0 + continue + } + } + # ok, all is fine pass $testBase_name } Modified: trunk/libzypp-testsuite/pokus/src/testsuite.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/pokus/src/testsuite.rb?rev=6835&r1=6834&r2=6835&view=diff ============================================================================== --- trunk/libzypp-testsuite/pokus/src/testsuite.rb (original) +++ trunk/libzypp-testsuite/pokus/src/testsuite.rb Thu Aug 23 15:51:54 2007 @@ -68,5 +68,46 @@ end + + # TODO: can't this be done more elegant? + def Testsuite.haha1(x) + y = Array.new + x.each do |z| + y << z + end + return y.sort + end + + def Testsuite.haha2(x) + y = Array.new + x.each do |z| + y << z + end + y.map! {|a| a.resolvable} + return y.sort + end + + + def Testsuite.dump_deps(res, kind) + deps = res.dep(kind) + Testsuite.haha1(deps).each do |dep| + case kind.in_switch + when Dep.PROVIDES.in_switch : puts " Provides: #{dep.to_s}" + when Dep.PREREQUIRES.in_switch : puts " Prerequires: #{dep.to_s}" + when Dep.REQUIRES.in_switch : puts " Requires: #{dep.to_s}" + when Dep.CONFLICTS.in_switch : puts " Conflicts: #{dep.to_s}" + when Dep.OBSOLETES.in_switch : puts " Obsoletes: #{dep.to_s}" + when Dep.RECOMMENDS.in_switch : puts " Recommends: #{dep.to_s}" + when Dep.SUGGESTS.in_switch : puts " Suggests: #{dep.to_s}" + when Dep.FRESHENS.in_switch : puts " Freshens: #{dep.to_s}" + when Dep.ENHANCES.in_switch : puts " Enhances: #{dep.to_s}" + when Dep.SUPPLEMENTS.in_switch : puts " Supplements: #{dep.to_s}" + else + puts " Unknown: #{dep.to_s}" + end + end + end + + end Modified: trunk/libzypp-testsuite/pokus/tests/arch-tests/all.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/pokus/tests/arch-tests/all.rb?rev=6835&r1=6834&r2=6835&view=diff ============================================================================== --- trunk/libzypp-testsuite/pokus/tests/arch-tests/all.rb (original) +++ trunk/libzypp-testsuite/pokus/tests/arch-tests/all.rb Thu Aug 23 15:51:54 2007 @@ -18,7 +18,7 @@ packages = Array.new() -Arch.all_archs.each do | arch | +Arch.all_archs.each do |arch| pkg = Package.new("test") pkg.arch = arch pkg.version = "1.2" @@ -31,24 +31,23 @@ path = Testsuite.write_repo(:yum, packages) -Arch.all_archs.each do | arch | +Arch.all_archs.map{|x|x.to_s}.sort.each do |arch| x = Arch.new(arch) - puts "#{x.arch} -> #{x.compat.join(' ')}" + puts "#{x.arch} -> #{x.compat.map{|y|y.to_s}.sort.join(' ')}" Testsuite.set_arch(x.arch) t = Array.new() pool = Testsuite.read_repo("file://" + path) - pool.each do | p | - r = p.resolvable - puts "#{r.kind_to_s} #{r.name} #{r.edition.to_s} #{r.arch.to_s}" - t.push(r.arch.to_s) + Testsuite::haha2(pool).each do |res| + puts "#{res.kind_to_s} #{res.name} #{res.edition.to_s} #{res.arch.to_s}" + t.push(res.arch.to_s) end - if not x.compat.map{|x|x.to_s}.sort().eql?(t.sort()) + if not x.compat.map{|y|y.to_s}.sort.eql?(t.sort()) puts "Error: archs don't match" exit 1 end Added: trunk/libzypp-testsuite/pokus/tests/arch-tests/all.ref.out URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/pokus/tests/arch-tests/all.ref.out?rev=6835&view=auto ============================================================================== --- trunk/libzypp-testsuite/pokus/tests/arch-tests/all.ref.out (added) +++ trunk/libzypp-testsuite/pokus/tests/arch-tests/all.ref.out Thu Aug 23 15:51:54 2007 @@ -0,0 +1,68 @@ +athlon -> athlon i386 i486 i586 i686 noarch +package test 1.2-1 noarch +package test 1.2-1 i386 +package test 1.2-1 i486 +package test 1.2-1 i586 +package test 1.2-1 i686 +package test 1.2-1 athlon + +i386 -> i386 noarch +package test 1.2-1 noarch +package test 1.2-1 i386 + +i486 -> i386 i486 noarch +package test 1.2-1 noarch +package test 1.2-1 i386 +package test 1.2-1 i486 + +i586 -> i386 i486 i586 noarch +package test 1.2-1 noarch +package test 1.2-1 i386 +package test 1.2-1 i486 +package test 1.2-1 i586 + +i686 -> i386 i486 i586 i686 noarch +package test 1.2-1 noarch +package test 1.2-1 i386 +package test 1.2-1 i486 +package test 1.2-1 i586 +package test 1.2-1 i686 + +ia64 -> i386 i486 i586 i686 ia64 noarch +package test 1.2-1 noarch +package test 1.2-1 i386 +package test 1.2-1 i486 +package test 1.2-1 i586 +package test 1.2-1 i686 +package test 1.2-1 ia64 + +noarch -> noarch +package test 1.2-1 noarch + +ppc -> noarch ppc +package test 1.2-1 noarch +package test 1.2-1 ppc + +ppc64 -> noarch ppc ppc64 +package test 1.2-1 noarch +package test 1.2-1 ppc +package test 1.2-1 ppc64 + +s390 -> noarch s390 +package test 1.2-1 noarch +package test 1.2-1 s390 + +s390x -> noarch s390 s390x +package test 1.2-1 noarch +package test 1.2-1 s390 +package test 1.2-1 s390x + +x86_64 -> athlon i386 i486 i586 i686 noarch x86_64 +package test 1.2-1 noarch +package test 1.2-1 i386 +package test 1.2-1 i486 +package test 1.2-1 i586 +package test 1.2-1 i686 +package test 1.2-1 athlon +package test 1.2-1 x86_64 + Added: trunk/libzypp-testsuite/pokus/tests/parse-tests/yum1.ref.out URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/pokus/tests/parse-tests/yum1.ref.out?rev=6835&view=auto ============================================================================== --- trunk/libzypp-testsuite/pokus/tests/parse-tests/yum1.ref.out (added) +++ trunk/libzypp-testsuite/pokus/tests/parse-tests/yum1.ref.out Thu Aug 23 15:51:54 2007 @@ -0,0 +1,2 @@ +ZYppException caught +Valid metadata not found at specified URL(s) -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org