Update README / CMakeLists.txt; fix for -Wformat warning in btree_bench.cc
parent
f85129d4d7
commit
54f346f981
|
@ -29,6 +29,8 @@ if(build_tests)
|
||||||
enable_testing()
|
enable_testing()
|
||||||
include_directories($ENV{GTEST_ROOT}/include)
|
include_directories($ENV{GTEST_ROOT}/include)
|
||||||
link_directories($ENV{GTEST_ROOT})
|
link_directories($ENV{GTEST_ROOT})
|
||||||
|
include_directories($ENV{GFLAGS_ROOT}/include)
|
||||||
|
link_directories($ENV{GFLAGS_ROOT}/lib)
|
||||||
add_executable(btree_test btree_test.cc btree_test_flags.cc)
|
add_executable(btree_test btree_test.cc btree_test_flags.cc)
|
||||||
add_executable(safe_btree_test safe_btree_test.cc btree_test_flags.cc)
|
add_executable(safe_btree_test safe_btree_test.cc btree_test_flags.cc)
|
||||||
add_executable(btree_bench btree_bench.cc btree_test_flags.cc)
|
add_executable(btree_bench btree_bench.cc btree_test_flags.cc)
|
||||||
|
|
13
README
13
README
|
@ -11,10 +11,21 @@ CMake, the Google C++ Test framework, and the Google flags package.
|
||||||
|
|
||||||
Download and install CMake from http://www.cmake.org
|
Download and install CMake from http://www.cmake.org
|
||||||
|
|
||||||
Download and build the GoogleTest framework from http://code.google.com/p/googletest
|
Download and build the GoogleTest framework from
|
||||||
|
http://code.google.com/p/googletest
|
||||||
|
|
||||||
Download and install gflags from https://code.google.com/p/gflags
|
Download and install gflags from https://code.google.com/p/gflags
|
||||||
|
|
||||||
|
Set GTEST_ROOT to the directory where GTEST was built.
|
||||||
|
Set GFLAGS_ROOT to the directory prefix where GFLAGS is installed.
|
||||||
|
|
||||||
export GTEST_ROOT=/path/for/gtest-x.y
|
export GTEST_ROOT=/path/for/gtest-x.y
|
||||||
|
export GFLAGS_ROOT=/opt
|
||||||
|
|
||||||
cmake . -Dbuild_tests=ON
|
cmake . -Dbuild_tests=ON
|
||||||
|
|
||||||
|
For example, to build on a Unix system with the clang++ compiler,
|
||||||
|
|
||||||
|
export GTEST_ROOT=$(HOME)/src/googletest
|
||||||
|
export GFLAGS_ROOT=/opt
|
||||||
|
cmake . -G "Unix Makefiles" -Dbuild_tests=ON -DCMAKE_CXX_COMPILER=clang++
|
||||||
|
|
|
@ -133,7 +133,7 @@ void BenchmarkRun::Reset() {
|
||||||
void BenchmarkRun::Run() {
|
void BenchmarkRun::Run() {
|
||||||
assert(current_benchmark == NULL);
|
assert(current_benchmark == NULL);
|
||||||
current_benchmark = this;
|
current_benchmark = this;
|
||||||
int iters = FLAGS_benchmark_min_iters;
|
int64_t iters = FLAGS_benchmark_min_iters;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
Reset();
|
Reset();
|
||||||
Start();
|
Start();
|
||||||
|
@ -152,7 +152,7 @@ void BenchmarkRun::Run() {
|
||||||
}
|
}
|
||||||
fprintf(stdout, "%s\t%qu\t%qu\n",
|
fprintf(stdout, "%s\t%qu\t%qu\n",
|
||||||
benchmark_name,
|
benchmark_name,
|
||||||
accum_micros * 1000 / iters,
|
accum_micros * 1000ULL / iters,
|
||||||
iters);
|
iters);
|
||||||
current_benchmark = NULL;
|
current_benchmark = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue