summaryrefslogtreecommitdiff
path: root/site_scons/aptitude_configure_ept_checks.py
blob: 319dc5f75dc76b495d701a276904119eed7eae95 (plain)
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
from SCons.Script import AddOption, GetOption
import SCons.Script

from aptitude_configure_checks import RegisterCheck, ConfigureCheck
from aptitude_configure_utils import TryCompileCXX

@ConfigureCheck("Checking for ept::debtags::Tag")
def CheckForDebtagsTag(context):
    return TryCompileCXX(context, '''
#include <ept/debtags/debtags.h>

int main(int argc, char **argv)
{
  ept::debtags::Tag t;

  return 0;
}''')

@ConfigureCheck("Checking for ept::debtags::Facet")
def CheckForDebtagsFacet(context):
    return TryCompileCXX(context, '''
#include <ept/debtags/debtags.h>

int main(int argc, char **argv)
{
  ept::debtags::Facet f;

  return 0;
}''')

@ConfigureCheck("Checking whether ept::debtags::getTagsOfItem returns a set of strings.")
def CheckDebtagsGetTagsOfItemReturnsStrings(context):
    return TryCompileCXX(context, '''
#include <ept/debtags/debtags.h>

int main(int argc, char **argv)
{
  // This would always crash, but we only care if it type-checks.
  ept::debtags::Debtags DB;
  std::set<std::string> result = DB.getTagsOfItem("foo");

  return 0;
}''')

@ConfigureCheck("Checking whether ept::textsearch::TextSearch exists")
def CheckTextsearch(context):
    return TryCompileCXX(context, '''
#include <ept/textsearch/textsearch.h>

int main(int argc, char **argv)
{
  ept::textsearch::TextSearch db;

  db.docidByName("foo");

  return 0;
}''')

@ConfigureCheck("Checking whether ept/axi exists")
def CheckEptAxi(context):
    return TryCompileCXX(context, '''
#include <ept/axi/axi.h>

int main(int argc, char **argv)
{
  Xapian::Database db(ept::axi::path_db());

  return 0;
}''')

@ConfigureCheck("Checking whether ept::debtags::Vocabulary::tagData exists and returns ept::debtags::voc::TagData *")
def CheckEptDebtagsVocabularyTagData(context):
    return TryCompileCXX(context, '''
#include <ept/debtags/vocabulary.h>

int main(int argc, char **argv)
{
  ept::debtags::Vocabulary vocabulary;
  const ept::debtags::voc::TagData *td = vocabulary.tagData("foo");

  // Use td so the compiler doesn\'t complain:
  return td == NULL ? 1 : 0;
}''')

@ConfigureCheck("Checking whether ept::debtags::Vocabulary::facetData exists and returns ept::debtags::voc::FacetData *")
def CheckEptDebtagsVocabularyFacetData(context):
    return TryCompileCXX(context, '''
#include <ept/debtags/vocabulary.h>

int main(int argc, char **argv)
{
  ept::debtags::Vocabulary vocabulary;
  const ept::debtags::voc::FacetData *fd = vocabulary.facetData("foo");

  // Use fd so the compiler doesn\'t complain:
  return fd == NULL ? 1 : 0;
}''')

@ConfigureCheck("Checking whether ept::debtags::Tag::fullName() exists")
def CheckEptDebtagsTagFullName(context):
    return TryCompileCXX(context, '''
#include <ept/debtags/debtags.h>

int main(int argc, char **argv)
{
  ept::debtags::Tag t;

  std::string s = t.fullname();

  return 0;
}''')

@ConfigureCheck("Checking whether ept::debtags::Facet exists and supports description retrieval")
def CheckEptDebtagsFacetDescription(context):
    return TryCompileCXX(context, '''
#include <ept/debtags/debtags.h>

int main(int argc, char **argv)
{
  ept::debtags::Facet f;

  const std::string longDesc = f.longDescription();
  const std::string shortDesc = f.shortDescription();

  return 0;
}''')

@ConfigureCheck("Checking whether ept::debtags::Tag exists and supports description retrieval.")
def CheckEptDebtagsTagDescription(context):
    return TryCompileCXX(context, '''
#include <ept/debtags/debtags.h>

int main(int argc, char **argv)
{
  ept::debtags::Tag t;

  const std::string longDesc = t.longDescription();
  const std::string shortDesc = t.shortDescription();

  return 0;
}''')