Skip to content

Commit 24f09bd

Browse files
committed
Share implementation with github workflow
Signed-off-by: Stefano Rivera <[email protected]>
1 parent 26e3f8c commit 24f09bd

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,11 @@ jobs:
2424
printf '#!/bin/sh\n\nexec python "$@"\n' >python3 &&
2525
2626
export PATH=$PWD:$PATH &&
27-
export PYTHONPATH=$PWD &&
28-
export TEST_SHELL_PATH=/bin/sh &&
2927
30-
failed=0 &&
31-
cd t &&
32-
for t in t[0-9]*.sh
33-
do
34-
printf '\n\n== %s ==\n' "$t" &&
35-
bash $t -q -v -x ||
36-
failed=$(($failed+1))
37-
done &&
38-
if test 0 != $failed
28+
if ! t/run_tests -q -v -x
3929
then
40-
mkdir ../failed &&
41-
tar czf ../failed/failed.tar.gz .
30+
mkdir failed &&
31+
tar czf failed/failed.tar.gz t
4232
exit 1
4333
fi
4434
- name: upload failed tests' directories

t/run_tests

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,25 @@ set -eu
33

44
cd $(dirname $0)
55

6+
# Put git_filter_repo.py on the front of PYTHONPATH
7+
export PYTHONPATH="$PWD/..${PYTHONPATH:+:$PYTHONPATH}"
8+
69
# We pretend filenames are unicode for two reasons: (1) because it exercises
710
# more code, and (2) this setting will detect accidental use of unicode strings
811
# for file/directory names when it should always be bytestrings.
912
export PRETEND_UNICODE_ARGS=1
1013

14+
export TEST_SHELL_PATH=/bin/sh
15+
1116
failed=0
1217

13-
for test in t939*.sh; do
14-
./$test || failed=1
18+
for t in t[0-9]*.sh
19+
do
20+
printf '\n\n== %s ==\n' "$t"
21+
bash $t "$@" || failed=$(($failed+1))
1522
done
16-
exit $failed
23+
24+
if [ 0 -lt $failed ]
25+
then
26+
exit 1
27+
fi

0 commit comments

Comments
 (0)