diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..d6402e1fe --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ +language: perl +perl: + - "5.24" + - "5.22" + - "5.20" + - "5.18" + - "5.16" + - "5.14" + - "5.08" +install: true +script: cd bin ; ./mh -tk 0 -code_dir ../code/test diff --git a/README.md b/README.md index 76359864d..ab4698402 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ MisterHouse =========== +[![Build Status](https://travis-ci.org/hollie/misterhouse.svg?branch=master)](https://travis-ci.org/hollie/misterhouse) + Perl open source home automation program. It's fun, it's free, and it's entirely geeky. * [Quickstart Guide](https://github.com/hollie/misterhouse/wiki/Getting-started) diff --git a/bin/mh b/bin/mh index a1315e43d..48e9de26d 100755 --- a/bin/mh +++ b/bin/mh @@ -3705,7 +3705,7 @@ sub exit_pgm { $sock->close() if $sock; } - # Use exit code 1 to mean we exited on purpose ... anything else + # Use exit code 0 to mean we exited on purpose ... anything else # we can use in mh_loop to mean accidental exit, 'better restart' if ($restart) { &print_log("Restarting mh"); @@ -3717,7 +3717,7 @@ sub exit_pgm { print "Bye Bye\n"; # exit 1; - POSIX::_exit(1); # MUCH faster ... but no DESTROY or END called. + POSIX::_exit(0); # MUCH faster ... but no DESTROY or END called. } } diff --git a/bin/mhl b/bin/mhl index a0cef728b..f7b0ec022 100755 --- a/bin/mhl +++ b/bin/mhl @@ -23,7 +23,7 @@ while [ 1 = 1 ]; do rc=$? echo mh rc=$rc - if [ $rc = 1 ]; then + if [ $rc = 0 ]; then echo mh exited normally exit fi diff --git a/code/test/test_mh.pl b/code/test/test_mh.pl new file mode 100644 index 000000000..ee2686467 --- /dev/null +++ b/code/test/test_mh.pl @@ -0,0 +1,15 @@ +# Category=Test + +# At startup program a time to stop the test after one minute +my $shutdown_timer = new Timer; #noloop +$shutdown_timer->set(60, \&shutdown); #noloop + +if ($Startup) { + $shutdown_timer->start(); + print_log "Shutdown timer set"; +} + +sub shutdown { + print_log "Stopping self-test, exit..."; + run_voice_cmd("Exit Mister House"); +}