File: test.sh

package info (click to toggle)
golang-github-casbin-govaluate 1.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 396 kB
  • sloc: sh: 16; makefile: 2
file content (33 lines) | stat: -rwxr-xr-x 760 bytes parent folder | download | duplicates (2)
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
#!/bin/bash

# Script that runs tests, code coverage, and benchmarks all at once.
# Builds a symlink in /tmp, mostly to avoid messing with GOPATH at the user's shell level.

TEMPORARY_PATH="/tmp/govaluate_test"
SRC_PATH="${TEMPORARY_PATH}/src"
FULL_PATH="${TEMPORARY_PATH}/src/govaluate"

# set up temporary directory
rm -rf "${FULL_PATH}"
mkdir -p "${SRC_PATH}"

ln -s $(pwd) "${FULL_PATH}"
export GOPATH="${TEMPORARY_PATH}"

pushd "${TEMPORARY_PATH}/src/govaluate"

# run the actual tests.
export GOVALUATE_TORTURE_TEST="true"
go test -bench=. -benchmem #-coverprofile coverage.out
status=$?

if [ "${status}" != 0 ];
then
	exit $status
fi

# coverage
# disabled because travis go1.4 seems not to support it suddenly?
#go tool cover -func=coverage.out

popd