From 37d37a3ad1731e18741a8000343f038d1db27ccd Mon Sep 17 00:00:00 2001 From: Nils Date: Thu, 11 Jan 2018 12:38:39 +0100 Subject: travis icon and typo fix --- README.md | 2 ++ test.sh | 53 ----------------------------------------------------- tests.sh | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 53 deletions(-) delete mode 100755 test.sh create mode 100755 tests.sh diff --git a/README.md b/README.md index 7b5b76e..44f32f1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ gallery.sh ========== +[![Build Status](https://travis-ci.org/Cyclenerd/gallery_shell.svg?branch=master)](https://travis-ci.org/Cyclenerd/gallery_shell) + Bash Script to generate static web galleries. No server-side programs (i.e. PHP, MySQL) required. Overview diff --git a/test.sh b/test.sh deleted file mode 100755 index 1fd898a..0000000 --- a/test.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env bash - -# gallery.sh Test Script -# -# https://github.com/lehmannro/assert.sh - -if [ ! -e assert.sh ]; then - echo "downloading unit test script" - curl -f "https://raw.githubusercontent.com/lehmannro/assert.sh/v1.1/assert.sh" -o assert.sh -fi - -# Download demo files -curl -f "https://cyclenerd.github.io/gallery_shell_demo/Landscape_1.jpg" -o "Landscape_1.jpg" -curl -f "https://cyclenerd.github.io/gallery_shell_demo/Landscape_2.jpg" -o "Landscape_2.jpg" -curl -f "https://cyclenerd.github.io/gallery_shell_demo/Landscape_3.jpg" -o "Landscape_3.jpg" -curl -f "https://cyclenerd.github.io/gallery_shell_demo/Landscape_4.jpg" -o "Landscape_4.jpg" -curl -f "https://cyclenerd.github.io/gallery_shell_demo/Landscape_5.jpg" -o "Landscape_5.jpg" -curl -f "https://cyclenerd.github.io/gallery_shell_demo/Landscape_6.jpg" -o "Landscape_6.jpg" -curl -f "https://cyclenerd.github.io/gallery_shell_demo/Landscape_7.jpg" -o "Landscape_7.jpg" -curl -f "https://cyclenerd.github.io/gallery_shell_demo/Landscape_8.jpg" -o "Landscape_8.jpg" -curl -f "https://cyclenerd.github.io/gallery_shell_demo/Portrait_1.jpg" -o "Portrait_1.jpg" -curl -f "https://cyclenerd.github.io/gallery_shell_demo/Portrait_2.jpg" -o "Portrait_2.jpg" -curl -f "https://cyclenerd.github.io/gallery_shell_demo/Portrait_3.jpg" -o "Portrait_3.jpg" -curl -f "https://cyclenerd.github.io/gallery_shell_demo/Portrait_4.jpg" -o "Portrait_4.jpg" -curl -f "https://cyclenerd.github.io/gallery_shell_demo/Portrait_5.jpg" -o "Portrait_5.jpg" -curl -f "https://cyclenerd.github.io/gallery_shell_demo/Portrait_6.jpg" -o "Portrait_6.jpg" -curl -f "https://cyclenerd.github.io/gallery_shell_demo/Portrait_7.jpg" -o "Portrait_7.jpg" -curl -f "https://cyclenerd.github.io/gallery_shell_demo/Portrait_8.jpg" -o "Portrait_8.jpg" - -# shellcheck disable=SC1091 -source assert.sh - -# `echo test` is expected to write "test" on stdout -assert "echo test" "test" -# `seq 3` is expected to print "1", "2" and "3" on different lines -assert "seq 3" "1\\n2\\n3" -# exit code of `true` is expected to be 0 -assert_raises "true" -# exit code of `false` is expected to be 1 -assert_raises "false" 1 -# end of test suite -assert_end examples - -# $ bash gallery.sh -t Test -assert_raises "bash gallery.sh -t Test" - -assert "cat index.html | grep '

Test

' | tr -d '\011\012\015'" '' -assert "cat index.html | grep '__thumbs/Landscape_1.jpg.html' | tr -d '\011\012\015'" '' - -assert "cat __thumbs/Landscape_1.jpg.html | grep 'Landscape_1.jpg' | tr -d '\011\012\015'" 'Landscape_1.jpg' -assert "cat __thumbs/Landscape_1.jpg.html | grep 'Resolution' | tr -d '\040\011\012\015'" 'Resolution:600x450' - -assert_end gallery_sh diff --git a/tests.sh b/tests.sh new file mode 100755 index 0000000..1fd898a --- /dev/null +++ b/tests.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash + +# gallery.sh Test Script +# +# https://github.com/lehmannro/assert.sh + +if [ ! -e assert.sh ]; then + echo "downloading unit test script" + curl -f "https://raw.githubusercontent.com/lehmannro/assert.sh/v1.1/assert.sh" -o assert.sh +fi + +# Download demo files +curl -f "https://cyclenerd.github.io/gallery_shell_demo/Landscape_1.jpg" -o "Landscape_1.jpg" +curl -f "https://cyclenerd.github.io/gallery_shell_demo/Landscape_2.jpg" -o "Landscape_2.jpg" +curl -f "https://cyclenerd.github.io/gallery_shell_demo/Landscape_3.jpg" -o "Landscape_3.jpg" +curl -f "https://cyclenerd.github.io/gallery_shell_demo/Landscape_4.jpg" -o "Landscape_4.jpg" +curl -f "https://cyclenerd.github.io/gallery_shell_demo/Landscape_5.jpg" -o "Landscape_5.jpg" +curl -f "https://cyclenerd.github.io/gallery_shell_demo/Landscape_6.jpg" -o "Landscape_6.jpg" +curl -f "https://cyclenerd.github.io/gallery_shell_demo/Landscape_7.jpg" -o "Landscape_7.jpg" +curl -f "https://cyclenerd.github.io/gallery_shell_demo/Landscape_8.jpg" -o "Landscape_8.jpg" +curl -f "https://cyclenerd.github.io/gallery_shell_demo/Portrait_1.jpg" -o "Portrait_1.jpg" +curl -f "https://cyclenerd.github.io/gallery_shell_demo/Portrait_2.jpg" -o "Portrait_2.jpg" +curl -f "https://cyclenerd.github.io/gallery_shell_demo/Portrait_3.jpg" -o "Portrait_3.jpg" +curl -f "https://cyclenerd.github.io/gallery_shell_demo/Portrait_4.jpg" -o "Portrait_4.jpg" +curl -f "https://cyclenerd.github.io/gallery_shell_demo/Portrait_5.jpg" -o "Portrait_5.jpg" +curl -f "https://cyclenerd.github.io/gallery_shell_demo/Portrait_6.jpg" -o "Portrait_6.jpg" +curl -f "https://cyclenerd.github.io/gallery_shell_demo/Portrait_7.jpg" -o "Portrait_7.jpg" +curl -f "https://cyclenerd.github.io/gallery_shell_demo/Portrait_8.jpg" -o "Portrait_8.jpg" + +# shellcheck disable=SC1091 +source assert.sh + +# `echo test` is expected to write "test" on stdout +assert "echo test" "test" +# `seq 3` is expected to print "1", "2" and "3" on different lines +assert "seq 3" "1\\n2\\n3" +# exit code of `true` is expected to be 0 +assert_raises "true" +# exit code of `false` is expected to be 1 +assert_raises "false" 1 +# end of test suite +assert_end examples + +# $ bash gallery.sh -t Test +assert_raises "bash gallery.sh -t Test" + +assert "cat index.html | grep '

Test

' | tr -d '\011\012\015'" '' +assert "cat index.html | grep '__thumbs/Landscape_1.jpg.html' | tr -d '\011\012\015'" '' + +assert "cat __thumbs/Landscape_1.jpg.html | grep 'Landscape_1.jpg' | tr -d '\011\012\015'" 'Landscape_1.jpg' +assert "cat __thumbs/Landscape_1.jpg.html | grep 'Resolution' | tr -d '\040\011\012\015'" 'Resolution:600x450' + +assert_end gallery_sh -- cgit v1.2.3