taking *.solution in the testsuit
authorStefan Schubert <schubi@suse.de>
Tue, 10 Jan 2006 14:47:30 +0000 (14:47 +0000)
committerStefan Schubert <schubi@suse.de>
Tue, 10 Jan 2006 14:47:30 +0000 (14:47 +0000)
zypp/Edition.cc
zypp/solver/testsuite/deptestomatic.cc
zypp/solver/testsuite/lib/solver_init.exp

index 7aa7991..e4a2ec9 100644 (file)
@@ -269,8 +269,7 @@ namespace zypp
   {
     string ret;
 
-#warning RE-fix asString and supress epoch
-//    if ( _pimpl->_epoch )
+    if ( _pimpl->_epoch )
       ret += str::form(  "%d:", _pimpl->_epoch );
 
     ret += _pimpl->_version;
index 6a61f27..c5feb4b 100644 (file)
@@ -24,6 +24,7 @@
  * USA.
  */
 
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -305,8 +306,7 @@ add_to_world_cb (ResItem_constPtr resItem, void *data)
 static void
 load_channel (const string & name, const string & filename, const string & type, bool system_packages)
 {
-//    string pathname = "deptestomatic/" + filename;
-    string pathname = filename;
+    string pathname = "deptestomatic/" + filename;
 
     if (getenv ("RC_SPEW")) fprintf (stderr, "load_channel(%s,%s,%s,%s)\n", name.c_str(), pathname.c_str(), type.c_str(), system_packages?"system":"non-system");
 
@@ -731,6 +731,8 @@ init_libzypp (void)
 int
 main (int argc, char *argv[])
 {
+    setenv("ZYPP_NOLOG","1",1); // no logging
+    
     if (argc != 2) {
        fprintf (stderr, "Usage: deptestomatic testfile.xml\n");
        exit (0);
index 2259c5a..129e549 100644 (file)
@@ -119,7 +119,7 @@ proc multi-run { src } {
 
   puts "Running $base_name..."
 
-  set testcases [glob $base_name/*.xml ]
+  set testcases [glob $base_name/*-test.xml ]
 
   foreach testcase $testcases { 
       set testPath [split $testcase "/"]
@@ -131,14 +131,13 @@ proc multi-run { src } {
       #generate output directory
 
       exec mkdir -p ./$base_name/out
-      set errfile ./$base_name/out/$testBase_name.err
-      set referrfile ./$base_name/$testBase_name.err
-      set outfile ./$base_name/out/$testBase_name.out
-      set refoutfile ./$base_name/$testBase_name.out
+      set outfile ./$base_name/out/$testBase_name.mistake
+      set outfilegrep ./$base_name/out/$testBase_name.grep
+      set refoutfile ./$base_name/$testBase_name.solution
 
       # run the test
 
-      set command "LD_LIBRARY_PATH=\"\${LD_LIBRARY_PATH}:../src/.libs\" $src $testcase >$outfile 2>$errfile"
+      set command "LD_LIBRARY_PATH=\"\${LD_LIBRARY_PATH}:../src/.libs\" $src $testcase >$outfile 2>$outfile"
       set result ""
       set oops [catch { set result [exec sh -c $command] } catched]
 
@@ -156,24 +155,14 @@ proc multi-run { src } {
          continue
       }
 
+      exec sh -c "/usr/bin/fgrep \'>!>\' $outfile >$outfilegrep"
+
       if { [ file exists $refoutfile ] == 0 } {
          perror "Missing file $refoutfile" 0
       } else {
-         if { [ diff $refoutfile $outfile ] != 1 } {
-             puts "Output doesn't match expected data:"
-             puts [ exec sh -c "diff -u $refoutfile $outfile || true" ]
-             fail $testBase_name
-             set errorOccured 0
-             continue
-         }
-      }
-
-      if { [ file exists $referrfile ] == 0 } {
-         perror "Missing file $referrfile" 0
-      } else {
-         if { [ diff $referrfile $errfile ] != 1 } {
+         if { [ diff $refoutfile $outfilegrep ] != 1 } {
              puts "Output doesn't match expected data:"
-             puts [ exec sh -c "diff -u $referrfile $errfile || true" ]
+             puts [ exec sh -c "diff -u $refoutfile $outfilegrep || true" ]
              fail $testBase_name
              set errorOccured 0
              continue