~ubuntu-branches/ubuntu/trusty/tla/trusty

« back to all changes in this revision

Viewing changes to src/hackerlab/bugs/test-coverage.h

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Suffield
  • Date: 2004-05-30 20:13:29 UTC
  • Revision ID: james.westby@ubuntu.com-20040530201329-mgovd2u99mkxi0hf
Tags: upstream-1.2
ImportĀ upstreamĀ versionĀ 1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* tag: Tom Lord Tue Dec  4 14:41:26 2001 (test-coverage.h)
 
2
 */
 
3
/* test-coverage.h -
 
4
 *
 
5
 ****************************************************************
 
6
 * Copyright (C) 2000 Tom Lord
 
7
 * 
 
8
 * See the file "COPYING" for further information about
 
9
 * the copyright and warranty status of this work.
 
10
 */
 
11
 
 
12
#ifndef INCLUDE__BUGS__TEST_COVERAGE_H
 
13
#define INCLUDE__BUGS__TEST_COVERAGE_H
 
14
 
 
15
 
 
16
#include "hackerlab/bugs/panic.h"
 
17
 
 
18
 
 
19
 
 
20
/* example:
 
21
 *
 
22
 * #define TEST_COVERAGE_LIST(MACRO) \
 
23
 *   TEST_COVERAGE_ ## MACRO (name1); \
 
24
 *   TEST_COVERAGE_ ## MACRO (name2); \
 
25
 *   ...                              \
 
26
 *   TEST_COVERAGE_ ## MACRO (name2) \
 
27
 *
 
28
 *
 
29
 * TEST_COVERAGE_LIST(DECL);
 
30
 *
 
31
 *
 
32
 * {
 
33
 *      ...
 
34
 *   TEST_COVERED(name_n);
 
35
 * 
 
36
 * }
 
37
 * 
 
38
 * 
 
39
 *
 
40
 * {
 
41
 *    TEST_COVERAGE_LIST(CHECK);
 
42
 *    exit (0);
 
43
 * }
 
44
 */
 
45
 
 
46
#define TEST_COVERAGE_DECL(NAME)        static int NAME = 0
 
47
#define TEST_COVERAGE_CHECK(NAME)       if (!NAME) panic ("test coverage failure: " #NAME)
 
48
#define TEST_COVERED(NAME)  NAME = 1
 
49
 
 
50
 
 
51
 
 
52
/* automatically generated __STDC__ prototypes */
 
53
#endif  /* INCLUDE__BUGS__TEST_COVERAGE_H */