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

Method cc_test_cexpr

numpy/distutils/ccompiler_opt.py:1094–1110  ·  view source on GitHub ↗

Same as the above but supports compile-time expressions.

(self, cexpr, flags=[])

Source from the content-addressed store, hash-verified

1092
1093 @_Cache.me
1094 def cc_test_cexpr(self, cexpr, flags=[]):
1095 """
1096 Same as the above but supports compile-time expressions.
1097 """
1098 self.dist_log("testing compiler expression", cexpr)
1099 test_path = os.path.join(self.conf_tmp_path, "npy_dist_test_cexpr.c")
1100 with open(test_path, "w") as fd:
1101 fd.write(textwrap.dedent(f"""\
1102 #if !({cexpr})
1103 #error "unsupported expression"
1104 #endif
1105 int dummy;
1106 """))
1107 test = self.dist_test(test_path, flags)
1108 if not test:
1109 self.dist_log("testing failed", stderr=True)
1110 return test
1111
1112 def cc_normalize_flags(self, flags):
1113 """

Callers 1

__init__Method · 0.95

Calls 5

openFunction · 0.85
dist_testMethod · 0.80
dist_logMethod · 0.45
joinMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected