Skip to content

Commit

Permalink
Merge pull request #604 from hollie/add_travis_support
Browse files Browse the repository at this point in the history
Add Travis CI regression test support
  • Loading branch information
hollie authored Jul 26, 2016
2 parents 7652187 + af11f8f commit f7e97cf
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 3 deletions.
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions bin/mh
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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.
}
}

Expand Down
2 changes: 1 addition & 1 deletion bin/mhl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions code/test/test_mh.pl
Original file line number Diff line number Diff line change
@@ -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");
}

0 comments on commit f7e97cf

Please sign in to comment.