summaryrefslogtreecommitdiff
path: root/tools/protocol.py
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-10-15 17:07:23 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-10-15 23:13:24 -0700
commit55534dc5b1874813249f17efe042294b01b8bd27 (patch)
treee95b824a033eb64999a0ba2fe8d2d8be7c3be772 /tools/protocol.py
parent58e4ec577f3168eba282e9ad36257e9bee0702f2 (diff)
downloadtmwa-55534dc5b1874813249f17efe042294b01b8bd27.tar.gz
tmwa-55534dc5b1874813249f17efe042294b01b8bd27.tar.bz2
tmwa-55534dc5b1874813249f17efe042294b01b8bd27.tar.xz
tmwa-55534dc5b1874813249f17efe042294b01b8bd27.zip
Remove the need for empty source files to check headers
Diffstat (limited to 'tools/protocol.py')
-rwxr-xr-xtools/protocol.py29
1 files changed, 0 insertions, 29 deletions
diff --git a/tools/protocol.py b/tools/protocol.py
index a423722..19f7f4a 100755
--- a/tools/protocol.py
+++ b/tools/protocol.py
@@ -414,22 +414,6 @@ class Include(object):
self.path = path
self._types = []
- def testcase(self, outdir):
- basename = os.path.basename(self.path.strip('<">'))
- root = os.path.splitext(basename)[0]
- filename = 'include_%s_test.cpp' % root.replace('.', '_')
- desc = 'testsuite for protocol includes'
- poison = relpath('src/poison.hpp', outdir)
- with OpenWrite(os.path.join(outdir, filename)) as f:
- f.write(self.pp(0))
- f.write(copyright.format(filename=filename, description=desc))
- f.write('\n')
- f.write('#include "%s"\n\nnamespace tmwa\n{\n' % poison)
-
- for t in self._types:
- f.write('using %s = %s;\n' % ('Test_' + ident(t.name), t.name))
- f.write('} // namespace tmwa\n')
-
def pp(self, n):
return '#%*sinclude %s\n' % (n, '', self.path)
@@ -550,7 +534,6 @@ class Channel(object):
server = self.server
client = self.client
header = '%s-%s.hpp' % (server, client)
- test = '%s-%s_test.cpp' % (server, client)
desc = 'TMWA network protocol: %s/%s' % (server, client)
with OpenWrite(os.path.join(outdir, header)) as f:
proto2 = relpath(outdir, 'src')
@@ -581,16 +564,6 @@ class Channel(object):
p.dump_convert(f)
f.write('} // namespace tmwa\n')
- with OpenWrite(os.path.join(outdir, test)) as f:
- poison = relpath('src/poison.hpp', outdir)
- f.write('#include "%s"\n' % header)
- f.write(copyright.format(filename=test, description=desc))
- f.write('\n')
- f.write(generated)
- f.write('\n')
- f.write('#include "%s"\n\nnamespace tmwa\n{\n' % poison)
- f.write('} // namespace tmwa\n')
-
ident_translation = ''.join(chr(c) if chr(c).isalnum() else '_' for c in range(256))
@@ -670,8 +643,6 @@ class Context(object):
f.write('\n//TODO split the includes\n')
for inc in self._includes:
f.write(inc.pp(0))
- # this is writing another file
- inc.testcase(outdir)
f.write('\n')
f.write('namespace tmwa\n{\n')