]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - tests/run.zsh
Simplified loading of config files by using a function.
[config/dotfiles.git] / tests / run.zsh
1 # Runs all tests.
2
3
4 # Get all test files.
5 for file in *.test; do
6     # Run the test file in zsh and sh and get its output.
7     zsh $file &> $file.out.zsh
8     sh $file  &> $file.out.sh
9
10     # Check if the output matches the expected one. If not abort with exit
11     # code 1.
12     diff -u $file.out $file.out.zsh
13     if [[ $? -ne 0 ]]; then
14         exit 1
15     fi
16     diff -u $file.out $file.out.sh
17     if [[ $? -ne 0 ]]; then
18         exit 1
19     fi
20 done
21
22 # Remove all temporary files.
23 rm -rf tmp
24 rm *.out.zsh
25 rm *.out.sh