Skip to content

Commit fd90fa5

Browse files
committed
Expand action coverage
1 parent 4a8d7d9 commit fd90fa5

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

.github/workflows/test.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,26 @@ jobs:
2323
python-version: '3.x'
2424

2525
- name: Build Go code
26-
run: go build -buildmode=c-shared -o hello.so ./hello
26+
run: |
27+
for x in hello primitive; do
28+
go build -buildmode=c-shared -o $x.so ./$x
29+
done
2730
2831
- name: Run Python script
29-
run: python hello/hello.py > output.txt
32+
run: |
33+
for x in hello primitive; do
34+
python $x/$x.py > $x.out
35+
done
3036
3137
- name: Check output
3238
run: |
33-
if [ "$(cat output.txt)" == "Hello world!" ]; then
34-
echo "Output is correct"
35-
else
36-
echo "Output is incorrect"
39+
if [ "$(cat hello.out)" != "Hello world!" ]; then
40+
echo "Output is incorrect:"
41+
printf '%q\n' "$(cat hello.out)"
42+
exit 1
43+
fi
44+
if [ "$(cat primitive.out)" != "10 + 15 = 25" ]; then
45+
echo "Output is incorrect:"
46+
printf '%q\n' "$(cat primitive.out)"
3747
exit 1
38-
fi
48+
fi

primitive/primitive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import ctypes
22

3-
lib = ctypes.CDLL('./primitive.dll')
3+
lib = ctypes.CDLL('./primitive.so')
44
add = lib.add
55

66
# Make python convert its values to C representation.

0 commit comments

Comments
 (0)