-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest
More file actions
36 lines (31 loc) · 1.09 KB
/
Copy pathtest
File metadata and controls
36 lines (31 loc) · 1.09 KB
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
#!/bin/bash
set +x
file="$(pwd)/c_programs/ABC.exe"
[[ -f "$file" ]] && sudo rm -f "$file"
pwd; sudo chmod 777 build; ./build 1> /dev/null
echo -e "\n\n**************************** This is a Deploy JOB for $file**************************** "
if [[ -f "$file" ]]; then
count=1
for i in {1..10}
do
oe=$((1000 + RANDOM % 10000))
fact=$((1 + RANDOM % 15))
num1=$((1 + RANDOM % 100))
num2=$((1 + RANDOM % 1000))
echo -e "\n-------------------------- TEST_CASE ($count) --------------------------"
$file -v -i <<<"$fact $oe $num1 $num2"
if [ $? -eq 0 ]; then
echo -e "\n RESULT -> TEST_CASE (${count}): SUCCESS"
else
echo -e "\n RESULT -> TEST_CASE (${count}): FAILED"
exit 1
fi
echo "-------------------------------------------------------------------"
((count++))
done
else
echo -e "**************** ERROR *********************\n"
echo "Build - ABC.exe notfound $file "
echo -e "********************************************\n"
exit 1
fi