2015-05-12 05:40:20 +02:00
|
|
|
#!/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
|
2015-07-05 20:43:31 +02:00
|
|
|
send "/server add localhost\n"
|
2015-07-05 20:35:28 +02:00
|
|
|
expect "]"
|
2015-07-06 02:36:11 +02:00
|
|
|
send "/set servers.localhost.addresses = \"localhost\"\n"
|
2015-05-12 05:40:20 +02:00
|
|
|
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"
|