Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit cbb1b3e

Browse files
committed
ci: only v2 tests, more debug output
Only tests that are passing on V2 are currently enabled for every PR. Signed-off-by: Alexander Bezzubov <[email protected]>
1 parent b12b1ab commit cbb1b3e

File tree

3 files changed

+22
-11
lines changed

3 files changed

+22
-11
lines changed

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
include:
2424
- name: 'All tests'
2525
stage: test
26+
if: tag IS present # TODO(bzz): enable on PRs as soon as migrated to V2
2627
install: &test_setup_anchor
2728
- docker run --privileged -d -p 9432:9432 --name bblfsh bblfsh/bblfshd
2829
- docker exec -it bblfsh bblfshctl driver install --recommended
@@ -36,6 +37,7 @@ jobs:
3637
- name: 'V2: passing tests' # TODO(#83): remove, after both tests sets converge
3738
install: *test_setup_anchor
3839
script:
40+
- sudo apt-get install -y binutils
3941
- ./sbt assembly
4042
- ./sbt "testOnly *Close* *ClientVersion* *SupportedLanguages*"
4143
- ./sbt "testOnly org.bblfsh.client.v2.BblfshClientParseTest -- -z \"Decoded UAST after parsing\""

build.sbt

+16-11
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ getLibuast := {
127127
"rm src/main/resources/libuast/libuast.so" #&& // always a static build
128128
"rm libuast-bin.tar.gz" !
129129

130+
"find src/main/resources"!
131+
132+
"nm src/main/resources/libuast/libuast.a" #| "grep -c UastDecode"!
133+
134+
"nm src/main/resources/libuast/libuast.a" #| "wc -l"!
135+
130136
println("Done unpacking libuast")
131137
}
132138

@@ -154,16 +160,15 @@ def compileUnix(sourceFiles: String) = {
154160
}
155161

156162
val osName = System.getProperty("os.name").toLowerCase()
157-
if (osName.contains("mac os x")) { // TODO(bzz): change to '-fPIC -O2' for release
163+
if (osName.contains("mac os x")) { // TODO(bzz): change back to '-fPIC -O2' for release
158164
val cmd:String = "g++ -shared -Wall -g -std=c++11 " +
159165
"-I/usr/include " +
160166
"-I" + javaHome + "/include/ " +
161167
"-I" + javaHome + "/include/darwin " +
162168
"-Isrc/main/resources/libuast " +
163-
"-Lsrc/main/resources/libuast " + // sic, must be in the classpath for the test
164-
"-l uast " +
165-
"-o src/main/resources/lib/libscalauast.dylib " +
166-
sourceFiles + " "
169+
"-o src/main/resources/lib/libscalauast.dylib " + // sic, must be in the classpath for the test
170+
sourceFiles +
171+
"src/main/resources/libuast/libuast.a "
167172

168173
checkedProcess(cmd, "macOS build")
169174
} else {
@@ -172,12 +177,13 @@ def compileUnix(sourceFiles: String) = {
172177
"-I" + javaHome + "/include/ " +
173178
"-I" + javaHome + "/include/linux " +
174179
"-Isrc/main/resources/libuast " +
175-
"-Lsrc/main/resources/libuast " +
176-
"-l uast " +
177180
"-o src/main/resources/lib/libscalauast.so " +
178-
sourceFiles + " "
181+
sourceFiles +
182+
"src/main/resources/libuast/libuast.a "
179183

180184
checkedProcess(cmd, "Linux build")
185+
186+
"nm src/main/resources/lib/libscalauast.so" #| "grep -c UastDecode"!
181187
}
182188
}
183189

@@ -199,10 +205,9 @@ def crossCompileMacOS(sourceFiles: String): Unit = {
199205
"-I/usr/lib/jvm/java-8-openjdk-amd64/include " +
200206
"-I/usr/lib/jvm/java-8-openjdk-amd64/include/linux " +
201207
"-Isrc/libuast-native/ " +
202-
"-Lsrc/main/resources/libuast " +
203-
"-l uast " +
204208
"-o src/main/resources/lib/libscalauast.dylib " +
205-
sourceFiles
209+
sourceFiles +
210+
"src/main/resources/libuast/libuast.a "
206211

207212
checkedProcess(cmd, "macOS cross-compile build")
208213
}

src/main/scala/org/bblfsh/client/v2/Context.scala

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ case class Context(nativeContext: Long) {
99

1010
@native def filter()
1111

12+
// TODO(bzz): add loading of the root node, after clarifying when it's needed
13+
// https://github.com/bblfsh/client-python/blob/master/bblfsh/pyuast.cc#L364
14+
// @native def load(): ?
15+
1216
override def finalize(): Unit = {
1317
this.dispose()
1418
}

0 commit comments

Comments
 (0)