MCPcopy Create free account
hub / github.com/nodejs/node / CompileAndRun

Method CompileAndRun

deps/v8/tools/run-wasm-api-tests.py:98–117  ·  view source on GitHub ↗
(self, compiler, language)

Source from the content-addressed store, hash-verified

96 return code
97
98 def CompileAndRun(self, compiler, language):
99 print("==== %s %s/%s ====" %
100 (self.name, language["name"], compiler["name"]))
101 lang = language["suffix"]
102 src_file = self.src_file_basename + "." + lang
103 exe_file = self.dst_file_basename + "-" + lang
104 obj_file = exe_file + ".o"
105 # Compile.
106 c = _Call([compiler[lang], "-c", language["cflags"], CFLAGS,
107 "-I", WASM_PATH, "-o", obj_file, src_file])
108 if c: return self._Error("compilation", lang, compiler, c)
109 # Link.
110 c = _Call([compiler["cc"], CFLAGS, compiler["ldflags"], obj_file,
111 "-o", exe_file, self.lib_file, "-ldl -pthread"])
112 if c: return self._Error("linking", lang, compiler, c)
113 # Execute.
114 exe_file = "./%s-%s" % (self.name, lang)
115 c = _Call(["cd", self.tempdir, ";", exe_file])
116 if c: return self._Error("execution", lang, compiler, c)
117 return 0
118
119def Main(args):
120 if (len(args) < MIN_ARGS or args[1] in ("-h", "--help", "help")):

Callers 1

MainFunction · 0.95

Calls 3

_ErrorMethod · 0.95
printFunction · 0.70
_CallFunction · 0.70

Tested by

no test coverage detected