~mmach/netext73/meson

« back to all changes in this revision

Viewing changes to test cases/common/59 multiple generators/mygen.py

  • Committer: mmach
  • Date: 2021-02-18 07:35:13 UTC
  • Revision ID: netbit73@gmail.com-20210218073513-7qj73rqnjjc56hmu
revert

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python3
2
 
 
3
 
import sys, os
4
 
 
5
 
if len(sys.argv) != 3:
6
 
    print("You is fail.")
7
 
    sys.exit(1)
8
 
 
9
 
with open(sys.argv[1]) as f:
10
 
    val = f.read().strip()
11
 
outdir = sys.argv[2]
12
 
 
13
 
outhdr = os.path.join(outdir, 'source%s.h' % val)
14
 
outsrc = os.path.join(outdir, 'source%s.cpp' % val)
15
 
 
16
 
with open(outhdr, 'w') as f:
17
 
    f.write('int func%s();\n' % val)
18
 
with open(outsrc, 'w') as f:
19
 
    f.write('''int func%s() {
20
 
    return 0;
21
 
}
22
 
''' % val)