[go: up one dir, main page]

File: t087_arg_variadic.py

package info (click to toggle)
uftrace 0.13-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 5,212 kB
  • sloc: ansic: 53,313; python: 9,846; makefile: 838; asm: 703; cpp: 602; sh: 560; javascript: 191
file content (31 lines) | stat: -rw-r--r-- 1,184 bytes parent folder | download
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
#!/usr/bin/env python

from runtest import TestBase

class TestCase(TestBase):
    def __init__(self):
        TestBase.__init__(self, 'variadic', result="""
# DURATION    TID     FUNCTION
   1.334 us [ 9624] | __monstartup();
   0.869 us [ 9624] | __cxa_atexit();
            [ 9624] | main() {
            [ 9624] |   variadic("print %c %s %d %ld %lu %lld %f", 'a', "hello", 100, 1234, 5678, 9876543210, 3.141592) {
   8.979 us [ 9624] |     vsnprintf(256, "print %c %s %d %ld %lu %lld %f");
  12.642 us [ 9624] |   } /* variadic */
  13.250 us [ 9624] | } /* main */
""")

    def build(self, name, cflags='', ldflags=''):
        # cygprof doesn't support arguments now
        if cflags.find('-finstrument-functions') >= 0:
            return TestBase.TEST_SKIP

        return TestBase.build(self, name, cflags, ldflags)

    def setup(self):
        self.option  = '-A "variadic@arg1/s,arg2/c,arg3/s,arg4,arg5,arg6,arg7/i64,fparg1" '
        self.option += '-A "vsnprintf@arg2,arg3/s" '

        if TestBase.is_32bit(self):
            self.option  = '-A "variadic@arg1/s,arg2/c,arg3/s,arg4,arg5,arg6,arg7/i64,fparg9" '
            self.option += '-A "vsnprintf@arg2,arg3/s" '