You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

55 lines
1.8 KiB

#this build script was created to compile all the files and run the tests accordingly and also run the files that cant be compiled by ceedling
trap 'echo "Interrupted";
rm main;
cp employeeLogin.c.bak employeeLogin.c;
cp mainMenu.c.bak mainMenu.c;
cp createEmployeeAccount.c.bak createEmployeeAccount.c;
cp _file_information.h.bak _file_information.h;
rm employeeLogin.c.bak;
rm mainMenu.c.bak;
rm createEmployeeAccount.c.bak;
rm _file_information.h.bak;
cd ..;
rm -r build; exit' SIGINT
clear
ceedling test:all
rm -r build/
cd src/
sed '/John Doe/,$d' employeesCredentialsList.txt > temp.txt
mv temp.txt employeesCredentialsList.txt
sed '/Name : John/,$d' employeesData.txt > temp.txt
mv temp.txt employeesData.txt
# backup files
for file in employeeLogin.c mainMenu.c createEmployeeAccount.c _file_information.h; do
cp "$file" "$file.bak"
done
# remove 'src/'
for file in employeeLogin.c createEmployeeAccount.c _file_information.h; do
sed -i 's/src\///g' "$file"
done
gcc mainMenu.c error.c createEmployeeAccount.c showGeneralInfoEmployee.c employeeLogin.c createCustomer.c helperFunctions.c loginCustomer.c customerMenu.c main.c calculatorAdd.c calculatorDivide.c calculatorFactorial.c calculatorGetUserInput.c calculatorGetUserInputFactorial.c calculatorMultiply.c calculatorSubtract.c displayMenuCalculator.c checkLoanEligibility.c currencyExchange.c currentCustomerAccountBalance.c depositMoney.c displayDisclaimer.c interestCalculator.c requestLoan.c sendMoney.c updateCustomerAccountBalance.c withdrawMoney.c -o main
./main
rm main
# restore backups
for file in employeeLogin.c mainMenu.c createEmployeeAccount.c _file_information.h; do
cp "$file.bak" "$file"
done
# remove backups
for file in employeeLogin.c.bak mainMenu.c.bak createEmployeeAccount.c.bak _file_information.h.bak; do
rm "$file"
done
cd ..