File tree 8 files changed +131
-105
lines changed
8 files changed +131
-105
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ services:
7
7
- docker
8
8
9
9
env :
10
- - BBLFSHD_VERSION=v2.11.7
10
+ - BBLFSHD_VERSION=v2.11.8
11
11
12
12
install :
13
13
- curl -L https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 > $GOPATH/bin/dep
@@ -18,9 +18,9 @@ install:
18
18
- docker pull bblfsh/bblfshd:$BBLFSHD_VERSION
19
19
20
20
script :
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
24
24
25
25
after_success :
26
26
- bblfsh-sdk push ci-build
Original file line number Diff line number Diff line change 3
3
4
4
[[constraint ]]
5
5
name = " gopkg.in/bblfsh/sdk.v2"
6
- version = " 2.15 .x"
6
+ version = " 2.16 .x"
7
7
8
8
[prune ]
9
9
go-tests = true
Original file line number Diff line number Diff line change @@ -8,15 +8,15 @@ Development Environment
8
8
9
9
Requirements:
10
10
- ` docker `
11
- - [ ` bblfsh-sdk ` ] ( https://github.com/bblfsh/sdk ) _ (go get -u gopkg.in/bblfsh/sdk.v2/...) _
12
- - UAST converter dependencies _ (dep ensure --vendor-only)_
11
+ - Go 1.11+
12
+ - SDK dependencies _ (dep ensure --vendor-only)_
13
13
14
- To initialize the build system execute: ` bblfsh-sdk update ` , at the root of the project. This will generate the ` Dockerfile ` for this driver.
14
+ To initialize the build system execute: ` go test ./driver ` , at the root of the project. This will generate the ` Dockerfile ` for this driver.
15
15
16
- 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.
16
+ 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.
17
17
18
- The build is done executing ` bblfsh-sdk build` . To evaluate the result using a docker container, execute:
19
- ` bblfsh-sdk build test-driver && docker run -it test-driver` .
18
+ The build is done executing ` go run build.go ` . To evaluate the result using a docker container, execute:
19
+ ` go run build.go test-driver && docker run -it test-driver` .
20
20
21
21
22
22
License
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