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

Error with blank script #41

Closed
CyberShadow opened this issue Dec 29, 2018 · 2 comments
Closed

Error with blank script #41

CyberShadow opened this issue Dec 29, 2018 · 2 comments
Assignees
Labels

Comments

@CyberShadow
Copy link
Contributor

Passing an empty file to bashcov causes it to crash with an exception:

~/tmp/2018-12-29b » bashcov /dev/null 
#<Thread:0x000055b65717d1e0@/home/vladimir/.gem/ruby/2.5.0/gems/bashcov-1.8.0/lib/bashcov/runner.rb:42 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
	4: from /home/vladimir/.gem/ruby/2.5.0/gems/bashcov-1.8.0/lib/bashcov/runner.rb:42:in `block (2 levels) in run'
	3: from /home/vladimir/.gem/ruby/2.5.0/gems/bashcov-1.8.0/lib/bashcov/xtrace.rb:94:in `read'
	2: from /home/vladimir/.gem/ruby/2.5.0/gems/bashcov-1.8.0/lib/bashcov/xtrace.rb:94:in `loop'
	1: from /home/vladimir/.gem/ruby/2.5.0/gems/bashcov-1.8.0/lib/bashcov/xtrace.rb:96:in `block in read'
/home/vladimir/.gem/ruby/2.5.0/gems/bashcov-1.8.0/lib/bashcov/xtrace.rb:121:in `parse_hit!': expected integer for LINENO, got "" (Bashcov::XtraceError)
bashcov: warning: encountered an error parsing Bash's output (error was: expected integer for LINENO, got ""). This can occur if your script or its path contains the sequence "67f53df5-ad00-4ad7-879f-e8a986e1c478", or if your script unsets LINENO. Aborting early; coverage report will be incomplete.
Run completed using bashcov 1.8.0 with Bash 4.4, Ruby 2.5.3, and SimpleCov 0.15.1.
Coverage report generated for /bin/bash /dev/null to /home/vladimir/tmp/2018-12-29b/coverage. 0.0 / 0.0 LOC (100.0%) covered.
tomeon added a commit that referenced this issue Dec 29, 2018
rather than erroneously yielding a number of empty strings.
Corrects the problem (identified in issue #41) in which Bashcov raises a
fatal error when running blank scripts.
@tomeon
Copy link
Collaborator

tomeon commented Dec 29, 2018

@CyberShadow -- TYVM for reporting this issue! I've got a fix pending in #42.

@CyberShadow
Copy link
Contributor Author

Thanks! I was thinking of doing something like bashcov /dev/null to finalize / generate the HTML report as discussed in #40.

@tomeon tomeon added the bug label Dec 31, 2018
@tomeon tomeon self-assigned this Dec 31, 2018
tomeon added a commit that referenced this issue Dec 31, 2018
rather than erroneously yielding a number of empty strings.
Corrects the problem (identified in issue #41) in which Bashcov raises a
fatal error when running blank scripts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants