Skip to content

Commit 2216a86

Browse files
committed
fixes for make check on actions
1 parent e9a0909 commit 2216a86

5 files changed

Lines changed: 13 additions & 12 deletions

File tree

.github/workflows/compile_and_test.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v3
1616

17-
# - name: Install dependencies
18-
# run: |
19-
# sudo apt-get update -qq
20-
# sudo apt-get install -y libgsl-dev libsundials-dev petsc-dev slepc-dev
21-
# sudo apt-get install -y gmsh
17+
- name: Install dependencies
18+
run: |
19+
sudo apt-get update -qq
20+
sudo apt-get install -y yq
2221
2322
- name: Bootstrap with autoconf
2423
run: ./autogen.sh

tests/internal.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ echo "6 decks h17 das nrsa 1e6"
1919
$blackjack -i --report=ahc.yaml --decks=6
2020
actual=$(yq .mean ahc.yaml)
2121
tol=$(yq .error ahc.yaml)
22-
echo $actual $ref $error
22+
echo $actual $ref $tol
2323
awk -v a="$actual" -v r="$ref" -v t="$tol" 'BEGIN { exit !((a >= (r-t)) && (a <= (r+t))) }'
2424
exitifwrong $?
2525
echo "ok"

tests/mimic-the-dealer.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ checkgawk # this test does not work with mawk, it does not like the fifo
1414

1515
if [ ! -e functions.sh ]; then
1616
cd tests
17+
extra="../"
1718
fi
1819
if [ ! -e functions.sh ]; then
1920
exit 77
@@ -25,11 +26,11 @@ ref=-0.055
2526

2627
rm -f fifo-mimic
2728
mkfifo fifo-mimic
28-
$blackjack -n1e5 --report=mimic.yaml < fifo-mimic | gawk -f ../players/08-mimic-the-dealer/mimic-the-dealer.awk > fifo-mimic
29+
${extra}${blackjack} -n1e5 --report=mimic.yaml < fifo-mimic | gawk -f ../players/08-mimic-the-dealer/mimic-the-dealer.awk > fifo-mimic
2930

3031
actual=$(yq .mean mimic.yaml)
3132
tol=$(yq .error mimic.yaml)
32-
echo $actual $ref $error
33+
echo $actual $ref $tol
3334
awk -v a="$actual" -v r="$ref" -v t="$tol" 'BEGIN { exit !((a >= (r-t)) && (a <= (r+t))) }'
3435
exitifwrong $?
3536
echo "ok"

tests/no-bust.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ checkgawk # this test does not work with mawk, it does not like the fifo
1414

1515
if [ ! -e functions.sh ]; then
1616
cd tests
17+
extra="../"
1718
fi
1819
if [ ! -e functions.sh ]; then
1920
exit 77
@@ -25,11 +26,11 @@ ref=-0.075
2526

2627
rm -f fifo-nobust
2728
mkfifo fifo-nobust
28-
$blackjack -n1e5 --report=no-bust.yaml < fifo-nobust | gawk -f ../players/05-no-bust/no-bust.awk > fifo-nobust
29+
${extra}${blackjack} -n1e5 --report=no-bust.yaml < fifo-nobust | gawk -f ../players/05-no-bust/no-bust.awk > fifo-nobust
2930

3031
actual=$(yq .mean no-bust.yaml)
3132
tol=$(yq .error no-bust.yaml)
32-
echo $actual $ref $error
33+
echo $actual $ref $tol
3334
awk -v a="$actual" -v r="$ref" -v t="$tol" 'BEGIN { exit !((a >= (r-t)) && (a <= (r+t))) }'
3435
exitifwrong $?
3536
echo "ok"

tests/stand.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ fi
1111

1212
checkyq
1313

14-
ref=-0.155
14+
ref=-0.158
1515

1616
echo "always stand"
1717
yes stand | $blackjack -n5e5 --flat_bet=true --no_insurance=true --report=stand.yaml > /dev/null
1818
actual=$(yq .mean stand.yaml)
1919
tol=$(yq .error stand.yaml)
20-
echo $actual $ref $error
20+
echo $actual $ref $tol
2121
awk -v a="$actual" -v r="$ref" -v t="$tol" 'BEGIN { exit !((a >= (r-t)) && (a <= (r+t))) }'
2222
exitifwrong $?
2323
echo "ok"

0 commit comments

Comments
 (0)