Using Travis CI for testing on UNIX shell scripts

Viewed 13249

Background:

I have been using Travis CI for my PHP projects and I really like how they give you a link to a picture that shows the status of the current build of your project.

I am currently making a lot of tools using UNIX shell scripting and would like to use Travis CI to test my UNIX scripts.

I have searched the internet trying to find out how to achieve this. I went to the main website, searched Stackoverflow as well as did a bit of Google searching.

It seems like this isn't possible.

I currently use shunit2 to test my shell scripts and functions.

My question(s) is/are:

  1. Is it possible to use Travis CI to test shell scripts?
  2. If not are there any alternatives that I could use that plug into GitHub?
  3. What is the best way to perform integration testing on shell scripts?
3 Answers

If you need the latest version of shUnit2, you may need to get it from the master branch.

I got it working like this:

---
language: bash
before_script: "sudo curl -o /usr/local/bin/shunit2 https://raw.githubusercontent.com/kward/shunit2/master/shunit2"
script: "bash shunit2/test_example.sh"

See also my example shunit2 repo here.

Related