Skip to content

Commit c12cff5

Browse files
author
R. van Elst
committed
More work on the OS X runner config. Install gnu sed and use that,
now the test scripts work.
1 parent 15fbcee commit c12cff5

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

.github/workflows/build-test-and-artifact.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,12 @@ jobs:
134134
run: cmake -E make_directory ${{runner.workspace}}/build
135135

136136
- name: Install dependencies
137-
run: brew install coreutils libpcap netcat # sdl2 libx11
138-
139-
- name: gnu tr
140-
run: sudo mv /usr/local/opt/coreutils/libexec/gnubin/tr /usr/bin/tr
137+
run: brew install libpcap netcat gnu-sed # sdl2 libx11 / sdl doesnt work see #44
141138

142139
- name: Configure CMake
143140
shell: bash
144141
working-directory: ${{runner.workspace}}/build
145-
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Wall -Wc++11-extensions -Wc++11-long-long -Wc++11-extra-semi -std=c++11 -stdlib=libc++ -I/usr/local/opt/libpcap/include"
142+
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Wall -std=c++11 -stdlib=libc++ -I/usr/local/opt/libpcap/include"
146143

147144
- name: Build
148145
working-directory: ${{runner.workspace}}/build
@@ -151,10 +148,15 @@ jobs:
151148
env:
152149
MAKEFLAGS: "-j2"
153150

151+
- name: Run test scripts
152+
working-directory: ${{runner.workspace}}/axpbox
153+
shell: bash
154+
run: ${{runner.workspace}}/axpbox/test/run
155+
154156
- name: Upload AXPbox Binary
155157
uses: actions/upload-artifact@v1
156158
with:
157-
name: AXPbox-osx-appleclang-${{ env.BUILD_DATE }}
159+
name: AXPbox-osx-10.15-appleclang-${{ env.BUILD_DATE }}
158160
path: ${{runner.workspace}}/build/axpbox
159161
env:
160162
BUILD_DATE: ${{ steps.date.outputs.date }}

test/disk/unwritable/test.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,13 @@ fi
2020
chmod 700 disk-unwritable.img
2121
rm disk-unwritable.img
2222

23-
sed -i -e 's$/[^ ]*/DiskFile.cpp$DiskFile.cpp$g' \
24-
-e 's/line [0-9]*/line L/g' -e '/$Id/d' axp.log
23+
# OS X github runner has weiro sed version, use gnu one there.
24+
SED=/usr/bin/sed
25+
if [[ -f "/usr/local/opt/gnu-sed/libexec/gnubin/sed" ]]; then
26+
SED=/usr/local/opt/gnu-sed/libexec/gnubin/sed
27+
fi
28+
29+
${SED} -i -e 's$/[^ ]*/DiskFile.cpp$DiskFile.cpp$g' -e 's/line [0-9]*/line L/g' -e '/$Id/d' axp.log
2530

2631
echo -n -e '\033[1;31m'
2732
diff -c axp_correct.log axp.log && echo -e '\033[1;32mdiff clean\033[0m'

test/rom/test.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ else # Travis
1616
fi
1717

1818
# Wait for AXPbox to start
19-
sleep 3
19+
sleep 5
2020

2121
# Connect to terminal
2222
nc -t 127.0.0.1 21000 | tee axp.log &
2323
NETCAT_PID=$!
2424

2525
# Wait for the last line of log to become P00>>>
26-
timeout=300
26+
timeout=100
2727
while true
2828
do
2929
if [ $timeout -eq 0 ]
@@ -32,7 +32,8 @@ do
3232
exit 1
3333
fi
3434

35-
if [ "$(tail -n 1 axp.log | LC_ALL=C tr -d '\0')" == "P00>>>" ]
35+
# print last line and remove null byte from it
36+
if [ "$(LC_ALL=C sed -n '$p' axp.log | LC_ALL=C sed 's/\x00//g')" == "P00>>>" ]
3637
then
3738
echo
3839
break

0 commit comments

Comments
 (0)