Skip to content

Commit

Permalink
fix stack flag for unix
Browse files Browse the repository at this point in the history
  • Loading branch information
yubowenok committed Feb 24, 2017
1 parent 1793c40 commit d8c3688
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test_runner
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ if [[ $2 == "" ]]; then
exit
fi

os=`uname`
os=`uname | tr '[:upper:]' '[:lower:]'`
case $os in
'WindowsNT') os='win';;
'windowsnt') os='win';;
'darwin') os='mac';;
*) os='';;
esac

Expand All @@ -26,8 +27,11 @@ runcmd=""
if [[ $suffix == "cpp" ]]; then
if [[ $os == 'win' ]]; then
g++ -Wl,--stack,100000000 $2 -o $name -O2 -Wall -Wextra -std=gnu++0x || exit
else
elif [[ $os == 'mac' ]]; then
g++ -Wl,-stack_size,0x10000000 $2 -o $name -O2 -Wall -Wextra -std=gnu++0x || exit
else
# stack size set by "ulimit -s"
g++ $2 -o $name -O2 -Wall -Wextra -std=gnu++0x || exit
fi
runcmd="./$name"
elif [[ $suffix == "java" ]]; then
Expand Down

0 comments on commit d8c3688

Please sign in to comment.