Skip to content

Instantly share code, notes, and snippets.

@mikedanese
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikedanese/9d08a42cf3eb2f524bde to your computer and use it in GitHub Desktop.
Save mikedanese/9d08a42cf3eb2f524bde to your computer and use it in GitHub Desktop.
cc_test(
name = "my_test",
srcs = ["my_test.cc"],
deps = ["//external:gtest/main"],
)
cc_library(
name = "main",
srcs = glob(
["src/*.cc"],
exclude = ["src/gtest-all.cc"]
),
hdrs = glob(["include/**/*.h"]),
includes = [
".",
"include"
],
linkopts = ["-pthread"],
visibility = ["//visibility:public"],
)
#include "gtest/gtest.h"
TEST(FactorialTest, Negative) {
EXPECT_EQ(1, 1);
}
new_http_archive(
name = "gtest-repo",
url = "https://googletest.googlecode.com/files/gtest-1.7.0.zip",
sha256 = "247ca18dd83f53deb1328be17e4b1be31514cedfc1e3424f672bf11fd7e0d60d",
build_file = "gtest.BUILD",
)
bind(
name = "gtest/main",
actual = "@gtest-repo//:main",
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment