summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2018-11-30 12:40:43 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2018-11-30 12:40:43 +0900
commite1659dc4ce74d3c47f465103951dafff8fc0cf9f (patch)
treee135d41257133e53a1a09571fbdf3cb284b49bba /tools
parent97330b5a608c2213fdf3f49bfbaa268bf9627920 (diff)
downloadlibsolv-e1659dc4ce74d3c47f465103951dafff8fc0cf9f.tar.gz
libsolv-e1659dc4ce74d3c47f465103951dafff8fc0cf9f.tar.bz2
libsolv-e1659dc4ce74d3c47f465103951dafff8fc0cf9f.zip
Imported Upstream version 0.6.28upstream/0.6.28
Change-Id: I7eea26ff3eb092805c915018606cc185fa47e21f Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/testsolv.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/tools/testsolv.c b/tools/testsolv.c
index d0328ae..d751246 100644
--- a/tools/testsolv.c
+++ b/tools/testsolv.c
@@ -68,7 +68,7 @@ main(int argc, char **argv)
Pool *pool;
Queue job;
Queue solq;
- Solver *solv;
+ Solver *solv, *reusesolv = 0;
char *result = 0;
int resultflags = 0;
int debuglevel = 0;
@@ -140,7 +140,12 @@ main(int argc, char **argv)
pool_free(pool);
exit(resultflags == 77 ? 77 : 1);
}
-
+ if (reusesolv)
+ {
+ solver_free(solv);
+ solv = reusesolv;
+ reusesolv = 0;
+ }
if (!multijob && !feof(fp))
multijob = 1;
@@ -179,8 +184,8 @@ main(int argc, char **argv)
solver_solve(solv, &job);
solv->solution_callback = 0;
solv->solution_callback_data = 0;
- if (!resultflags)
- resultflags = TESTCASE_RESULT_TRANSACTION | TESTCASE_RESULT_PROBLEMS;
+ if ((resultflags & ~TESTCASE_RESULT_REUSE_SOLVER) == 0)
+ resultflags |= TESTCASE_RESULT_TRANSACTION | TESTCASE_RESULT_PROBLEMS;
myresult = testcase_solverresult(solv, resultflags);
if (rescallback && reportsolutiondata.result)
{
@@ -292,8 +297,13 @@ main(int argc, char **argv)
}
}
queue_free(&job);
- solver_free(solv);
+ if ((resultflags & TESTCASE_RESULT_REUSE_SOLVER) != 0 && !feof(fp))
+ reusesolv = solv;
+ else
+ solver_free(solv);
}
+ if (reusesolv)
+ solver_free(reusesolv);
pool_free(pool);
fclose(fp);
}