Skip to content

Commit

Permalink
Merge pull request #140 from davidzchen/parser-test
Browse files Browse the repository at this point in the history
Add unit tests for parser.
  • Loading branch information
davidzchen committed Mar 26, 2016
2 parents 334a225 + 364c5dd commit abadcf3
Show file tree
Hide file tree
Showing 12 changed files with 1,148 additions and 691 deletions.
30 changes: 24 additions & 6 deletions core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package(default_visibility = ["//visibility:public"])
cc_library(
name = "common",
hdrs = [
"unicode.h",
"ast.h",
"static_error.h",
"unicode.h",
],
includes = ["."],
)
Expand All @@ -21,29 +22,45 @@ cc_library(

cc_test(
name = "lexer_test",
srcs = ["lexer_test.cc"],
srcs = ["lexer_test.cpp"],
deps = [
":lexer",
"//external:gtest_main",
],
)

cc_library(
name = "parser",
srcs = ["parser.cpp"],
hdrs = ["parser.h"],
deps = [
":common",
":lexer",
],
)

cc_test(
name = "parser_test",
srcs = ["parser_test.cpp"],
deps = [
":parser",
"//external:gtest_main",
],
)

cc_library(
name = "jsonnet-common",
srcs = [
"desugarer.cpp",
"formatter.cpp",
"libjsonnet.cpp",
"parser.cpp",
"static_analysis.cpp",
"string_utils.cpp",
"vm.cpp",
],
hdrs = [
"ast.h",
"desugarer.h",
"formatter.h",
"parser.h",
"state.h",
"static_analysis.h",
"string_utils.h",
Expand All @@ -52,6 +69,7 @@ cc_library(
deps = [
":common",
":lexer",
":parser",
"//include:libjsonnet",
"//stdlib:std",
],
Expand All @@ -70,7 +88,7 @@ cc_library(

cc_test(
name = "libjsonnet_test",
srcs = ["libjsonnet_test.cc"],
srcs = ["libjsonnet_test.cpp"],
deps = [
":jsonnet-common",
"//external:gtest_main",
Expand Down
284 changes: 0 additions & 284 deletions core/lexer_test.cc

This file was deleted.

Loading

0 comments on commit abadcf3

Please sign in to comment.