Skip to content

Commit

Permalink
make it work with or without _bonus
Browse files Browse the repository at this point in the history
  • Loading branch information
0x050f committed May 28, 2021
1 parent 7a82f44 commit 4bd5b64
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
2 changes: 1 addition & 1 deletion grademe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ do
while (( p < ${nb_func} ))
do
func_name=$(echo ${part}[$p])
if [ "$(echo ${arg} | grep -ow $(echo ${!func_name} | cut -d . -f 1))" != "" ]
if [ "$(echo ${arg} | sed 's/_bonus//g' | grep -ow $(echo ${!func_name} | cut -d . -f 1 | sed 's/_bonus//g'))" != "" ]
then
(( ${part}_activation[$p]=1 ))
#(( ${opt_part}=1 ))
Expand Down
38 changes: 25 additions & 13 deletions srcs/test_function.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,25 @@ check_turned_in_file()
retvalue=1
return "$retvalue"
else
printf "\033[${NORME_COL}G"
printf "${COLOR_FAIL}NTI${DEFAULT}"
printf "\033[${CHEAT_COL}G"
printf "${COLOR_FAIL}NTI${DEFAULT}"
printf "\033[${COMPIL_COL}G"
printf "${COLOR_FAIL}NTI${DEFAULT}"
printf "\033[${TEST_COL}G"
printf "${COLOR_FAIL}NTI${DEFAULT}"
printf "\033[${RESULT_COL}G"
printf "${COLOR_FAIL}NTI${DEFAULT}\n"
printf "Nothing turned in\n" >> ${PATH_DEEPTHOUGHT}/deepthought
retvalue=0
return "$retvalue"
if [ -e ${PATH_LIBFT}/${SRC_DIR}/$($1 | sed 's/_bonus//g') ]
then
retvalue=1
return "$retvalue"
else
printf "\033[${NORME_COL}G"
printf "${COLOR_FAIL}NTI${DEFAULT}"
printf "\033[${CHEAT_COL}G"
printf "${COLOR_FAIL}NTI${DEFAULT}"
printf "\033[${COMPIL_COL}G"
printf "${COLOR_FAIL}NTI${DEFAULT}"
printf "\033[${TEST_COL}G"
printf "${COLOR_FAIL}NTI${DEFAULT}"
printf "\033[${RESULT_COL}G"
printf "${COLOR_FAIL}NTI${DEFAULT}\n"
printf "Nothing turned in\n" >> ${PATH_DEEPTHOUGHT}/deepthought
retvalue=0
return "$retvalue"
fi
fi
}

Expand Down Expand Up @@ -83,6 +89,12 @@ test_function()
compilation $function
check_compilation
check=$?
if [ $check -eq 0 ]
then
compilation $(echo ${function} | sed 's/_bonus//g')
check_compilation
check=$?
fi
if [ $check -eq 1 ]
then
if [ ${OPT_NO_FORBIDDEN} -eq 0 ]
Expand Down

0 comments on commit 4bd5b64

Please sign in to comment.