-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatch-test-run.sh
More file actions
executable file
·34 lines (29 loc) · 885 Bytes
/
patch-test-run.sh
File metadata and controls
executable file
·34 lines (29 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
if ! [[ -f test-run.patch ]]; then
echo "Invalid working directory"
exit 0
fi
if ! [[ -f luatest.patch ]]; then
echo "Invalid working directory"
exit 0
fi
if ! [[ -f ../test-run/.git ]]; then
echo "test-run not inited, nothing to patch"
exit 0
fi
if [[ $# -gt 1 ]] || ( [[ $# -eq 1 ]] && [[ $1 != '-u' ]] ); then
echo "run '$0' or '$0 -u'"
exit 0
fi
if [[ $1 == '-u' ]]; then
cd ../test-run && git diff > ./patch.save && git checkout .
cd ./lib/luatest && git diff > ./patch.save && git checkout .
else
pth=`pwd`
cd ../test-run && patch -f -p1 < $pth/test-run.patch
rm ./lib/utils.py.rej > /dev/null 2>&1
rm ./lib/utils.py.orig > /dev/null 2>&1
cd ./lib/luatest && patch -f -p1 < $pth/luatest.patch
rm ./luatest/assertions.lua.rej > /dev/null 2>&1
rm ./luatest/assertions.lua.orig > /dev/null 2>&1
fi