]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - tests/run.sh
Add installed() function to check if a program exists.
[config/dotfiles.git] / tests / run.sh
1 #!/bin/sh
2
3 # Runs all tests in this directory.
4
5
6 # Get all test files.
7 for file in *.test; do
8     # Run the test file in sh and zsh and get its output.
9     sh $file  > $file.out.sh  2>&1
10     zsh $file > $file.out.zsh 2>&1
11
12     # Check if the output matches the expected one. If not abort with exit
13     # code 1.
14     diff -u -N $file.out $file.out.sh  || exit 1
15     diff -u -N $file.out $file.out.zsh || exit 1
16 done
17
18 # Remove all temporary files.
19 rm -rf tmp
20 rm *.out.sh
21 rm *.out.zsh