Skip to content

Commit

Permalink
LDFLAGS in test.sh; improve format check
Browse files Browse the repository at this point in the history
  • Loading branch information
trevrosen committed Nov 14, 2017
1 parent 591c290 commit c0088f5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion ci/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit c0088f5

Please sign in to comment.