From 4340e3c55b38af280823d8d9c5364919c47c61a8 Mon Sep 17 00:00:00 2001 From: fosslinux Date: Wed, 5 Feb 2020 19:50:38 +1100 Subject: [PATCH] Add super basic runtime tests to travis --- .gitignore | 5 +++++ .travis.yml | 1 + .travis/test.answer | 15 +++++++++++++++ .travis/test.expect | 5 +++++ .travis/test.sh | 10 ++++++++++ 5 files changed, 36 insertions(+) create mode 100644 .travis/test.answer create mode 100755 .travis/test.expect create mode 100755 .travis/test.sh diff --git a/.gitignore b/.gitignore index 2bee4ed..c2dd2fa 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,11 @@ README.options bin2c gophernicus +# +# Test leftovers +# +test.output + # # Release files # diff --git a/.travis.yml b/.travis.yml index 184783e..c8242fd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,3 +17,4 @@ compiler: script: - make - sudo make install + - .travis/test.sh diff --git a/.travis/test.answer b/.travis/test.answer new file mode 100644 index 0000000..f002bea --- /dev/null +++ b/.travis/test.answer @@ -0,0 +1,15 @@ +iWelcome to Gophernicus! TITLE null.host 1 +i _______ __ __ null.host 1 +i| __|.-----.-----.| |--.-----.----.-----.|__|.----.--.--.----- null.host 1 +i| | || _ | _ || | -__| _| || || __| | |__ -- null.host 1 +i|_______||_____| __||__|__|_____|__| |__|__||__||____|_____|_____ null.host 1 +i |__| null.host 1 +iIf you can see this, it means that the installation of Gophernicus null.host 1 +ion this system was successful. You may now add content to this null.host 1 +idirectory and replace this page. null.host 1 +i null.host 1 +iGeneric information: null.host 1 +i null.host 1 +iServer configuration: null.host 1 +i null.host 1 +. diff --git a/.travis/test.expect b/.travis/test.expect new file mode 100755 index 0000000..b784299 --- /dev/null +++ b/.travis/test.expect @@ -0,0 +1,5 @@ +#!/usr/bin/expect +spawn "/usr/bin/gophernicus" +sleep 0.05 +expect "" +send "\n" diff --git a/.travis/test.sh b/.travis/test.sh new file mode 100755 index 0000000..a89aad0 --- /dev/null +++ b/.travis/test.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +echo -e "\n" | gophernicus -nf -nu -nv -nx -nf -nd > test.output +if ! cmp .travis/test.answer test.output ; then + exit 1 +fi + +if ! gophernicus -v | grep -q 'Gophernicus/3.1 "Dungeon Edition"' ; then + exit 1 +fi