Skip to content

Commit

Permalink
IDE support: add _vscode with launch.json and tasks.json
Browse files Browse the repository at this point in the history
Add _vscode which can be renamed to .vscode. It contains a launch.json
for executing the unit and integration tests (when they are the
currently active editor tab). Additionally, launch.json contains the
relevant build tasks.

Signed-off-by: Johannes Holland <[email protected]>
  • Loading branch information
Johannes Holland authored and joholl committed May 25, 2024
1 parent 891e339 commit 6c46325
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 0 deletions.
53 changes: 53 additions & 0 deletions _vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug Test",
"program": "${workspaceFolder}/${relativeFileDirname}/.libs/${fileBasenameNoExtension}",
"args": [],
"cwd": "${workspaceFolder}",
"env": {
"TPM20TEST_TCTI": "${input:tcti}",
"TSS2_LOG": "all+trace",
"LD_LIBRARY_PATH": "${workspaceFolder}/src/tss2-mu/.libs:${workspaceFolder}/src/tss2-tcti/.libs:${workspaceFolder}/src/tss2-sys/.libs:${workspaceFolder}/src/tss2-esys/.libs:${workspaceFolder}/src/tss2-rc/.libs:${workspaceFolder}/src/tss2-policy/.libs:${workspaceFolder}/src/tss2-fapi/.libs"
},
"preLaunchTask": "build_test",
},
{
"type": "lldb",
"request": "launch",
"name": "Debug tpm2 startup",
"program": "/bin/env",
"args": [
"tpm2",
"startup",
"-c",
"-T${input:tcti}",
],
"cwd": "${workspaceFolder}",
"env": {
"TSS2_LOG": "all+trace",
"LD_LIBRARY_PATH": "${workspaceFolder}/src/tss2-mu/.libs:${workspaceFolder}/src/tss2-tcti/.libs:${workspaceFolder}/src/tss2-sys/.libs:${workspaceFolder}/src/tss2-esys/.libs:${workspaceFolder}/src/tss2-rc/.libs:${workspaceFolder}/src/tss2-policy/.libs:${workspaceFolder}/src/tss2-fapi/.libs"
},
"preLaunchTask": "build_tcti_libtpms",
},
],
"inputs": [
{
"id": "tcti",
"type": "pickString",
"description": "The TCTI for connecting to a TPM",
"options": [
"libtpms",
"swtpm",
"mssim"
],
"default": "libtpms"
}
]
}
39 changes: 39 additions & 0 deletions _vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "build_test",
"command": "make",
"args": [
"-j",
"${relativeFileDirname}/${fileBasenameNoExtension}",
],
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Build single test executable."
},
{
"type": "shell",
"label": "build_tcti_libtpms",
"command": "make",
"args": [
"-j",
"src/tss2-tcti/libtss2-tcti-libtpms.la",
],
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": false
},
"detail": "Build tcti-libtpms"
}
]
}

0 comments on commit 6c46325

Please sign in to comment.