提交 9065b0bc 创建 作者: 宋海霞's avatar 宋海霞

modify

上级 1b809ede
......@@ -10,7 +10,8 @@
"request": "launch",
"program": "${workspaceFolder}/app.exe",
"args": [],
"stopAtEntry": true,
"stopAtEntry": false,
"preLaunchTask": "make",
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
......@@ -21,7 +22,7 @@
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
],
}
]
}
\ No newline at end of file
}
......@@ -4,7 +4,7 @@
"version": "2.0.0",
"tasks": [
{
"label": "cppbuild",
"label": "make",
"type": "shell",
"command": "make",
"args": [],
......@@ -13,6 +13,39 @@
"reveal": "silent"
},
"problemMatcher": "$msCompile"
}
},
{
"label": "lacal_test_cpp",
"type": "shell",
"command": "python ${workspaceFolder}/local_test_c.py",
"args": [],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
},
{
"label": "make_clean_windows",
"type": "shell",
"command": "make clean_win",
"args": [],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
},
{
"label": "make_clean_linux",
"type": "shell",
"command": "make clean_linux",
"args": [],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
}
]
}
\ No newline at end of file
}
......@@ -109,7 +109,7 @@ if __name__ == "__main__":
print("开发环境中的 Python 解释器版本号:" + platform.python_version())
print("环境变量中的 Python 解释器版本号:", end=' ')
execResult = os.system("python3 --version")
execResult = os.system("python --version")
if execResult != 0:
print(Fore.RED + "应用程序异常,返回值:{0}。".format(execResult), file = stream, end='')
print(Fore.WHITE, file = stream)
......@@ -131,7 +131,7 @@ if __name__ == "__main__":
if not os.path.isfile(outputFile):
break
print("正在使用文件 {0} 验证 case{1}".format(inputFile, seqNum))
runCommand = "make && ./app < {0} > {1}".format(inputFile, useroutputFile)
runCommand = "make && app.exe < {0} > {1}".format(inputFile, useroutputFile)
execResult = os.system(runCommand)
if execResult != 0:
print(Fore.RED + "应用程序异常,返回值:{0}。".format(execResult), file = stream, end='')
......
......@@ -4,7 +4,7 @@ DIR_OBJ = .
DIR_BIN = .
SRC = $(wildcard ${DIR_SRC}/*.cpp)
OBJ = $(patsubst %.c,${DIR_OBJ}/%.o,$(notdir ${SRC}))
OBJ = $(patsubst %.cpp,${DIR_OBJ}/%.o,$(notdir ${SRC}))
TARGET = app.exe
......@@ -16,5 +16,11 @@ CFLAGS = -g -w -fmax-errors=10 -std=c++11 -fsigned-char -I${DIR_INC}
${BIN_TARGET}:${OBJ}
$(CC) $(OBJ) -o $@
${DIR_OBJ}/%.o:${DIR_SRC}/%.c
$(CC) $(CFLAGS) -c $< -o $@
\ No newline at end of file
${DIR_OBJ}/%.o:${DIR_SRC}/%.cpp
$(CC) $(CFLAGS) -c $< -o $@
clean_win:
del *.o *.exe
clean_linux:
rm *.o *.exe
\ No newline at end of file
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论