File: cmd-test-result-print.c

package info (click to toggle)
dovecot 1%3A1.2.15-7%2Bdeb6u1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 30,340 kB
  • ctags: 20,012
  • sloc: ansic: 191,443; sh: 21,091; makefile: 3,330; cpp: 526; perl: 108; xml: 44
file content (74 lines) | stat: -rw-r--r-- 1,557 bytes parent folder | download | duplicates (2)
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
70
71
72
73
74
/* Copyright (c) 2002-2010 Dovecot Sieve authors, see the included COPYING file
 */

#include "sieve-common.h"
#include "sieve-script.h"
#include "sieve-commands.h"
#include "sieve-validator.h"
#include "sieve-generator.h"
#include "sieve-interpreter.h"
#include "sieve-code.h"
#include "sieve-binary.h"
#include "sieve-dump.h"
#include "sieve.h"

#include "testsuite-common.h"
#include "testsuite-result.h"

/*
 * Test_result_execute command
 *
 * Syntax:
 *   test_result_execute
 */

static bool cmd_test_result_print_generate
	(const struct sieve_codegen_env *cgenv, struct sieve_command *cmd);

const struct sieve_command_def cmd_test_result_print = {
	"test_result_print",
	SCT_COMMAND,
	0, 0, FALSE, FALSE,
	NULL, NULL, NULL,
	cmd_test_result_print_generate,
	NULL
};

/*
 * Operation
 */

static int cmd_test_result_print_operation_execute
	(const struct sieve_runtime_env *renv, sieve_size_t *address);

const struct sieve_operation_def test_result_print_operation = {
	"TEST_RESULT_PRINT",
	&testsuite_extension,
	TESTSUITE_OPERATION_TEST_RESULT_PRINT,
	NULL,
	cmd_test_result_print_operation_execute
};

/*
 * Code generation
 */

static bool cmd_test_result_print_generate
(const struct sieve_codegen_env *cgenv, struct sieve_command *cmd)
{
	sieve_operation_emit(cgenv->sbin, cmd->ext, &test_result_print_operation);

	return TRUE;
}

/*
 * Intepretation
 */

static int cmd_test_result_print_operation_execute
(const struct sieve_runtime_env *renv, sieve_size_t *address ATTR_UNUSED)
{
	testsuite_result_print(renv);

	return SIEVE_EXEC_OK;
}