From cf6933d45bbb7619436668966e2f166e3007d8eb Mon Sep 17 00:00:00 2001 From: Marcelo Cantos Date: Wed, 7 Mar 2018 05:05:00 +1100 Subject: [PATCH] Add C++-Jsonnet submodule for tests (#202) * Add C++-Jsonnet submodule for tests * Add tests.sh to travis-ci --- .gitmodules | 3 +++ .travis.yml | 3 ++- README.md | 12 +++++++++--- cpp-jsonnet | 1 + tests.sh | 10 +++++++--- 5 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 .gitmodules create mode 160000 cpp-jsonnet diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..35575c8 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "cpp-jsonnet"] + path = cpp-jsonnet + url = https://github.com/google/jsonnet.git diff --git a/.travis.yml b/.travis.yml index 61e7acb..517d81b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,4 +9,5 @@ before_install: - go get github.com/mattn/goveralls - if ! go get github.com/golang/tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi script: - - $HOME/gopath/bin/goveralls -service=travis-ci + - $HOME/gopath/bin/goveralls -service=travis-ci + - ./tests.sh --skip-go-test diff --git a/README.md b/README.md index 5394912..a27d5a6 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ This code is known to work on Go 1.8 and above. We recommend always using the ne ## Build instructions -``` +```bash export GOPATH=$HOME/go-workspace mkdir -pv $GOPATH go get github.com/google/go-jsonnet @@ -32,13 +32,19 @@ go build } ``` +## Running tests + +```bash +./tests.sh # Also runs `go test ./...` +``` + ## Implementation Notes We are generating some helper classes on types by using http://clipperhouse.github.io/gen/. Do the following to regenerate these if necessary: -``` +```bash go get github.com/clipperhouse/gen go get github.com/clipperhouse/set export PATH=$PATH:$GOPATH/bin # If you haven't already @@ -49,6 +55,6 @@ go generate To regenerate the standard library, do: -``` +```bash ./reset_stdast_go.sh && go run cmd/dumpstdlibast.go ``` diff --git a/cpp-jsonnet b/cpp-jsonnet new file mode 160000 index 0000000..6b7f64c --- /dev/null +++ b/cpp-jsonnet @@ -0,0 +1 @@ +Subproject commit 6b7f64c136156ca67371be6089d2b89d5f0dab9e diff --git a/tests.sh b/tests.sh index 87b1df1..03518bb 100755 --- a/tests.sh +++ b/tests.sh @@ -2,13 +2,17 @@ set -e +[ "$1" = "--skip-go-test" ] || go test ./... + export IMPLEMENTATION=go (cd jsonnet; go build) -source tests_path.source + export DISABLE_LIB_TESTS=true export DISABLE_FMT_TESTS=true export DISABLE_ERROR_TESTS=true export JSONNET_BIN="$PWD/jsonnet/jsonnet" -cd "$TESTS_PATH" -./tests.sh + +git submodule update --recursive cpp-jsonnet +cd cpp-jsonnet +exec ./tests.sh