xK/test
Přemysl Eric Janouch 50057d5149
Come up with sillier names for the binaries
I'm not entirely sure, but it looks like some people might not like
jokes about the Holocaust.

On a more serious note, the project has become more serious over
the 7 or so years of its existence.
2021-08-06 16:43:59 +02:00

51 lines
836 B
Plaintext
Executable File

#!/usr/bin/expect -f
# Very basic end-to-end testing for CI
# Run the daemon to test against
system ./xD --write-default-cfg
spawn ./xD -d
# 10 seconds is a bit too much
set timeout 5
spawn ./xC
# Fuck this Tcl shit, I want the exit code
expect_after {
eof {
puts ""
puts "Child exited prematurely"
exit 1
}
}
# Connect to the daemon
send "/server add localhost\n"
expect "]"
send "/set servers.localhost.addresses = \"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"