Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding dump file #25

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true


[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4

[*.rs]
indent_style = space
indent_size = 4

[*.toml]
indent_style = space
indent_size = 4

[*.md]
trim_trailing_whitespace = false
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ rust:
- beta
script: |
cargo build --verbose &&
cargo test --verbose
cargo test --verbose --all
matrix: # additional tests
include:
- rust: nightly
script: |
cargo test --features nightly
cargo test --all --features nightly
- rust: nightly-2018-04-15
env: CLIPPY_VERS="0.0.194"
before_script: |
[[ "$(cargo +nightly-2018-04-15 clippy --version)" != "$CLIPPY_VERS" ]] && \
cargo +nightly-2018-04-15 install clippy --vers "$CLIPPY_VERS" --force || true
script: |
cargo +nightly-2018-04-15 clippy -- -D warnings
cargo +nightly-2018-04-15 clippy --all -- -D warnings
- rust: 1.25.0 # `stable`: Locking down for consistent behavior
env: RUSTFMT=yes_please
install:
- rustup component add rustfmt-preview
script:
- cargo fmt -- --write-mode=diff
- cargo fmt --all -- --write-mode=diff
cache: cargo
203 changes: 203 additions & 0 deletions Cargo.lock

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repository = "https://github.com/yoshuawuyts/human-panic"
homepage = "https://github.com/yoshuawuyts/human-panic"
documentation = "https://docs.rs/human-panic"
description = "Panic messages for humans"
authors = ["Yoshua Wuyts <[email protected]>",
authors = ["Yoshua Wuyts <[email protected]>",
"Pascal Hertleif <[email protected]>",
"Katharina Fey <[email protected]>"]
readme = "README.md"
Expand All @@ -27,3 +27,8 @@ backtrace = "0.3"

[features]
nightly = []

[workspace]
members = [
"tests/single-panic",
]
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,49 @@ We take privacy seriously, and do not perform any automated error collection. In
Thank you kindly!
```

The error dump file generated by `human-panic` contains the following fields.

```toml
name = 'single-panic-test'
operating_system = 'unix:Unknown'
crate_version = '0.1.0'
explanation = '''
Cause: OMG EVERYTHING IS ON FIRE!!!. Panic occurred in file 'tests/single-panic/src/main.rs' at line 8
'''
method = 'Panic'
backtrace = '''
stack backtrace:
0: 0x55fa0ed4c1b4 - backtrace::backtrace::libunwind::trace::h69e50feca54bfb84
at /home/spacekookie/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.6/src/backtrace/libunwind.rs:53
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't reproduce this output locally, it says /Users/pascal/.cargo/… on my machine :trollface:

Copy link
Collaborator Author

@spacekookie spacekookie Apr 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh Pascal.... 😅

- backtrace::backtrace::trace::h42967341e0b01ccc
at /home/spacekookie/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.6/src/backtrace/mod.rs:42

# ...

8: 0x55fa0ebaac8d - single_panic_test::main::h56a3d326bcecfc36
at tests/single-panic/src/main.rs:8
9: 0x55fa0ebaae91 - std::rt::lang_start::{{closure}}::h09d28d8540038bf8
at /checkout/src/libstd/rt.rs:74
10: 0x55fa0ed732f7 - std::rt::lang_start_internal::{{closure}}::h2e4baf0a27c956a3
at libstd/rt.rs:59
- std::panicking::try::do_call::h73f98ed0647c7274
at libstd/panicking.rs:305
11: 0x55fa0ed8551e - __rust_maybe_catch_panic
at libpanic_unwind/lib.rs:101
12: 0x55fa0ed6f7f5 - std::panicking::try::h18fbb145180d4cd9
at libstd/panicking.rs:284
- std::panic::catch_unwind::hc4b6a212a30b4bc5
at libstd/panic.rs:361
- std::rt::lang_start_internal::h8b001b4244930d51
at libstd/rt.rs:58
13: 0x55fa0ebaae71 - std::rt::lang_start::h1b1de624209f414a
at /checkout/src/libstd/rt.rs:74
14: 0x55fa0ebaacbd - main
15: 0x7f9946132f29 - __libc_start_main
16: 0x55fa0eba9b79 - _start
17: 0x0 - <unknown>'''
```

## Usage

```rust no_run
Expand Down
10 changes: 10 additions & 0 deletions tests/single-panic/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "single-panic-test"
version = "0.1.0"
authors = ["Human Panic Authors <[email protected]>"]

[dependencies]
human-panic = { path = "../.." }

[dev-dependencies]
assert_cli = "0.5.4"
File renamed without changes.
14 changes: 14 additions & 0 deletions tests/single-panic/tests/integration.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
extern crate assert_cli;

#[test]
fn integration() {
assert_cli::Assert::main_binary()
.stderr()
.contains("single-panic-test")
.stderr()
.contains("Human Panic Authors")
.stderr()
.contains("[email protected]")
.fails_with(101)
.unwrap();
}