Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Yuan Zhixiang
c-backend-docker
Commits
fc96c623
Commit
fc96c623
authored
Apr 14, 2024
by
Yuan Zhixiang
Browse files
合并 有/无 用例的情况
parent
556c898a
Changes
1
Show whitespace changes
Inline
Side-by-side
run_cpp_backend.py
View file @
fc96c623
...
...
@@ -82,20 +82,8 @@ if gcc_retcode == 0:
# print >> sys.stderr, '==='
if
input_data
is
None
:
# 无用例输入
# 使用Valgrind运行编译后的代码
VALGRIND_EXE
=
os
.
path
.
join
(
DN
,
'valgrind-3.11.0/inst/bin/valgrind'
)
valgrind_p
=
Popen
([
'stdbuf'
,
'-o0'
,
# 确保stdout不会被缓冲,以便正确追踪
VALGRIND_EXE
,
'--tool=memcheck'
,
'--source-filename='
+
FN
,
'--trace-filename='
+
VGTRACE_PATH
,
EXE_PATH
],
stdout
=
PIPE
,
stderr
=
PIPE
)
(
valgrind_stdout
,
valgrind_stderr
)
=
valgrind_p
.
communicate
()
valgrind_retcode
=
valgrind_p
.
returncode
else
:
# 有用例输入
input_data
=
''
# 使用Valgrind运行编译后的代码
VALGRIND_EXE
=
os
.
path
.
join
(
DN
,
'valgrind-3.11.0/inst/bin/valgrind'
)
valgrind_p
=
Popen
([
'stdbuf'
,
'-o0'
,
# 确保stdout不会被缓冲,以便正确追踪
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment