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

modify

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