-
Notifications
You must be signed in to change notification settings - Fork 0
/
crbehave_private.h
69 lines (59 loc) · 1.33 KB
/
crbehave_private.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef CRBEHAVE_PRIVATE_H
#define CRBEHAVE_PRIVATE_H
#include "crbehave.h"
#include <sys/types.h>
#include <stdbool.h>
#include <regex.h>
struct match
{
regex_t preg;
regmatch_t pmatch[MATCH_MAX_SUB];
int type;
const char *str;
union {
int val;
char *str;
} v;
int res;
};
typedef enum crbehave_test {
CRBEHAVE_TEST_GIVEN, CRBEHAVE_TEST_WHEN, CRBEHAVE_TEST_THEN
} CRBehaveTest;
struct crbehave_scenario;
struct crbehave_step
{
CRBehaveTest type;
KeywordCallback funp;
char *title;
size_t body_offset;
char *body;
size_t body_alloc;
size_t body_len;
bool collect_examples;
struct crbehave_step *next;
struct crbehave_scenario *scenario;
};
struct crbehave_example {
char *line;
char *fields[MAX_TABLE_COLS];
struct crbehave_example *next;
struct crbehave_scenario *scenario;
};
struct crbehave_scenario {
struct crbehave_step *first_step;
struct crbehave_step *last_step;
struct crbehave_step *last_step_with_callback;
struct crbehave_example *example_field_names;
struct crbehave_example *first_example;
char *title;
bool is_outline;
bool collect_examples;
int sno; /* scenario number */
struct crbehave_scenario *next;
};
int init_workers(int);
void free_workers(void);
int crbehave_queue_worker(int,
void (*)(int, void *), void *);
int crbehave_reap_workers(int *, int *);
#endif