-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_all_ftls.sh
executable file
·50 lines (36 loc) · 1.05 KB
/
test_all_ftls.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
43
44
45
46
47
48
49
#!/bin/bash
# Check if result directory exists and is non-empty
if [ ! -d "./result" ] || [ -z "$(ls -A ./result)" ]; then
echo "No files in ./result"
exit 1
fi
cache_memory=20
# Corrected variable name and used glob expansion safely
test_set=(./result/*_driver)
# Check if array is empty (no matching files)
if [ ${#test_set[@]} -eq 0 ]; then
echo "No matching *_driver files found in ./result"
exit 1
fi
echo "Drivers found: ${test_set[@]}"
for driver in "${test_set[@]}"
do
output_file="${driver}_res.txt"
# Construct base command
cmd="$driver -T 0"
if [[ "$driver" != *oftl_driver* ]]; then
cmd+=" -p $cache_memory"
fi
# Append additional flags based on filename
if [[ "$driver" == *dftl_driver* ]]; then
cmd+=" -t 0"
elif [[ "$driver" == *sftl_driver* ]]; then
cmd+=" -t 2"
fi
echo "Running: $cmd > $output_file 2>&1"
# Execute the command and redirect output
$cmd > "$output_file" 2>&1
echo "Done: $driver"
done
echo "Please check the results:"
ls ./result/*_res.txt