mudcoders / guildmud

A SocketMUD-based Multi-User Dungeon built and managed by the members of The MUD Coders Guild.
MIT License
26 stars 12 forks source link

Adding end to end testing with expect #34

Closed rogersm closed 6 years ago

rogersm commented 6 years ago

First PR that to add expect end to end testing. It adds a new rule to Makefile (test-telnet) so tests can be run from the command line.

The tests use expect to connect to guildmud. That means that guildmud must be compiled and running before the tests can be run. There are 4 tests:

01-create_user.tcl goes through the create user process and adds a new user (testuser) that's used by the remaining scripts. To ensure testuser is not created, it calls sqlite3 to remove the testuser if exists. That means this script needs to have access to the data/guildmud.db file. 02-login.tcl using testuser created by the previous scripts logs into guildmud. 03-login-fail.tcl tries to log in using an incorrect password. It checks the password routines works fails with an incorrect password.
04-check-command-help.tcl logins using testuser and runs the help command.

Also, the patch adds the Vagrant infrastructure so expect works.

Once this is applied let's discuss how to update Makefile to add this to the Travis pipeline.