MCPcopy Create free account
hub / github.com/numpy/numpy / FakeCCompilerOpt

Class FakeCCompilerOpt

numpy/distutils/tests/test_ccompiler_opt.py:39–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37)
38
39class FakeCCompilerOpt(CCompilerOpt):
40 fake_info = ""
41 def __init__(self, trap_files="", trap_flags="", *args, **kwargs):
42 self.fake_trap_files = trap_files
43 self.fake_trap_flags = trap_flags
44 CCompilerOpt.__init__(self, None, **kwargs)
45
46 def __repr__(self):
47 return textwrap.dedent("""\
48 <<<<
49 march : {}
50 compiler : {}
51 ----------------
52 {}
53 >>>>
54 """).format(self.cc_march, self.cc_name, self.report())
55
56 def dist_compile(self, sources, flags, **kwargs):
57 assert(isinstance(sources, list))
58 assert(isinstance(flags, list))
59 if self.fake_trap_files:
60 for src in sources:
61 if re.match(self.fake_trap_files, src):
62 self.dist_error("source is trapped by a fake interface")
63 if self.fake_trap_flags:
64 for f in flags:
65 if re.match(self.fake_trap_flags, f):
66 self.dist_error("flag is trapped by a fake interface")
67 # fake objects
68 return zip(sources, [' '.join(flags)] * len(sources))
69
70 def dist_info(self):
71 return FakeCCompilerOpt.fake_info
72
73 @staticmethod
74 def dist_log(*args, stderr=False):
75 pass
76
77class _Test_CCompilerOpt:
78 arch = None # x86_64

Callers 1

noptMethod · 0.70

Calls

no outgoing calls

Tested by 1

noptMethod · 0.56