Imported Upstream version 0.6.29
[platform/upstream/libsolv.git] / ext / testcase.c
index f515057..77cc719 100644 (file)
@@ -23,6 +23,9 @@
 #include "testcase.h"
 #include "selection.h"
 #include "solv_xfopen.h"
+#if ENABLE_TESTCASE_HELIXREPO
+#include "ext/repo_helix.h"
+#endif
 
 #define DISABLE_JOIN2
 #include "tools_util.h"
@@ -175,6 +178,9 @@ static const char *features[] = {
 #ifdef ENABLE_COMPLEX_DEPS
   "complex_deps",
 #endif
+#if ENABLE_TESTCASE_HELIXREPO
+  "testcase_helixrepo",
+#endif
   0
 };
 
@@ -377,6 +383,7 @@ struct oplist {
   { REL_AND,   "&" },
   { REL_OR ,   "|" },
   { REL_WITH , "+" },
+  { REL_WITHOUT , "-" },
   { REL_NAMESPACE , "<NAMESPACE>" },
   { REL_ARCH,       "." },
   { REL_MULTIARCH,  "<MULTIARCH>" },
@@ -386,6 +393,7 @@ struct oplist {
   { REL_KIND,  "<KIND>" },
   { REL_ELSE, "<ELSE>" },
   { REL_ERROR, "<ERROR>" },
+  { REL_UNLESS, "<UNLESS>" },
   { REL_LT, "<" },
   { 0, 0 }
 };
@@ -2266,7 +2274,7 @@ testcase_write_mangled(Solver *solv, const char *dir, int resultflags, const cha
       strqueue_push(&sq, cmd);
     }
 
-  if (resultflags)
+  if ((resultflags & ~TESTCASE_RESULT_REUSE_SOLVER) != 0)
     {
       char *result;
       cmd = 0;
@@ -2513,6 +2521,10 @@ testcase_read(Pool *pool, FILE *fp, const char *testcase, Queue *job, char **res
   int ngenid = 0;
   Queue autoinstq;
 
+  if (resultp)
+    *resultp = 0;
+  if (resultflagsp)
+    *resultflagsp = 0;
   if (!fp && !(fp = fopen(testcase, "r")))
     {
       pool_debug(pool, SOLV_ERROR, "testcase_read: could not open '%s'\n", testcase);
@@ -2617,10 +2629,9 @@ testcase_read(Pool *pool, FILE *fp, const char *testcase, Queue *job, char **res
                  repo_add_solv(repo, rfp, 0);
                  fclose(rfp);
                }
-#if 0
+#if ENABLE_TESTCASE_HELIXREPO
              else if (!strcmp(repotype, "helix"))
                {
-                 extern int repo_add_helix(Repo *repo, FILE *fp, int flags);
                  repo_add_helix(repo, rfp, 0);
                  fclose(rfp);
                }
@@ -2794,8 +2805,10 @@ testcase_read(Pool *pool, FILE *fp, const char *testcase, Queue *job, char **res
          if (resultflagsp)
            *resultflagsp = resultflags;
        }
-      else if (!strcmp(pieces[0], "nextjob") && npieces == 1)
+      else if (!strcmp(pieces[0], "nextjob"))
        {
+         if (npieces == 2 && resultflagsp && !strcmp(pieces[1], "reusesolver"))
+           *resultflagsp |= TESTCASE_RESULT_REUSE_SOLVER;
          break;
        }
       else if (!strcmp(pieces[0], "disable") && npieces == 3)