From 31f134213fb69f0d6d7db0082ca7763da7018072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Thu, 5 May 2022 16:13:37 +0200 Subject: [PATCH] Add some basic tests for bin commands --- .github/workflows/main.yml | 5 +++++ Makefile | 5 +++++ tests/aursearch_test.sh | 2 ++ tests/run_all | 9 +++++++++ 4 files changed, 21 insertions(+) create mode 100755 tests/aursearch_test.sh create mode 100755 tests/run_all diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ea560a1..600e6eb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,6 +34,11 @@ jobs: run: make check_neovim env: DOTFILES_CI: 1 + - name: Run tests + if: ${{ matrix.platform != 'windows-latest' }} + run: make run_tests + env: + DOTFILES_CI: 1 create-key: strategy: matrix: diff --git a/Makefile b/Makefile index 58c22f4..db04295 100644 --- a/Makefile +++ b/Makefile @@ -315,6 +315,11 @@ check_neovim: check_os @echo "Doing a basic neovim startup and quit" @nvim --headless -c 'set display-=msgsep' -c 'quitall' +.PHONY: run_tests +run_tests: check_os + @echo "Running all tests from tests/" + @./tests/run_all + .PHONY: oh_my_zsh oh_my_zsh: check_os @echo "Installing oh-my-zsh..." diff --git a/tests/aursearch_test.sh b/tests/aursearch_test.sh new file mode 100755 index 0000000..0e80001 --- /dev/null +++ b/tests/aursearch_test.sh @@ -0,0 +1,2 @@ +test $(aursearch "neovim-rpc-api") = "neovim-rpc-api-explorer" +test $(aursearch "neovim-rpc-api-explorer") = "neovim-rpc-api-explorer" diff --git a/tests/run_all b/tests/run_all new file mode 100755 index 0000000..6cecdf3 --- /dev/null +++ b/tests/run_all @@ -0,0 +1,9 @@ +#!/bin/sh + +set -ev + +for file in $(dirname $0)/*; do + if [ ! "$file" = $(dirname $0)/run_all ]; then + . $file + fi +done # Running tests after this