diff --git a/.travis.yml b/.travis.yml index 78a0d9c6..e2a6d037 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,15 @@ env: GIT_COMMITTER_NAME: travis-ci GIT_COMMITTER_EMAIL: travis@travis-ci.org +addons: + apt: + sources: + - sourceline: 'ppa:duggan/bats' + packages: + - bats + script: - crystal spec - crystal tool format --check src spec +- bats examples_test.bats - "if [ $TRAVIS_TEST_RESULT -eq 0 ]; then scripts/generate-docs.sh && curl https://raw.githubusercontent.com/straight-shoota/autodeploy-docs/master/autodeploy-docs.sh | bash; fi" diff --git a/examples_test.bats b/examples_test.bats new file mode 100644 index 00000000..36138a86 --- /dev/null +++ b/examples_test.bats @@ -0,0 +1,50 @@ +#!/usr/bin/env bats + +@test "examples/config" { + pushd "examples/config" + shards install + + crystal run config.cr + crystal run config.cr --release --no-debug + popd +} + +@test "examples/kemal" { + pushd "examples/kemal" + shards install + + crystal build kemal.cr + crystal build kemal.cr --release --no-debug + + popd +} + +@test "examples/kilt" { + pushd "examples/kilt" + shards install + + crystal run kilt.cr + crystal run kilt.cr --release --no-debug + + popd +} + +@test "examples/rwbench" { + pushd "examples/rwbench" + shards install + + crystal run rwbench.cr + crystal run rwbench.cr --release --no-debug + + popd +} + +@test "examples/server" { + pushd "examples/server" + shards install + + crystal build server.cr + crystal build server.cr --release --no-debug + + popd +} diff --git a/shard.yml b/shard.yml index b611e955..1d47e147 100644 --- a/shard.yml +++ b/shard.yml @@ -1,7 +1,7 @@ name: crinja version: 0.3.0 license: Apache-2.0 -crystal: 0.24.1 +crystal: 0.25.1 authors: - Johannes Müller