-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRemote.sdk.Prompt-bot.yml
More file actions
140 lines (126 loc) · 6.06 KB
/
Remote.sdk.Prompt-bot.yml
File metadata and controls
140 lines (126 loc) · 6.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: "" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) 启动",
"type": "cppdbg",
"request": "launch",
"program": "",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceRoot}",
"externalConsole": true,
"environment": [],
"MIMode": "gdb",
"miDebuggerPath": "",
"miDebuggerServerAddress": "",
"setupCommands": [
{
"description": "endlian little",
"text": "set endian little",
"ignoreFailures": false
},
{
"text": "target remote 50.50.1.95:50000",
"description": "connect to target",
"ignoreFailures": false
},
{
"description": "monitor reset",
"text": "monitor reset",
"ignoreFailures": false
},
{
"description": "monitor halt",
"text": "monitor halt",
"ignoreFailures": false
},
{
"description": "file",
"text": "-file-exec-and-symbols \"\"",
"ignoreFailures": false
},
{
"description": "load file",
"text": "load",
"ignoreFailures": false
},
{
"description": "break main",
"text": "break main",
"ignoreFailures": false
}
],
"targetArchitecture": "mips"
}
]
}
import json
import os
def test_debug_configuration():
# Test case 1: Check if the configuration file is in JSON format
assert isinstance(debug_configuration, dict)
# Test case 2: Check if the configuration file contains the required fields
required_fields = ["version", "configurations"]
for field in required_fields:
assert field in debug_configuration
# Test case 3: Check if the configuration file contains the correct number of configurations
assert len(debug_configuration["configurations"]) == 1
# Test case 4: Check if the configuration contains the required fields for a debug configuration
required_debug_fields = ["name", "type", "request", "program", "args", "stopAtEntry", "cwd", "externalConsole", "environment", "MIMode", "miDebuggerPath", "miDebuggerServerAddress", "setupCommands", "targetArchitecture"]
for field in required_debug_fields:
assert field in debug_configuration["configurations"][0]
# Test case 5: Check if the configuration contains the correct values for the fields
assert debug_configuration["configurations"][0]["name"] == "(gdb) 启动"
assert debug_configuration["configurations"][0]["type"] == "cppdbg"
assert debug_configuration["configurations"][0]["request"] == "launch"
assert debug_configuration["configurations"][0]["program"] == ""
assert debug_configuration["configurations"][0]["args"] == []
assert debug_configuration["configurations"][0]["stopAtEntry"] == True
assert debug_configuration["configurations"][0]["cwd"] == "${workspaceRoot}"
assert debug_configuration["configurations"][0]["externalConsole"] == True
assert debug_configuration["configurations"][0]["environment"] == []
assert debug_configuration["configurations"][0]["MIMode"] == "gdb"
assert debug_configuration["configurations"][0]["miDebuggerPath"] == ""
assert debug_configuration["configurations"][0]["miDebuggerServerAddress"] == ""
assert debug_configuration["configurations"][0]["targetArchitecture"] == "mips"
# Test case 6: Check if the setupCommands contain the correct commands
setup_commands = debug_configuration["configurations"][0]["setupCommands"]
assert len(setup_commands) == 7
assert setup_commands[0]["description"] == "endlian little"
assert setup_commands[0]["text"] == "set endian little"
assert setup_commands[0]["ignoreFailures"] == False
assert setup_commands[1]["description"] == "connect to target"
assert setup_commands[1]["text"] == "target remote 50.50.1.95:50000"
assert setup_commands[1]["ignoreFailures"] == False
assert setup_commands[2]["description"] == "monitor reset"
assert setup_commands[2]["text"] == "monitor reset"
assert setup_commands[2]["ignoreFailures"] == False
assert setup_commands[3]["description"] == "monitor halt"
assert setup_commands[3]["text"] == "monitor halt"
assert setup_commands[3]["ignoreFailures"] == False
assert setup_commands[4]["description"] == "file"
assert setup_commands[4]["text"] == "-file-exec-and-symbols \"\""
assert setup_commands[4]["ignoreFailures"] == False
assert setup_commands[5]["description"] == "load file"
assert setup_commands[5]["text"] == "load"
assert setup_commands[5]["ignoreFailures"] == False
assert setup_commands[6]["description"] == "break main"
assert setup_commands[6]["text"] == "break main"
assert setup_commands[6]["ignoreFailures"] == False
print("All test cases pass")
# Load the debug configuration file
with open(os.path.join(os.path.dirname(__file__), "launch.json"), "r") as file:
debug_configuration = json.load(file)
# Run the test cases
test_debug_configuration()