aboutsummaryrefslogtreecommitdiffstats
path: root/util/tests/sym_versions/test_glibc.py
blob: c76359c54ce2a585a28127a05015173d2425cb7e (plain) (blame)
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
import os
import functools

import yatest.common as yc
import library.python.resource as lpr


def construct_path(p):
    parts = p.split('/')

    return p + '/' + '-'.join(parts[-3:])


def iter_binaries():
    ok = False

    for l in lpr.find('/test_binaries').split('\n'):
        if '# start' in l:
            ok = True
        else:
            if '# end' in l:
                ok = False

            if ok:
                yield construct_path(l.strip())


for p in iter_binaries():
    globals()['test_' + os.path.basename(p).replace('-', '_')] = functools.partial(yc.process.check_glibc_version, p)