Travis CI: add a stupid end-to-end test

This commit is contained in:
Přemysl Eric Janouch 2015-05-12 05:40:20 +02:00
parent 5a0af0364f
commit a513a9a574
2 changed files with 49 additions and 0 deletions

View File

@ -36,3 +36,4 @@ script:
-DWANT_READLINE=$readline -DWANT_LIBEDIT=$libedit -DWANT_READLINE=$readline -DWANT_LIBEDIT=$libedit
- make - make
- cpack -G DEB - cpack -G DEB
- ../test

48
test Executable file
View File

@ -0,0 +1,48 @@
#!/usr/bin/expect -f
# Very basic end-to-end testing for Travis CI
# Run the daemon to test against
system ./kike --write-default-cfg
spawn ./kike -d
# 10 seconds is a bit too much
set timeout 5
spawn ./degesch
# Fuck this Tcl shit, I want the exit code
expect_after {
eof {
puts ""
puts "Child exited prematurely"
exit 1
}
}
# Connect to the daemon
send "/set server.irc_host = \"localhost\"\n"
expect "Option changed"
send "/disconnect\n"
expect "]"
send "/connect\n"
expect "Connection established"
# Try some chatting
send "/join #test\n"
expect "has joined"
send "Hello\n"
expect "Hello"
# Attributes
send "\x1bmbBold text! \x1bmc0,5And colors.\n"
expect "]"
# Try basic commands
send "/set\n"
expect "]"
send "/help\n"
expect "]"
# Quit
send "/quit\n"
expect "Shutting down"