MCPcopy Create free account
hub / github.com/NetSys/bess / check_header

Function check_header

build.py:119–141  ·  view source on GitHub ↗
(header_file, compiler)

Source from the content-addressed store, hash-verified

117
118
119def check_header(header_file, compiler):
120 test_c_file = '%s/test.c' % DEPS_DIR
121 test_o_file = '%s/test.o' % DEPS_DIR
122
123 src = """
124 #include <%s>
125
126 int main()
127 {
128 return 0;
129 }
130 """ % header_file
131
132 try:
133 with open(test_c_file, 'w') as fp:
134 fp.write(textwrap.dedent(src))
135
136 return cmd_success('%s %s -c %s -o %s' %
137 (compiler, ' '.join(cxx_flags), test_c_file,
138 test_o_file))
139
140 finally:
141 cmd('rm -f %s %s' % (test_c_file, test_o_file), quiet=True)
142
143
144def check_c_lib(lib):

Callers 3

requiredFunction · 0.85
check_bnxFunction · 0.85
check_mlxFunction · 0.85

Calls 2

cmd_successFunction · 0.85
cmdFunction · 0.70

Tested by

no test coverage detected