From 04ef73b13a0ee8ee95331c6f2af7cbfaeadb5937 Mon Sep 17 00:00:00 2001 From: Tatsuhiko Kubo Date: Tue, 3 May 2016 22:29:50 +0900 Subject: [PATCH 1/6] test: changed the way to embed googletest. Before googletest was not supported `make install`. But not anymore. --- test/SConstruct | 40 ++++++++++++++-------------------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/test/SConstruct b/test/SConstruct index d5ced04..1e86496 100644 --- a/test/SConstruct +++ b/test/SConstruct @@ -8,26 +8,10 @@ def path_chomp(path): return path[:-1] return path -if not 'GTEST_ROOT' in os.environ: - print "set environment variable 'GTEST_ROOT'" - Exit(1) - -gtest_root = path_chomp(os.environ['GTEST_ROOT']) -if gtest_root[-1] == '/': - gtest_root = gtest_root[:-1] - -gtest_includes = gtest_root + '/include' -gtest_libs = gtest_root + '/lib/.libs' - -flags = ['-Wall', '-O2'] -libs = ['stdc++', 'pthread'] -includes = ['..', gtest_includes] -target = 'dtl_test' - -env = Environment(CPPFLAGS=flags, - CPPPATH=includes, - LIBPATH=[gtest_libs], - ) +env = Environment( + CPPFLAGS=['-Wall', '-O2'], + CPPPATH=['..'], +) conf = Configure(env); @@ -35,6 +19,7 @@ if not conf.CheckCXX(): print "c++ compiler is not installed!" Exit(1) +libs = ['stdc++', 'pthread', 'libgtest'] for lib in libs: if not conf.CheckLib(lib): print "library " + lib + " not installed!" @@ -42,12 +27,15 @@ for lib in libs: conf.Finish() -test = env.Program(target, - [Glob('*.cpp'), gtest_libs + '/libgtest.a'] - ) +test = env.Program( + 'dtl_test', + [Glob('*.cpp')], +) -test_alias = env.Alias('check', - test, - test[0].abspath) +test_alias = env.Alias( + 'check', + test, + test[0].abspath +) env.AlwaysBuild(test_alias) From 56536c43a392ab08ca784150da61ae6f7ad7679f Mon Sep 17 00:00:00 2001 From: Tatsuhiko Kubo Date: Tue, 3 May 2016 22:36:08 +0900 Subject: [PATCH 2/6] trailed library suffix. --- test/SConstruct | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/SConstruct b/test/SConstruct index 1e86496..27cc776 100644 --- a/test/SConstruct +++ b/test/SConstruct @@ -19,7 +19,7 @@ if not conf.CheckCXX(): print "c++ compiler is not installed!" Exit(1) -libs = ['stdc++', 'pthread', 'libgtest'] +libs = ['stdc++', 'pthread', 'gtest'] for lib in libs: if not conf.CheckLib(lib): print "library " + lib + " not installed!" From 7b1334256ff0527e3cdb8ffc2fe647119d0bf92e Mon Sep 17 00:00:00 2001 From: Tatsuhiko Kubo Date: Sun, 28 Aug 2016 20:28:26 +0900 Subject: [PATCH 3/6] ci: bumped googletest version to 1.8.0. --- .travis.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 49cda0f..7e68d52 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,14 +3,15 @@ compiler: - gcc - clang before_script: - - wget http://googletest.googlecode.com/files/gtest-1.7.0.zip - - unzip -q gtest-1.7.0.zip - - cd gtest-1.7.0 - - ./configure + - sudo apt-get install -y cmake + - wget https://github.com/google/googletest/archive/release-1.8.0.zip + - unzip -q gtest-1.8.0.zip + - cd gtest-1.8.0 + - cmake . - make - cd .. script: - cd examples - scons - cd ../test - - GTEST_ROOT=$PWD/../gtest-1.7.0 scons check + - scons check From a0de1b5e12b56d89330548f1c5eff1c520be6828 Mon Sep 17 00:00:00 2001 From: Tatsuhiko Kubo Date: Sun, 28 Aug 2016 20:32:20 +0900 Subject: [PATCH 4/6] ci: fixed archived path. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7e68d52..082c7bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,8 @@ compiler: before_script: - sudo apt-get install -y cmake - wget https://github.com/google/googletest/archive/release-1.8.0.zip - - unzip -q gtest-1.8.0.zip - - cd gtest-1.8.0 + - unzip -q release-1.8.0.zip + - cd googletest-release-1.8.0 - cmake . - make - cd .. From 059ed536d98cdab1b8c14fa8e07c03325a03bb96 Mon Sep 17 00:00:00 2001 From: Tatsuhiko Kubo Date: Sun, 28 Aug 2016 20:35:34 +0900 Subject: [PATCH 5/6] ci: make install is required. --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 082c7bc..2268131 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,12 +3,13 @@ compiler: - gcc - clang before_script: - - sudo apt-get install -y cmake + - apt-get install -y cmake - wget https://github.com/google/googletest/archive/release-1.8.0.zip - unzip -q release-1.8.0.zip - cd googletest-release-1.8.0 - cmake . - make + - make install - cd .. script: - cd examples From b13acd460a8b2df4a61248e2d8a61fddcf7f1a7b Mon Sep 17 00:00:00 2001 From: Tatsuhiko Kubo Date: Sun, 28 Aug 2016 20:37:38 +0900 Subject: [PATCH 6/6] ci: sudo is required. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2268131..6fdbb84 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,13 +3,13 @@ compiler: - gcc - clang before_script: - - apt-get install -y cmake + - sudo apt-get install -y cmake - wget https://github.com/google/googletest/archive/release-1.8.0.zip - unzip -q release-1.8.0.zip - cd googletest-release-1.8.0 - cmake . - make - - make install + - sudo make install - cd .. script: - cd examples