add unit tests

This commit is contained in:
josh committed 2016-06-19 15:44:48 -04:00
1 parent ecf9fe176c
commit 9cba728fb9
186 files changed
+141177

No files matched your search

+17
View File
@@ -1,3 +1,6 @@
import platform
import re
def options(opt):
opt.load("compiler_cxx")
@@ -10,3 +13,17 @@ def build(bld):
target = "jes",
source = bld.path.ant_glob("src/**/*.cc"),
cxxflags = ["-Wall", "-std=gnu++14"])
test_libs = []
if re.search(r'linux', platform.platform(), re.IGNORECASE):
test_libs += ["pthread"]
test_sources = bld.path.ant_glob("src/**/*.cc")
test_sources = [s for s in test_sources if not s.abspath().endswith("src/jes.cc")]
test_sources += bld.path.ant_glob("test/src/**/*.cc")
test_sources += ["gtest-1.7.0/src/gtest-all.cc",
"gtest-1.7.0/src/gtest_main.cc"]
bld(features = "cxx cxxprogram",
target = "tests",
source = test_sources,
includes = ["gtest-1.7.0/include", "gtest-1.7.0", "src"],
lib = test_libs,
cxxflags = ["-Wall", "-std=gnu++14"])