-
Notifications
You must be signed in to change notification settings - Fork 0
/
gentests.sh
executable file
·42 lines (33 loc) · 943 Bytes
/
gentests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#! /bin/bash
[ -z "$1" ] && echo "Usage: prgm <testdir>" && exit 1
dirs=$( find "$1" -type d )
#works with only 1 dot
extension(){
echo "$(basename ${@##*.})"
}
filename(){
echo "$(basename ${@%.*})"
}
wd=`pwd`
for dir in $dirs
do
echo "### Processing folder <$dir>"
Dir="${wd}/${dir}"
duet_files=`ls ${Dir}/*.duet 2>/dev/null`
[ "$?" -ne 0 ] && continue
asim_files=`ls ${Dir}/*.asim 2>/dev/null`
[ "$?" -ne 0 ] && continue
for asim_file in "$asim_files"
do
echo "Asim.."
csim "${folder}/${asim_file}" 1>/dev/null
[ "$?" -ne 0 ] && echo "Aborting" && exit 1
for duet_file in "$duet_files"
do
echo "$duet_file"
# sh test.sh
echo "$dir" "$asim_file" "$duet_file" "$(filename ${asim_file})__$(filename ${duet_file}).log"
sh test.sh "$dir" "$(basename ${asim_file})" "$(basename ${duet_file})" "$(filename ${asim_file})__$(filename ${duet_file}).log"
done
done
done