LDFLAGS in test.sh; improve format check
This commit is contained in:
parent
591c2909c6
commit
c0088f5d61
|
@ -51,9 +51,7 @@ before_script:
|
|||
- export DISPLAY=:99.0
|
||||
- sh -e /etc/init.d/xvfb start
|
||||
script:
|
||||
- export CGO_CPPFLAGS="-I${HOME}/usr/include"
|
||||
- export CGO_LDFLAGS="-L${HOME}/usr/lib -lopencv_core -lopencv_videoio -lopencv_imgproc -lopencv_highgui -lopencv_imgcodecs -lopencv_objdetect -lopencv_calib3d -lopencv_video"
|
||||
- echo "Running tests"
|
||||
- echo "Running tests
|
||||
- make test_with_coverage
|
||||
- echo "Checking that code is well-formatted"
|
||||
- make fmt_check
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
pushd $PWD/..
|
||||
GO_FILES_EXCLUDING_VENDOR=$(find . -type f -name '*.go' -not -path "./vendor/*")
|
||||
FMT_RESULTS=$(gofmt -l $GO_FILES_EXCLUDING_VENDOR)
|
||||
if [ ${#FMT_RESULTS[@]} -ne 0 ]; then
|
||||
FMT_RESULTS_COUNT=$(echo $FMT_RESULTS | wc -l) # returns one empty line when everything passes
|
||||
if [ "$FMT_RESULTS_COUNT" -gt 1 ]; then
|
||||
# some files have formatting errors
|
||||
echo "--- gofmt found errors found in the following files:"
|
||||
echo $FMT_RESULTS
|
||||
|
|
14
ci/test.sh
14
ci/test.sh
|
@ -11,6 +11,20 @@ echo $GO_VERSION
|
|||
# Hold the package names that contain failures
|
||||
FAIL_PACKAGES=()
|
||||
|
||||
# OpenCV components to link in CGO compile
|
||||
OPENCV_LDFLAGS="-lopencv_core -lopencv_videoio -lopencv_imgproc -lopencv_highgui -lopencv_imgcodecs -lopencv_objdetect -lopencv_calib3d -lopencv_video"
|
||||
|
||||
# Use $HOME on Travis
|
||||
# Use /usr/local on local
|
||||
if [[ $TRAVIS == "true" ]]; then
|
||||
export CGO_CPPFLAGS="-I${HOME}/usr/include"
|
||||
export CGO_LDFLAGS="-L${HOME}/usr/lib $OPENCV_LDFLAGS"
|
||||
else
|
||||
export CGO_CPPFLAGS="-I/usr/local/include"
|
||||
export CGO_LDFLAGS="-L/usr/local/lib $OPENCV_LDFLAGS"
|
||||
fi
|
||||
|
||||
|
||||
pushd $PWD/..
|
||||
# Set up coverage report file
|
||||
COVERAGE_REPORT_LOCATION="./profile.cov"
|
||||
|
|
Loading…
Reference in New Issue