rafritts / bunit Goto Github PK
View Code? Open in Web Editor NEWA unit testing framework for Shell scripts - namely Bash.
License: MIT License
A unit testing framework for Shell scripts - namely Bash.
License: MIT License
[bash --version = GNU bash, version 5.0.3(1)-release (x86_64-pc-linux-gnu)]
Hi, I'm not sure if this project is still being maintained but I've noticed an issue when testing a script containing:
shopt -s nullglob
Specifically, it breaks bunit.shl - something to do with passing the parameter-array (args[@]) from the assert* functions to __assert and usually fixed with judicious use of quotes.
Happy to concede that this is likely to be a low-frequency problem :-)
I started using the nullglob option after reading this guide to improving Bash scripts
Hi @atz3ro,
Great library you made here! I have found it really useful. I have forked this project and done some rather extensive refactoring of the code to make it more maintainable (IMHO) and fix some bugs with the Line numbers reporting and error messages. Please refer to my fork. It is a rather extensive refactoring of the codebase, but would you be interested in a pull request?
please test this with set -u
you'll notice that you're using variables that are uninitialized
I have played with your nice bunit a bit.
it is very useful and simple to use.
One thing I would think to be a good addition is to have a TAP or junit like XML output so that this file can be parsed during a CI pipeline, and the name/number/state of the test suite be reported.
TAP
https://en.wikipedia.org/wiki/Test_Anything_Protocol
This is what I found to describe the expected junit.xml file format
https://github.com/windyroad/JUnit-Schema/blob/master/JUnit.xsd
https://stackoverflow.com/questions/4922867/what-is-the-junit-xml-format-specification-that-hudson-supports
What do you think ?
How and where in our project do we install this lib as a dev dependency and following the best practices?
For example, in javascript, we use the "npm" as dependencies manager: $ npm install --save-dev this-super-lib
and "this-super-lib" goes directly in a specify directory "node_modules" and will be not build in the prod env. Is there something like this for shell dependencies?
There is no documentation in your README about installation best practices... :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.