Skip to content

Commit

Permalink
chore: adds launch for smaller sbom, fixes test cases so they can be …
Browse files Browse the repository at this point in the history
…debugged and executed.
  • Loading branch information
djschleen authored Sep 11, 2024
1 parent 8b878c5 commit 26a55e4
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"editor.formatOnPaste": true,
"git.autofetch": true,
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
},
"extensions": [
Expand Down
42 changes: 42 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,48 @@
"./test/_TESTDATA_/trustier.cyclonedx.json"
],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'trustier' (trustier small SBOM), output to file",
"cargo": {
"args": [
"build",
"--bin=trustier",
"--package=trustier"
],
"filter": {
"name": "trustier",
"kind": "bin"
}
},
"args": [
"--output-file=output/trustier.json",
"./test/_TESTDATA_/trustier.small.cyclonedx.json"
],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'trustier' (trustier)",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=trustier",
"--package=trustier"
],
"filter": {
"name": "trustier",
"kind": "bin"
}
},
"args": [
"./test/_TESTDATA_/trustier.small.cyclonedx.json"
],
"cwd": "${workspaceFolder}"
}
]
}
10 changes: 0 additions & 10 deletions test/cli.rs

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions tests/cli.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

use anyhow::{Ok, Result};
use assert_cmd::Command;
use predicates::prelude::*;

#[test]
fn dies_no_args() -> Result<()> {
let mut cmd = Command::cargo_bin("trustier")?;
cmd.assert()
.failure()
.stderr(predicate::str::contains("Usage"));
Ok(())
}

0 comments on commit 26a55e4

Please sign in to comment.