2069637aa3936eea5c71324b46bc169aa34e3198
[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
23 /* reuse solver hack, testsolv use only */
24 #define TESTCASE_RESULT_REUSE_SOLVER    (1 << 31)
25
26 extern Id testcase_str2dep(Pool *pool, const char *s);
27 extern const char *testcase_dep2str(Pool *pool, Id id);
28 extern const char *testcase_repoid2str(Pool *pool, Id repoid);
29 extern const char *testcase_solvid2str(Pool *pool, Id p);
30 extern Repo *testcase_str2repo(Pool *pool, const char *str);
31 extern Id testcase_str2solvid(Pool *pool, const char *str);
32 extern const char *testcase_job2str(Pool *pool, Id how, Id what);
33 extern Id testcase_str2job(Pool *pool, const char *str, Id *whatp);
34 extern int testcase_write_testtags(Repo *repo, FILE *fp);
35 extern int testcase_add_testtags(Repo *repo, FILE *fp, int flags);
36 extern const char *testcase_getsolverflags(Solver *solv);
37 extern int testcase_setsolverflags(Solver *solv, const char *str);
38 extern void testcase_resetsolverflags(Solver *solv);
39 extern char *testcase_solverresult(Solver *solv, int flags);
40 extern int testcase_write(Solver *solv, const char *dir, int resultflags, const char *testcasename, const char *resultname);
41 extern Solver *testcase_read(Pool *pool, FILE *fp, const char *testcase, Queue *job, char **resultp, int *resultflagsp);
42 extern char *testcase_resultdiff(const char *result1, const char *result2);