]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - tests/run.sh
65dad840bc9c2500718ba8ddf8bb1bacd0dfb71f
[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     # Create temporary directory.
9     mkdir -p tmp
10
11     # Run the test file in sh and zsh and get its output.
12     sh $file  > $file.out.sh  2>&1
13     zsh $file > $file.out.zsh 2>&1
14
15     # Check if the output matches the expected one. If not abort with exit
16     # code 1.
17     diff -u $file.out $file.out.sh  || exit 1
18     diff -u $file.out $file.out.zsh || exit 1
19
20     # Remove temporary directory.
21     rm -rf tmp
22 done
23
24 # Remove all temporary files.
25 rm *.out.sh
26 rm *.out.zsh