Skip to content

Commit

Permalink
Do not assume tests are run from under source tree
Browse files Browse the repository at this point in the history
Fixes #32783
  • Loading branch information
strk committed Nov 11, 2019
1 parent e61d985 commit 3331b10
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
5 changes: 4 additions & 1 deletion tests/code_layout/test_shellcheck.sh
Expand Up @@ -2,7 +2,10 @@

# This runs shellcheck on all sh files

DIR=$(git rev-parse --show-toplevel)

srcdir=`dirname $0`/../../

DIR=$(git -C ${srcdir} rev-parse --show-toplevel)

pushd ${DIR} > /dev/null || exit
result=$(shellcheck -e SC2016,SC2015,SC2086,SC2002,SC1117,SC2154,SC2076,SC2046,SC1090,SC2038,SC2031,SC2030,SC2162,SC2044,SC2119,SC1001,SC2120,SC2059,SC2128,SC2005,SC2013,SC2027,SC2090,SC2089,SC2124,SC2001,SC2010,SC1072,SC1073,SC1009,SC2166,SC2045,SC2028,SC1091,SC1083,SC2021 $(find . -name '*.sh'))
Expand Down
6 changes: 4 additions & 2 deletions tests/code_layout/test_sip_include.sh
@@ -1,7 +1,9 @@
#!/usr/bin/env bash

DIR=$(git rev-parse --show-toplevel)
REV=$(git log -n1 --pretty=%H)
srcdir=`dirname $0`/../../

DIR=$(git -C ${srcdir} rev-parse --show-toplevel)
REV=$(git -C ${srcdir} log -n1 --pretty=%H)

pushd ${DIR} > /dev/null || exit

Expand Down
4 changes: 3 additions & 1 deletion tests/code_layout/test_sipfiles_uptodate.sh
Expand Up @@ -2,7 +2,9 @@

#set -e

DIR=$(git rev-parse --show-toplevel)
srcdir=`dirname $0`/../../

DIR=$(git -C ${srcdir} rev-parse --show-toplevel)

# GNU prefix command for mac os support (gsed, gsplit)
GP=
Expand Down
4 changes: 3 additions & 1 deletion tests/code_layout/test_sipify.sh
Expand Up @@ -2,7 +2,9 @@

# This runs sipify on the demo header and checks output

DIR=$(git rev-parse --show-toplevel)
srcdir=`dirname $0`/../../

DIR=$(git -C ${srcdir} rev-parse --show-toplevel)

pushd ${DIR} > /dev/null || exit
outdiff=$(./scripts/sipify.pl tests/code_layout/sipifyheader.h | diff tests/code_layout/sipifyheader.expected.sip -)
Expand Down

0 comments on commit 3331b10

Please sign in to comment.