387a5069a0af15b3128f5a869b89b3184b5bd573
[platform/upstream/libsolv.git] / ext / testcase.h
1 /*
2  * Copyright (c) 2012, Novell Inc.
3  *
4  * This program is licensed under the BSD license, read LICENSE.BSD
5  * for further information
6  */
7
8 #include "pool.h"
9 #include "repo.h"
10 #include "solver.h"
11
12 #define TESTCASE_RESULT_TRANSACTION     (1 << 0)
13 #define TESTCASE_RESULT_PROBLEMS        (1 << 1)
14 #define TESTCASE_RESULT_ORPHANED        (1 << 2)
15 #define TESTCASE_RESULT_RECOMMENDED     (1 << 3)
16 #define TESTCASE_RESULT_UNNEEDED        (1 << 4)
17 #define TESTCASE_RESULT_ALTERNATIVES    (1 << 5)
18 #define TESTCASE_RESULT_RULES           (1 << 6)
19 #define TESTCASE_RESULT_GENID           (1 << 7)
20 #define TESTCASE_RESULT_REASON          (1 << 8)
21 #define TESTCASE_RESULT_CLEANDEPS       (1 << 9)
22 #define TESTCASE_RESULT_JOBS            (1 << 10)
23
24 /* reuse solver hack, testsolv use only */
25 #define TESTCASE_RESULT_REUSE_SOLVER    (1 << 31)
26
27 extern Id testcase_str2dep(Pool *pool, const char *s);
28 extern const char *testcase_dep2str(Pool *pool, Id id);
29 extern const char *testcase_repoid2str(Pool *pool, Id repoid);
30 extern const char *testcase_solvid2str(Pool *pool, Id p);
31 extern Repo *testcase_str2repo(Pool *pool, const char *str);
32 extern Id testcase_str2solvid(Pool *pool, const char *str);
33 extern const char *testcase_job2str(Pool *pool, Id how, Id what);
34 extern Id testcase_str2job(Pool *pool, const char *str, Id *whatp);
35 extern int testcase_write_testtags(Repo *repo, FILE *fp);
36 extern int testcase_add_testtags(Repo *repo, FILE *fp, int flags);
37 extern const char *testcase_getsolverflags(Solver *solv);
38 extern int testcase_setsolverflags(Solver *solv, const char *str);
39 extern void testcase_resetsolverflags(Solver *solv);
40 extern char *testcase_solverresult(Solver *solv, int flags);
41 extern int testcase_write(Solver *solv, const char *dir, int resultflags, const char *testcasename, const char *resultname);
42 extern Solver *testcase_read(Pool *pool, FILE *fp, const char *testcase, Queue *job, char **resultp, int *resultflagsp);
43 extern char *testcase_resultdiff(const char *result1, const char *result2);