This repository was archived by the owner on Mar 8, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 8 files changed +136
-16
lines changed Expand file tree Collapse file tree 8 files changed +136
-16
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ services:
77 - docker
88
99env :
10- - BBLFSHD_VERSION=v2.11.7
10+ - BBLFSHD_VERSION=v2.11.8
1111
1212install :
1313 - curl -L https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 > $GOPATH/bin/dep
@@ -18,9 +18,9 @@ install:
1818 - docker pull bblfsh/bblfshd:$BBLFSHD_VERSION
1919
2020script :
21- - bblfsh-sdk update --dry-run
22- - bblfsh-sdk build ci-build
23- - bblfsh-sdk test --bblfshd $BBLFSHD_VERSION ci-build
21+ - go test ./driver/...
22+ - go run build.go ci-build
23+ - go run test.go --bblfshd $BBLFSHD_VERSION ci-build
2424
2525after_success :
2626 - bblfsh-sdk push ci-build
Original file line number Diff line number Diff line change 33
44[[constraint ]]
55 name = " gopkg.in/bblfsh/sdk.v2"
6- version = " 2.15 .x"
6+ version = " 2.16 .x"
77
88[prune ]
99 go-tests = true
Original file line number Diff line number Diff line change @@ -5,15 +5,15 @@ Development Environment
55
66Requirements:
77- ` docker `
8- - [ ` bblfsh-sdk ` ] ( https://github.com/bblfsh/sdk ) _ (go get -u gopkg.in/bblfsh/sdk.v2/...) _
9- - UAST converter dependencies _ (dep ensure --vendor-only)_
8+ - Go 1.11+
9+ - SDK dependencies _ (dep ensure --vendor-only)_
1010
11- To initialize the build system execute: ` bblfsh-sdk update ` , at the root of the project. This will generate the ` Dockerfile ` for this driver.
11+ To initialize the build system execute: ` go test ./driver ` , at the root of the project. This will generate the ` Dockerfile ` for this driver.
1212
13- To execute the tests just execute ` bblfsh-sdk test` , this will execute the test over the native and the go components of the driver using Docker.
13+ To execute the tests just execute ` go run test.go ` , this will execute the test over the native and the go components of the driver using Docker.
1414
15- The build is done executing ` bblfsh-sdk build` . To evaluate the result using a docker container, execute:
16- ` bblfsh-sdk build test-driver && docker run -it test-driver` .
15+ The build is done executing ` go run build.go ` . To evaluate the result using a docker container, execute:
16+ ` go run build.go test-driver && docker run -it test-driver` .
1717
1818
1919License
Original file line number Diff line number Diff line change 1+ package main
2+
3+ import (
4+ "flag"
5+ "fmt"
6+ "os"
7+
8+ "gopkg.in/bblfsh/sdk.v2/build"
9+ )
10+
11+ func main () {
12+ flag .Parse ()
13+ if err := runBuild ("." ); err != nil {
14+ fmt .Fprintln (os .Stderr , err )
15+ os .Exit (1 )
16+ }
17+ }
18+
19+ func runBuild (root string ) error {
20+ args := flag .Args ()
21+ name := ""
22+ if len (args ) != 0 {
23+ name = args [0 ]
24+ }
25+ d , err := build .NewDriver (root )
26+ if err != nil {
27+ return err
28+ }
29+ id , err := d .Build (name )
30+ if err != nil {
31+ return err
32+ }
33+ fmt .Println (id )
34+ return nil
35+ }
Original file line number Diff line number Diff line change 1+ package main_test
2+
3+ import (
4+ "testing"
5+
6+ "gopkg.in/bblfsh/sdk.v2/build"
7+ )
8+
9+ func TestSDKUpToDate (t * testing.T ) {
10+ printf := func (format string , args ... interface {}) (int , error ) {
11+ t .Logf (format , args ... )
12+ return 0 , nil
13+ }
14+ err := build .UpdateSDK ("../" , & build.UpdateOptions {
15+ DryRun : true ,
16+ Debug : printf ,
17+ Notice : printf ,
18+ Warning : printf ,
19+ })
20+ if err != nil {
21+ t .Fatal (err )
22+ }
23+ }
Original file line number Diff line number Diff line change 1+ package main
2+
3+ import (
4+ "flag"
5+ "fmt"
6+ "os"
7+
8+ "gopkg.in/bblfsh/sdk.v2/build"
9+ )
10+
11+ var (
12+ fBblfshd = flag .String ("bblfshd" , "" , "bblfshd version to test with" )
13+ fBench = flag .Bool ("bench" , false , "benchmark the driver" )
14+ )
15+
16+ func main () {
17+ flag .Parse ()
18+ if err := runTest ("." ); err != nil {
19+ fmt .Fprintln (os .Stderr , err )
20+ os .Exit (1 )
21+ }
22+ }
23+
24+ func runTest (root string ) error {
25+ args := flag .Args ()
26+ image := ""
27+ if len (args ) != 0 {
28+ image = args [0 ]
29+ }
30+ d , err := build .NewDriver (root )
31+ if err != nil {
32+ return err
33+ }
34+ return d .Test (* fBblfshd , image , * fBench )
35+ }
Original file line number Diff line number Diff line change 1+ package main
2+
3+ import (
4+ "flag"
5+ "fmt"
6+ "os"
7+
8+ "gopkg.in/bblfsh/sdk.v2/build"
9+ )
10+
11+ func main () {
12+ flag .Parse ()
13+ if err := runUpdate ("." ); err != nil {
14+ fmt .Fprintln (os .Stderr , err )
15+ os .Exit (1 )
16+ }
17+ }
18+
19+ func runUpdate (root string ) error {
20+ return build .UpdateSDK (root , & build.UpdateOptions {
21+ Notice : fmt .Printf ,
22+ Warning : fmt .Printf ,
23+ })
24+ }
You can’t perform that action at this time.
0 commit comments