├── .gitignore ├── 3rdparty └── benchmark │ ├── .clang-format │ ├── .gitignore │ ├── .travis-libcxx-setup.sh │ ├── .travis.yml │ ├── .ycm_extra_conf.py │ ├── AUTHORS │ ├── BUILD.bazel │ ├── CMakeLists.txt │ ├── CONTRIBUTING.md │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── README.md │ ├── WORKSPACE │ ├── appveyor.yml │ ├── cmake │ ├── AddCXXCompilerFlag.cmake │ ├── CXXFeatureCheck.cmake │ ├── Config.cmake.in │ ├── GetGitVersion.cmake │ ├── HandleGTest.cmake │ ├── benchmark.pc.in │ ├── gnu_posix_regex.cpp │ ├── llvm-toolchain.cmake │ ├── posix_regex.cpp │ ├── split_list.cmake │ ├── std_regex.cpp │ ├── steady_clock.cpp │ └── thread_safety_attributes.cpp │ ├── docs │ ├── AssemblyTests.md │ └── tools.md │ ├── googletest │ ├── .gitignore │ ├── .travis.yml │ ├── CMakeLists.txt │ ├── README.md │ ├── appveyor.yml │ ├── googlemock │ │ ├── CHANGES │ │ ├── CMakeLists.txt │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── Makefile.am │ │ ├── README.md │ │ ├── build-aux │ │ │ └── .keep │ │ ├── configure.ac │ │ ├── docs │ │ │ ├── CheatSheet.md │ │ │ ├── CookBook.md │ │ │ ├── DesignDoc.md │ │ │ ├── DevGuide.md │ │ │ ├── Documentation.md │ │ │ ├── ForDummies.md │ │ │ ├── FrequentlyAskedQuestions.md │ │ │ ├── KnownIssues.md │ │ │ ├── v1_5 │ │ │ │ ├── CheatSheet.md │ │ │ │ ├── CookBook.md │ │ │ │ ├── Documentation.md │ │ │ │ ├── ForDummies.md │ │ │ │ └── FrequentlyAskedQuestions.md │ │ │ ├── v1_6 │ │ │ │ ├── CheatSheet.md │ │ │ │ ├── CookBook.md │ │ │ │ ├── Documentation.md │ │ │ │ ├── ForDummies.md │ │ │ │ └── FrequentlyAskedQuestions.md │ │ │ └── v1_7 │ │ │ │ ├── CheatSheet.md │ │ │ │ ├── CookBook.md │ │ │ │ ├── Documentation.md │ │ │ │ ├── ForDummies.md │ │ │ │ └── FrequentlyAskedQuestions.md │ │ ├── include │ │ │ └── gmock │ │ │ │ ├── gmock-actions.h │ │ │ │ ├── gmock-cardinalities.h │ │ │ │ ├── gmock-generated-actions.h │ │ │ │ ├── gmock-generated-actions.h.pump │ │ │ │ ├── gmock-generated-function-mockers.h │ │ │ │ ├── gmock-generated-function-mockers.h.pump │ │ │ │ ├── gmock-generated-matchers.h │ │ │ │ ├── gmock-generated-matchers.h.pump │ │ │ │ ├── gmock-generated-nice-strict.h │ │ │ │ ├── gmock-generated-nice-strict.h.pump │ │ │ │ ├── gmock-matchers.h │ │ │ │ ├── gmock-more-actions.h │ │ │ │ ├── gmock-more-matchers.h │ │ │ │ ├── gmock-spec-builders.h │ │ │ │ ├── gmock.h │ │ │ │ └── internal │ │ │ │ ├── custom │ │ │ │ ├── gmock-generated-actions.h │ │ │ │ ├── gmock-generated-actions.h.pump │ │ │ │ ├── gmock-matchers.h │ │ │ │ └── gmock-port.h │ │ │ │ ├── gmock-generated-internal-utils.h │ │ │ │ ├── gmock-generated-internal-utils.h.pump │ │ │ │ ├── gmock-internal-utils.h │ │ │ │ └── gmock-port.h │ │ ├── msvc │ │ │ ├── 2005 │ │ │ │ ├── gmock.sln │ │ │ │ ├── gmock.vcproj │ │ │ │ ├── gmock_config.vsprops │ │ │ │ ├── gmock_main.vcproj │ │ │ │ └── gmock_test.vcproj │ │ │ ├── 2010 │ │ │ │ ├── gmock.sln │ │ │ │ ├── gmock.vcxproj │ │ │ │ ├── gmock_config.props │ │ │ │ ├── gmock_main.vcxproj │ │ │ │ └── gmock_test.vcxproj │ │ │ └── 2015 │ │ │ │ ├── gmock.sln │ │ │ │ ├── gmock.vcxproj │ │ │ │ ├── gmock_config.props │ │ │ │ ├── gmock_main.vcxproj │ │ │ │ └── gmock_test.vcxproj │ │ ├── scripts │ │ │ ├── fuse_gmock_files.py │ │ │ ├── generator │ │ │ │ ├── LICENSE │ │ │ │ ├── README │ │ │ │ ├── README.cppclean │ │ │ │ ├── cpp │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── ast.py │ │ │ │ │ ├── gmock_class.py │ │ │ │ │ ├── gmock_class_test.py │ │ │ │ │ ├── keywords.py │ │ │ │ │ ├── tokenize.py │ │ │ │ │ └── utils.py │ │ │ │ └── gmock_gen.py │ │ │ ├── gmock-config.in │ │ │ ├── gmock_doctor.py │ │ │ ├── upload.py │ │ │ └── upload_gmock.py │ │ ├── src │ │ │ ├── gmock-all.cc │ │ │ ├── gmock-cardinalities.cc │ │ │ ├── gmock-internal-utils.cc │ │ │ ├── gmock-matchers.cc │ │ │ ├── gmock-spec-builders.cc │ │ │ ├── gmock.cc │ │ │ └── gmock_main.cc │ │ └── test │ │ │ ├── gmock-actions_test.cc │ │ │ ├── gmock-cardinalities_test.cc │ │ │ ├── gmock-generated-actions_test.cc │ │ │ ├── gmock-generated-function-mockers_test.cc │ │ │ ├── gmock-generated-internal-utils_test.cc │ │ │ ├── gmock-generated-matchers_test.cc │ │ │ ├── gmock-internal-utils_test.cc │ │ │ ├── gmock-matchers_test.cc │ │ │ ├── gmock-more-actions_test.cc │ │ │ ├── gmock-nice-strict_test.cc │ │ │ ├── gmock-port_test.cc │ │ │ ├── gmock-spec-builders_test.cc │ │ │ ├── gmock_all_test.cc │ │ │ ├── gmock_ex_test.cc │ │ │ ├── gmock_leak_test.py │ │ │ ├── gmock_leak_test_.cc │ │ │ ├── gmock_link2_test.cc │ │ │ ├── gmock_link_test.cc │ │ │ ├── gmock_link_test.h │ │ │ ├── gmock_output_test.py │ │ │ ├── gmock_output_test_.cc │ │ │ ├── gmock_output_test_golden.txt │ │ │ ├── gmock_stress_test.cc │ │ │ ├── gmock_test.cc │ │ │ └── gmock_test_utils.py │ ├── googletest │ │ ├── .gitignore │ │ ├── CHANGES │ │ ├── CMakeLists.txt │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── Makefile.am │ │ ├── README.md │ │ ├── build-aux │ │ │ └── .keep │ │ ├── cmake │ │ │ └── internal_utils.cmake │ │ ├── codegear │ │ │ ├── gtest.cbproj │ │ │ ├── gtest.groupproj │ │ │ ├── gtest_all.cc │ │ │ ├── gtest_link.cc │ │ │ ├── gtest_main.cbproj │ │ │ └── gtest_unittest.cbproj │ │ ├── configure.ac │ │ ├── docs │ │ │ ├── AdvancedGuide.md │ │ │ ├── DevGuide.md │ │ │ ├── Documentation.md │ │ │ ├── FAQ.md │ │ │ ├── Primer.md │ │ │ ├── PumpManual.md │ │ │ ├── Samples.md │ │ │ ├── V1_5_AdvancedGuide.md │ │ │ ├── V1_5_Documentation.md │ │ │ ├── V1_5_FAQ.md │ │ │ ├── V1_5_Primer.md │ │ │ ├── V1_5_PumpManual.md │ │ │ ├── V1_5_XcodeGuide.md │ │ │ ├── V1_6_AdvancedGuide.md │ │ │ ├── V1_6_Documentation.md │ │ │ ├── V1_6_FAQ.md │ │ │ ├── V1_6_Primer.md │ │ │ ├── V1_6_PumpManual.md │ │ │ ├── V1_6_Samples.md │ │ │ ├── V1_6_XcodeGuide.md │ │ │ ├── V1_7_AdvancedGuide.md │ │ │ ├── V1_7_Documentation.md │ │ │ ├── V1_7_FAQ.md │ │ │ ├── V1_7_Primer.md │ │ │ ├── V1_7_PumpManual.md │ │ │ ├── V1_7_Samples.md │ │ │ ├── V1_7_XcodeGuide.md │ │ │ └── XcodeGuide.md │ │ ├── include │ │ │ └── gtest │ │ │ │ ├── gtest-death-test.h │ │ │ │ ├── gtest-message.h │ │ │ │ ├── gtest-param-test.h │ │ │ │ ├── gtest-param-test.h.pump │ │ │ │ ├── gtest-printers.h │ │ │ │ ├── gtest-spi.h │ │ │ │ ├── gtest-test-part.h │ │ │ │ ├── gtest-typed-test.h │ │ │ │ ├── gtest.h │ │ │ │ ├── gtest_pred_impl.h │ │ │ │ ├── gtest_prod.h │ │ │ │ └── internal │ │ │ │ ├── custom │ │ │ │ ├── gtest-port.h │ │ │ │ ├── gtest-printers.h │ │ │ │ └── gtest.h │ │ │ │ ├── gtest-death-test-internal.h │ │ │ │ ├── gtest-filepath.h │ │ │ │ ├── gtest-internal.h │ │ │ │ ├── gtest-linked_ptr.h │ │ │ │ ├── gtest-param-util-generated.h │ │ │ │ ├── gtest-param-util-generated.h.pump │ │ │ │ ├── gtest-param-util.h │ │ │ │ ├── gtest-port-arch.h │ │ │ │ ├── gtest-port.h │ │ │ │ ├── gtest-string.h │ │ │ │ ├── gtest-tuple.h │ │ │ │ ├── gtest-tuple.h.pump │ │ │ │ ├── gtest-type-util.h │ │ │ │ └── gtest-type-util.h.pump │ │ ├── m4 │ │ │ ├── acx_pthread.m4 │ │ │ └── gtest.m4 │ │ ├── msvc │ │ │ ├── gtest-md.sln │ │ │ ├── gtest-md.vcproj │ │ │ ├── gtest.sln │ │ │ ├── gtest.vcproj │ │ │ ├── gtest_main-md.vcproj │ │ │ ├── gtest_main.vcproj │ │ │ ├── gtest_prod_test-md.vcproj │ │ │ ├── gtest_prod_test.vcproj │ │ │ ├── gtest_unittest-md.vcproj │ │ │ └── gtest_unittest.vcproj │ │ ├── samples │ │ │ ├── prime_tables.h │ │ │ ├── sample1.cc │ │ │ ├── sample1.h │ │ │ ├── sample10_unittest.cc │ │ │ ├── sample1_unittest.cc │ │ │ ├── sample2.cc │ │ │ ├── sample2.h │ │ │ ├── sample2_unittest.cc │ │ │ ├── sample3-inl.h │ │ │ ├── sample3_unittest.cc │ │ │ ├── sample4.cc │ │ │ ├── sample4.h │ │ │ ├── sample4_unittest.cc │ │ │ ├── sample5_unittest.cc │ │ │ ├── sample6_unittest.cc │ │ │ ├── sample7_unittest.cc │ │ │ ├── sample8_unittest.cc │ │ │ └── sample9_unittest.cc │ │ ├── scripts │ │ │ ├── common.py │ │ │ ├── fuse_gtest_files.py │ │ │ ├── gen_gtest_pred_impl.py │ │ │ ├── gtest-config.in │ │ │ ├── pump.py │ │ │ ├── release_docs.py │ │ │ ├── upload.py │ │ │ └── upload_gtest.py │ │ ├── src │ │ │ ├── gtest-all.cc │ │ │ ├── gtest-death-test.cc │ │ │ ├── gtest-filepath.cc │ │ │ ├── gtest-internal-inl.h │ │ │ ├── gtest-port.cc │ │ │ ├── gtest-printers.cc │ │ │ ├── gtest-test-part.cc │ │ │ ├── gtest-typed-test.cc │ │ │ ├── gtest.cc │ │ │ └── gtest_main.cc │ │ ├── test │ │ │ ├── gtest-death-test_ex_test.cc │ │ │ ├── gtest-death-test_test.cc │ │ │ ├── gtest-filepath_test.cc │ │ │ ├── gtest-linked_ptr_test.cc │ │ │ ├── gtest-listener_test.cc │ │ │ ├── gtest-message_test.cc │ │ │ ├── gtest-options_test.cc │ │ │ ├── gtest-param-test2_test.cc │ │ │ ├── gtest-param-test_test.cc │ │ │ ├── gtest-param-test_test.h │ │ │ ├── gtest-port_test.cc │ │ │ ├── gtest-printers_test.cc │ │ │ ├── gtest-test-part_test.cc │ │ │ ├── gtest-tuple_test.cc │ │ │ ├── gtest-typed-test2_test.cc │ │ │ ├── gtest-typed-test_test.cc │ │ │ ├── gtest-typed-test_test.h │ │ │ ├── gtest-unittest-api_test.cc │ │ │ ├── gtest_all_test.cc │ │ │ ├── gtest_break_on_failure_unittest.py │ │ │ ├── gtest_break_on_failure_unittest_.cc │ │ │ ├── gtest_catch_exceptions_test.py │ │ │ ├── gtest_catch_exceptions_test_.cc │ │ │ ├── gtest_color_test.py │ │ │ ├── gtest_color_test_.cc │ │ │ ├── gtest_env_var_test.py │ │ │ ├── gtest_env_var_test_.cc │ │ │ ├── gtest_environment_test.cc │ │ │ ├── gtest_filter_unittest.py │ │ │ ├── gtest_filter_unittest_.cc │ │ │ ├── gtest_help_test.py │ │ │ ├── gtest_help_test_.cc │ │ │ ├── gtest_list_tests_unittest.py │ │ │ ├── gtest_list_tests_unittest_.cc │ │ │ ├── gtest_main_unittest.cc │ │ │ ├── gtest_no_test_unittest.cc │ │ │ ├── gtest_output_test.py │ │ │ ├── gtest_output_test_.cc │ │ │ ├── gtest_output_test_golden_lin.txt │ │ │ ├── gtest_pred_impl_unittest.cc │ │ │ ├── gtest_premature_exit_test.cc │ │ │ ├── gtest_prod_test.cc │ │ │ ├── gtest_repeat_test.cc │ │ │ ├── gtest_shuffle_test.py │ │ │ ├── gtest_shuffle_test_.cc │ │ │ ├── gtest_sole_header_test.cc │ │ │ ├── gtest_stress_test.cc │ │ │ ├── gtest_test_utils.py │ │ │ ├── gtest_throw_on_failure_ex_test.cc │ │ │ ├── gtest_throw_on_failure_test.py │ │ │ ├── gtest_throw_on_failure_test_.cc │ │ │ ├── gtest_uninitialized_test.py │ │ │ ├── gtest_uninitialized_test_.cc │ │ │ ├── gtest_unittest.cc │ │ │ ├── gtest_xml_outfile1_test_.cc │ │ │ ├── gtest_xml_outfile2_test_.cc │ │ │ ├── gtest_xml_outfiles_test.py │ │ │ ├── gtest_xml_output_unittest.py │ │ │ ├── gtest_xml_output_unittest_.cc │ │ │ ├── gtest_xml_test_utils.py │ │ │ ├── production.cc │ │ │ └── production.h │ │ └── xcode │ │ │ ├── Config │ │ │ ├── DebugProject.xcconfig │ │ │ ├── FrameworkTarget.xcconfig │ │ │ ├── General.xcconfig │ │ │ ├── ReleaseProject.xcconfig │ │ │ ├── StaticLibraryTarget.xcconfig │ │ │ └── TestTarget.xcconfig │ │ │ ├── Resources │ │ │ └── Info.plist │ │ │ ├── Samples │ │ │ └── FrameworkSample │ │ │ │ ├── Info.plist │ │ │ │ ├── WidgetFramework.xcodeproj │ │ │ │ └── project.pbxproj │ │ │ │ ├── runtests.sh │ │ │ │ ├── widget.cc │ │ │ │ ├── widget.h │ │ │ │ └── widget_test.cc │ │ │ ├── Scripts │ │ │ ├── runtests.sh │ │ │ └── versiongenerate.py │ │ │ └── gtest.xcodeproj │ │ │ └── project.pbxproj │ └── travis.sh │ ├── include │ └── benchmark │ │ └── benchmark.h │ ├── mingw.py │ ├── releasing.md │ ├── src │ ├── CMakeLists.txt │ ├── arraysize.h │ ├── benchmark.cc │ ├── benchmark_api_internal.h │ ├── benchmark_main.cc │ ├── benchmark_register.cc │ ├── benchmark_register.h │ ├── check.h │ ├── colorprint.cc │ ├── colorprint.h │ ├── commandlineflags.cc │ ├── commandlineflags.h │ ├── complexity.cc │ ├── complexity.h │ ├── console_reporter.cc │ ├── counter.cc │ ├── counter.h │ ├── csv_reporter.cc │ ├── cycleclock.h │ ├── internal_macros.h │ ├── json_reporter.cc │ ├── log.h │ ├── mutex.h │ ├── re.h │ ├── reporter.cc │ ├── sleep.cc │ ├── sleep.h │ ├── statistics.cc │ ├── statistics.h │ ├── string_util.cc │ ├── string_util.h │ ├── sysinfo.cc │ ├── thread_manager.h │ ├── thread_timer.h │ ├── timers.cc │ └── timers.h │ ├── test │ ├── AssemblyTests.cmake │ ├── CMakeLists.txt │ ├── basic_test.cc │ ├── benchmark_gtest.cc │ ├── benchmark_test.cc │ ├── clobber_memory_assembly_test.cc │ ├── complexity_test.cc │ ├── cxx03_test.cc │ ├── diagnostics_test.cc │ ├── donotoptimize_assembly_test.cc │ ├── donotoptimize_test.cc │ ├── filter_test.cc │ ├── fixture_test.cc │ ├── link_main_test.cc │ ├── map_test.cc │ ├── multiple_ranges_test.cc │ ├── options_test.cc │ ├── output_test.h │ ├── output_test_helper.cc │ ├── register_benchmark_test.cc │ ├── reporter_output_test.cc │ ├── skip_with_error_test.cc │ ├── state_assembly_test.cc │ ├── statistics_gtest.cc │ ├── templated_fixture_test.cc │ ├── user_counters_tabular_test.cc │ └── user_counters_test.cc │ └── tools │ ├── compare.py │ ├── compare_bench.py │ ├── gbench │ ├── Inputs │ │ ├── test1_run1.json │ │ ├── test1_run2.json │ │ └── test2_run.json │ ├── __init__.py │ ├── report.py │ └── util.py │ └── strip_asm.py ├── CMakeLists.txt ├── README.md ├── benchmark ├── CMakeLists.txt └── Kernel │ └── Containers │ └── list_bench.cpp ├── src ├── Data │ ├── Drd │ │ ├── drd_info.cpp │ │ ├── drd_info.hpp │ │ ├── drd_mode.hpp │ │ ├── drd_std.cpp │ │ ├── drd_std.hpp │ │ ├── tag_info.cpp │ │ ├── tag_info.hpp │ │ ├── vars.cpp │ │ └── vars.hpp │ ├── String │ │ ├── analyze.cpp │ │ └── analyze.hpp │ └── Tree │ │ ├── tree_cursor.cpp │ │ └── tree_cursor.hpp ├── Kernel │ ├── Abstractions │ │ ├── basic.cpp │ │ ├── basic.hpp │ │ ├── blackbox.hpp │ │ ├── observer.cpp │ │ └── observer.hpp │ ├── Containers │ │ ├── array.cpp │ │ ├── array.hpp │ │ ├── hashfunc.cpp │ │ ├── hashfunc.hpp │ │ ├── hashmap.cpp │ │ ├── hashmap.hpp │ │ ├── hashmap_extra.cpp │ │ ├── hashset.cpp │ │ ├── hashset.hpp │ │ ├── hashtree.cpp │ │ ├── hashtree.hpp │ │ ├── iterator.cpp │ │ ├── iterator.hpp │ │ ├── list.cpp │ │ ├── list.hpp │ │ ├── ntuple.hpp │ │ ├── promise.hpp │ │ ├── rel_hashmap.cpp │ │ ├── rel_hashmap.hpp │ │ └── unary_function.hpp │ └── Types │ │ ├── generic_tree.hpp │ │ ├── modification.cpp │ │ ├── modification.hpp │ │ ├── parse_string.cpp │ │ ├── parse_string.hpp │ │ ├── path.cpp │ │ ├── path.hpp │ │ ├── string.cpp │ │ ├── string.hpp │ │ ├── tree.cpp │ │ ├── tree.hpp │ │ ├── tree_label.cpp │ │ └── tree_label.hpp └── System │ ├── Files │ ├── tm_ostream.cpp │ └── tm_ostream.hpp │ └── Misc │ ├── fast_alloc.cpp │ ├── fast_alloc.hpp │ └── tm_configure.hpp └── tests ├── CMakeLists.txt ├── Data └── String │ └── analyze_test.cpp └── Kernel ├── Containers ├── array_test.cpp ├── hashmap_test.cpp └── list_test.cpp └── Types ├── string_test.cpp └── tree_test.cpp /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | .kdev4/ 3 | *.kdev4 4 | .vscode 5 | -------------------------------------------------------------------------------- /3rdparty/benchmark/.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | BasedOnStyle: Google 4 | ... 5 | 6 | -------------------------------------------------------------------------------- /3rdparty/benchmark/.gitignore: -------------------------------------------------------------------------------- 1 | *.a 2 | *.so 3 | *.so.?* 4 | *.dll 5 | *.exe 6 | *.dylib 7 | !/test/AssemblyTests.cmake 8 | *~ 9 | *.pyc 10 | __pycache__ 11 | 12 | # lcov 13 | *.lcov 14 | /lcov 15 | 16 | # cmake files. 17 | /Testing 18 | CMakeCache.txt 19 | CMakeFiles/ 20 | cmake_install.cmake 21 | 22 | # makefiles. 23 | Makefile 24 | 25 | # in-source build. 26 | bin/ 27 | lib/ 28 | /test/*_test 29 | 30 | # exuberant ctags. 31 | tags 32 | 33 | # YouCompleteMe configuration. 34 | .ycm_extra_conf.pyc 35 | 36 | # ninja generated files. 37 | .ninja_deps 38 | .ninja_log 39 | build.ninja 40 | install_manifest.txt 41 | rules.ninja 42 | 43 | # bazel output symlinks. 44 | bazel-* 45 | 46 | # out-of-source build top-level folders. 47 | build/ 48 | _build/ 49 | 50 | # Visual Studio 2015/2017 cache/options directory 51 | .vs/ 52 | CMakeSettings.json 53 | -------------------------------------------------------------------------------- /3rdparty/benchmark/.travis-libcxx-setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Install a newer CMake version 4 | curl -sSL https://cmake.org/files/v3.6/cmake-3.6.1-Linux-x86_64.sh -o install-cmake.sh 5 | chmod +x install-cmake.sh 6 | sudo ./install-cmake.sh --prefix=/usr/local --skip-license 7 | 8 | # Checkout LLVM sources 9 | git clone --depth=1 https://github.com/llvm-mirror/llvm.git llvm-source 10 | git clone --depth=1 https://github.com/llvm-mirror/libcxx.git llvm-source/projects/libcxx 11 | git clone --depth=1 https://github.com/llvm-mirror/libcxxabi.git llvm-source/projects/libcxxabi 12 | 13 | # Setup libc++ options 14 | if [ -z "$BUILD_32_BITS" ]; then 15 | export BUILD_32_BITS=OFF && echo disabling 32 bit build 16 | fi 17 | 18 | # Build and install libc++ (Use unstable ABI for better sanitizer coverage) 19 | mkdir llvm-build && cd llvm-build 20 | cmake -DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${COMPILER} \ 21 | -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr \ 22 | -DLIBCXX_ABI_UNSTABLE=ON \ 23 | -DLLVM_USE_SANITIZER=${LIBCXX_SANITIZER} \ 24 | -DLLVM_BUILD_32_BITS=${BUILD_32_BITS} \ 25 | ../llvm-source 26 | make cxx -j2 27 | sudo make install-cxxabi install-cxx 28 | cd ../ 29 | -------------------------------------------------------------------------------- /3rdparty/benchmark/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of benchmark authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS files. 3 | # See the latter for an explanation. 4 | # 5 | # Names should be added to this file as: 6 | # Name or Organization 7 | # The email address is not required for organizations. 8 | # 9 | # Please keep the list sorted. 10 | 11 | Albert Pretorius 12 | Arne Beer 13 | Carto 14 | Christopher Seymour 15 | David Coeurjolly 16 | Deniz Evrenci 17 | Dirac Research 18 | Dominik Czarnota 19 | Eric Fiselier 20 | Eugene Zhuk 21 | Evgeny Safronov 22 | Felix Homann 23 | Google Inc. 24 | International Business Machines Corporation 25 | Ismael Jimenez Martinez 26 | Jern-Kuan Leong 27 | JianXiong Zhou 28 | Joao Paulo Magalhaes 29 | Jussi Knuuttila 30 | Kaito Udagawa 31 | Kishan Kumar 32 | Lei Xu 33 | Matt Clarkson 34 | Maxim Vafin 35 | MongoDB Inc. 36 | Nick Hutchinson 37 | Oleksandr Sochka 38 | Paul Redmond 39 | Radoslav Yovchev 40 | Roman Lebedev 41 | Shuo Chen 42 | Steinar H. Gunderson 43 | Stripe, Inc. 44 | Yixuan Qiu 45 | Yusuke Suzuki 46 | Zbigniew Skowron 47 | -------------------------------------------------------------------------------- /3rdparty/benchmark/BUILD.bazel: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) 2 | 3 | config_setting( 4 | name = "windows", 5 | values = { 6 | "cpu": "x64_windows", 7 | }, 8 | visibility = [":__subpackages__"], 9 | ) 10 | 11 | cc_library( 12 | name = "benchmark", 13 | srcs = glob( 14 | [ 15 | "src/*.cc", 16 | "src/*.h", 17 | ], 18 | exclude = ["src/benchmark_main.cc"], 19 | ), 20 | hdrs = ["include/benchmark/benchmark.h"], 21 | linkopts = select({ 22 | ":windows": ["-DEFAULTLIB:shlwapi.lib"], 23 | "//conditions:default": ["-pthread"], 24 | }), 25 | strip_include_prefix = "include", 26 | visibility = ["//visibility:public"], 27 | ) 28 | 29 | cc_library( 30 | name = "benchmark_main", 31 | srcs = ["src/benchmark_main.cc"], 32 | hdrs = ["include/benchmark/benchmark.h"], 33 | strip_include_prefix = "include", 34 | visibility = ["//visibility:public"], 35 | deps = [":benchmark"], 36 | ) 37 | 38 | cc_library( 39 | name = "benchmark_internal_headers", 40 | hdrs = glob(["src/*.h"]), 41 | visibility = ["//test:__pkg__"], 42 | ) 43 | -------------------------------------------------------------------------------- /3rdparty/benchmark/WORKSPACE: -------------------------------------------------------------------------------- 1 | workspace(name = "com_github_google_benchmark") 2 | 3 | http_archive( 4 | name = "com_google_googletest", 5 | urls = ["https://github.com/google/googletest/archive/3f0cf6b62ad1eb50d8736538363d3580dd640c3e.zip"], 6 | strip_prefix = "googletest-3f0cf6b62ad1eb50d8736538363d3580dd640c3e", 7 | ) 8 | -------------------------------------------------------------------------------- /3rdparty/benchmark/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: '{build}' 2 | 3 | image: Visual Studio 2017 4 | 5 | configuration: 6 | - Debug 7 | - Release 8 | 9 | environment: 10 | matrix: 11 | - compiler: msvc-15-seh 12 | generator: "Visual Studio 15 2017" 13 | 14 | - compiler: msvc-15-seh 15 | generator: "Visual Studio 15 2017 Win64" 16 | 17 | - compiler: msvc-14-seh 18 | generator: "Visual Studio 14 2015" 19 | 20 | - compiler: msvc-14-seh 21 | generator: "Visual Studio 14 2015 Win64" 22 | 23 | - compiler: msvc-12-seh 24 | generator: "Visual Studio 12 2013" 25 | 26 | - compiler: msvc-12-seh 27 | generator: "Visual Studio 12 2013 Win64" 28 | 29 | - compiler: gcc-5.3.0-posix 30 | generator: "MinGW Makefiles" 31 | cxx_path: 'C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin' 32 | APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 33 | 34 | matrix: 35 | fast_finish: true 36 | 37 | install: 38 | # git bash conflicts with MinGW makefiles 39 | - if "%generator%"=="MinGW Makefiles" (set "PATH=%PATH:C:\Program Files\Git\usr\bin;=%") 40 | - if not "%cxx_path%"=="" (set "PATH=%PATH%;%cxx_path%") 41 | 42 | build_script: 43 | - md _build -Force 44 | - cd _build 45 | - echo %configuration% 46 | - cmake -G "%generator%" "-DCMAKE_BUILD_TYPE=%configuration%" -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON .. 47 | - cmake --build . --config %configuration% 48 | 49 | test_script: 50 | - ctest -c %configuration% --timeout 300 --output-on-failure 51 | 52 | artifacts: 53 | - path: '_build/CMakeFiles/*.log' 54 | name: logs 55 | - path: '_build/Testing/**/*.xml' 56 | name: test_results 57 | -------------------------------------------------------------------------------- /3rdparty/benchmark/cmake/CXXFeatureCheck.cmake: -------------------------------------------------------------------------------- 1 | # - Compile and run code to check for C++ features 2 | # 3 | # This functions compiles a source file under the `cmake` folder 4 | # and adds the corresponding `HAVE_[FILENAME]` flag to the CMake 5 | # environment 6 | # 7 | # cxx_feature_check( []) 8 | # 9 | # - Example 10 | # 11 | # include(CXXFeatureCheck) 12 | # cxx_feature_check(STD_REGEX) 13 | # Requires CMake 2.8.12+ 14 | 15 | if(__cxx_feature_check) 16 | return() 17 | endif() 18 | set(__cxx_feature_check INCLUDED) 19 | 20 | function(cxx_feature_check FILE) 21 | string(TOLOWER ${FILE} FILE) 22 | string(TOUPPER ${FILE} VAR) 23 | string(TOUPPER "HAVE_${VAR}" FEATURE) 24 | if (DEFINED HAVE_${VAR}) 25 | set(HAVE_${VAR} 1 PARENT_SCOPE) 26 | add_definitions(-DHAVE_${VAR}) 27 | return() 28 | endif() 29 | 30 | if (NOT DEFINED COMPILE_${FEATURE}) 31 | message("-- Performing Test ${FEATURE}") 32 | if(CMAKE_CROSSCOMPILING) 33 | try_compile(COMPILE_${FEATURE} 34 | ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${FILE}.cpp 35 | CMAKE_FLAGS ${BENCHMARK_CXX_LINKER_FLAGS} 36 | LINK_LIBRARIES ${BENCHMARK_CXX_LIBRARIES}) 37 | if(COMPILE_${FEATURE}) 38 | message(WARNING 39 | "If you see build failures due to cross compilation, try setting HAVE_${VAR} to 0") 40 | set(RUN_${FEATURE} 0) 41 | else() 42 | set(RUN_${FEATURE} 1) 43 | endif() 44 | else() 45 | message("-- Performing Test ${FEATURE}") 46 | try_run(RUN_${FEATURE} COMPILE_${FEATURE} 47 | ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${FILE}.cpp 48 | CMAKE_FLAGS ${BENCHMARK_CXX_LINKER_FLAGS} 49 | LINK_LIBRARIES ${BENCHMARK_CXX_LIBRARIES}) 50 | endif() 51 | endif() 52 | 53 | if(RUN_${FEATURE} EQUAL 0) 54 | message("-- Performing Test ${FEATURE} -- success") 55 | set(HAVE_${VAR} 1 PARENT_SCOPE) 56 | add_definitions(-DHAVE_${VAR}) 57 | else() 58 | if(NOT COMPILE_${FEATURE}) 59 | message("-- Performing Test ${FEATURE} -- failed to compile") 60 | else() 61 | message("-- Performing Test ${FEATURE} -- compiled but failed to run") 62 | endif() 63 | endif() 64 | endfunction() 65 | -------------------------------------------------------------------------------- /3rdparty/benchmark/cmake/Config.cmake.in: -------------------------------------------------------------------------------- 1 | include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake") 2 | -------------------------------------------------------------------------------- /3rdparty/benchmark/cmake/GetGitVersion.cmake: -------------------------------------------------------------------------------- 1 | # - Returns a version string from Git tags 2 | # 3 | # This function inspects the annotated git tags for the project and returns a string 4 | # into a CMake variable 5 | # 6 | # get_git_version() 7 | # 8 | # - Example 9 | # 10 | # include(GetGitVersion) 11 | # get_git_version(GIT_VERSION) 12 | # 13 | # Requires CMake 2.8.11+ 14 | find_package(Git) 15 | 16 | if(__get_git_version) 17 | return() 18 | endif() 19 | set(__get_git_version INCLUDED) 20 | 21 | function(get_git_version var) 22 | if(GIT_EXECUTABLE) 23 | execute_process(COMMAND ${GIT_EXECUTABLE} describe --match "v[0-9]*.[0-9]*.[0-9]*" --abbrev=8 24 | WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} 25 | RESULT_VARIABLE status 26 | OUTPUT_VARIABLE GIT_VERSION 27 | ERROR_QUIET) 28 | if(${status}) 29 | set(GIT_VERSION "v0.0.0") 30 | else() 31 | string(STRIP ${GIT_VERSION} GIT_VERSION) 32 | string(REGEX REPLACE "-[0-9]+-g" "-" GIT_VERSION ${GIT_VERSION}) 33 | endif() 34 | 35 | # Work out if the repository is dirty 36 | execute_process(COMMAND ${GIT_EXECUTABLE} update-index -q --refresh 37 | WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} 38 | OUTPUT_QUIET 39 | ERROR_QUIET) 40 | execute_process(COMMAND ${GIT_EXECUTABLE} diff-index --name-only HEAD -- 41 | WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} 42 | OUTPUT_VARIABLE GIT_DIFF_INDEX 43 | ERROR_QUIET) 44 | string(COMPARE NOTEQUAL "${GIT_DIFF_INDEX}" "" GIT_DIRTY) 45 | if (${GIT_DIRTY}) 46 | set(GIT_VERSION "${GIT_VERSION}-dirty") 47 | endif() 48 | else() 49 | set(GIT_VERSION "v0.0.0") 50 | endif() 51 | 52 | message("-- git Version: ${GIT_VERSION}") 53 | set(${var} ${GIT_VERSION} PARENT_SCOPE) 54 | endfunction() 55 | -------------------------------------------------------------------------------- /3rdparty/benchmark/cmake/benchmark.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | libdir=${prefix}/lib 4 | includedir=${prefix}/include 5 | 6 | Name: @PROJECT_NAME@ 7 | Description: Google microbenchmark framework 8 | Version: @VERSION@ 9 | 10 | Libs: -L${libdir} -lbenchmark 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /3rdparty/benchmark/cmake/gnu_posix_regex.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int main() { 4 | std::string str = "test0159"; 5 | regex_t re; 6 | int ec = regcomp(&re, "^[a-z]+[0-9]+$", REG_EXTENDED | REG_NOSUB); 7 | if (ec != 0) { 8 | return ec; 9 | } 10 | return regexec(&re, str.c_str(), 0, nullptr, 0) ? -1 : 0; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /3rdparty/benchmark/cmake/llvm-toolchain.cmake: -------------------------------------------------------------------------------- 1 | find_package(LLVMAr REQUIRED) 2 | set(CMAKE_AR "${LLVMAR_EXECUTABLE}" CACHE FILEPATH "" FORCE) 3 | 4 | find_package(LLVMNm REQUIRED) 5 | set(CMAKE_NM "${LLVMNM_EXECUTABLE}" CACHE FILEPATH "" FORCE) 6 | 7 | find_package(LLVMRanLib REQUIRED) 8 | set(CMAKE_RANLIB "${LLVMRANLIB_EXECUTABLE}" CACHE FILEPATH "" FORCE) 9 | -------------------------------------------------------------------------------- /3rdparty/benchmark/cmake/posix_regex.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int main() { 4 | std::string str = "test0159"; 5 | regex_t re; 6 | int ec = regcomp(&re, "^[a-z]+[0-9]+$", REG_EXTENDED | REG_NOSUB); 7 | if (ec != 0) { 8 | return ec; 9 | } 10 | int ret = regexec(&re, str.c_str(), 0, nullptr, 0) ? -1 : 0; 11 | regfree(&re); 12 | return ret; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /3rdparty/benchmark/cmake/split_list.cmake: -------------------------------------------------------------------------------- 1 | macro(split_list listname) 2 | string(REPLACE ";" " " ${listname} "${${listname}}") 3 | endmacro() 4 | -------------------------------------------------------------------------------- /3rdparty/benchmark/cmake/std_regex.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | int main() { 4 | const std::string str = "test0159"; 5 | std::regex re; 6 | re = std::regex("^[a-z]+[0-9]+$", 7 | std::regex_constants::extended | std::regex_constants::nosubs); 8 | return std::regex_search(str, re) ? 0 : -1; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /3rdparty/benchmark/cmake/steady_clock.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() { 4 | typedef std::chrono::steady_clock Clock; 5 | Clock::time_point tp = Clock::now(); 6 | ((void)tp); 7 | } 8 | -------------------------------------------------------------------------------- /3rdparty/benchmark/cmake/thread_safety_attributes.cpp: -------------------------------------------------------------------------------- 1 | #define HAVE_THREAD_SAFETY_ATTRIBUTES 2 | #include "../src/mutex.h" 3 | 4 | int main() {} 5 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore CI build directory 2 | build/ 3 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/.travis.yml: -------------------------------------------------------------------------------- 1 | # Build matrix / environment variable are explained on: 2 | # http://about.travis-ci.org/docs/user/build-configuration/ 3 | # This file can be validated on: 4 | # http://lint.travis-ci.org/ 5 | 6 | install: 7 | # /usr/bin/gcc is 4.6 always, but gcc-X.Y is available. 8 | - if [ "$CXX" = "g++" ]; then export CXX="g++-4.9" CC="gcc-4.9"; fi 9 | # /usr/bin/clang is 3.4, lets override with modern one. 10 | - if [ "$CXX" = "clang++" ] && [ "$TRAVIS_OS_NAME" = "linux" ]; then export CXX="clang++-3.7" CC="clang-3.7"; fi 11 | - echo ${PATH} 12 | - echo ${CXX} 13 | - ${CXX} --version 14 | - ${CXX} -v 15 | addons: 16 | apt: 17 | # List of whitelisted in travis packages for ubuntu-precise can be found here: 18 | # https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise 19 | # List of whitelisted in travis apt-sources: 20 | # https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json 21 | sources: 22 | - ubuntu-toolchain-r-test 23 | - llvm-toolchain-precise-3.7 24 | packages: 25 | - gcc-4.9 26 | - g++-4.9 27 | - clang-3.7 28 | - valgrind 29 | os: 30 | - linux 31 | - osx 32 | language: cpp 33 | compiler: 34 | - gcc 35 | - clang 36 | script: ./travis.sh 37 | env: 38 | matrix: 39 | - GTEST_TARGET=googletest SHARED_LIB=OFF STATIC_LIB=ON CMAKE_PKG=OFF BUILD_TYPE=debug VERBOSE_MAKE=true VERBOSE 40 | - GTEST_TARGET=googlemock SHARED_LIB=OFF STATIC_LIB=ON CMAKE_PKG=OFF BUILD_TYPE=debug VERBOSE_MAKE=true VERBOSE 41 | - GTEST_TARGET=googlemock SHARED_LIB=OFF STATIC_LIB=ON CMAKE_PKG=OFF BUILD_TYPE=debug CXX_FLAGS=-std=c++11 VERBOSE_MAKE=true VERBOSE 42 | # - GTEST_TARGET=googletest SHARED_LIB=ON STATIC_LIB=ON CMAKE_PKG=ON BUILD_TYPE=release VERBOSE_MAKE=false 43 | # - GTEST_TARGET=googlemock SHARED_LIB=ON STATIC_LIB=ON CMAKE_PKG=ON BUILD_TYPE=release VERBOSE_MAKE=false 44 | notifications: 45 | email: false 46 | sudo: false 47 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.6.2) 2 | 3 | project( googletest-distribution ) 4 | 5 | enable_testing() 6 | 7 | option(BUILD_GTEST "Builds the googletest subproject" OFF) 8 | 9 | #Note that googlemock target already builds googletest 10 | option(BUILD_GMOCK "Builds the googlemock subproject" ON) 11 | 12 | if(BUILD_GMOCK) 13 | add_subdirectory( googlemock ) 14 | elseif(BUILD_GTEST) 15 | add_subdirectory( googletest ) 16 | endif() 17 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: '{build}' 2 | 3 | os: Visual Studio 2015 4 | 5 | environment: 6 | matrix: 7 | - Toolset: v140 8 | - Toolset: v120 9 | - Toolset: v110 10 | - Toolset: v100 11 | 12 | platform: 13 | - Win32 14 | - x64 15 | 16 | configuration: 17 | # - Release 18 | - Debug 19 | 20 | build: 21 | verbosity: minimal 22 | 23 | artifacts: 24 | - path: '_build/Testing/Temporary/*' 25 | name: test_results 26 | 27 | before_build: 28 | - ps: | 29 | Write-Output "Configuration: $env:CONFIGURATION" 30 | Write-Output "Platform: $env:PLATFORM" 31 | $generator = switch ($env:TOOLSET) 32 | { 33 | "v140" {"Visual Studio 14 2015"} 34 | "v120" {"Visual Studio 12 2013"} 35 | "v110" {"Visual Studio 11 2012"} 36 | "v100" {"Visual Studio 10 2010"} 37 | } 38 | if ($env:PLATFORM -eq "x64") 39 | { 40 | $generator = "$generator Win64" 41 | } 42 | 43 | build_script: 44 | - ps: | 45 | if (($env:TOOLSET -eq "v100") -and ($env:PLATFORM -eq "x64")) 46 | { 47 | return 48 | } 49 | md _build -Force | Out-Null 50 | cd _build 51 | 52 | & cmake -G "$generator" -DCMAKE_CONFIGURATION_TYPES="Debug;Release" -Dgtest_build_tests=ON -Dgtest_build_samples=ON -Dgmock_build_tests=ON .. 53 | if ($LastExitCode -ne 0) { 54 | throw "Exec: $ErrorMessage" 55 | } 56 | & cmake --build . --config $env:CONFIGURATION 57 | if ($LastExitCode -ne 0) { 58 | throw "Exec: $ErrorMessage" 59 | } 60 | 61 | test_script: 62 | - ps: | 63 | if (($env:Toolset -eq "v100") -and ($env:PLATFORM -eq "x64")) 64 | { 65 | return 66 | } 67 | 68 | & ctest -C $env:CONFIGURATION --output-on-failure 69 | if ($LastExitCode -ne 0) { 70 | throw "Exec: $ErrorMessage" 71 | } 72 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This file contains a list of people who've made non-trivial 2 | # contribution to the Google C++ Mocking Framework project. People 3 | # who commit code to the project are encouraged to add their names 4 | # here. Please keep the list sorted by first names. 5 | 6 | Benoit Sigoure 7 | Bogdan Piloca 8 | Chandler Carruth 9 | Dave MacLachlan 10 | David Anderson 11 | Dean Sturtevant 12 | Gene Volovich 13 | Hal Burch 14 | Jeffrey Yasskin 15 | Jim Keller 16 | Joe Walnes 17 | Jon Wray 18 | Keir Mierle 19 | Keith Ray 20 | Kostya Serebryany 21 | Lev Makhlis 22 | Manuel Klimek 23 | Mario Tanev 24 | Mark Paskin 25 | Markus Heule 26 | Matthew Simmons 27 | Mike Bland 28 | Neal Norwitz 29 | Nermin Ozkiranartli 30 | Owen Carlsen 31 | Paneendra Ba 32 | Paul Menage 33 | Piotr Kaminski 34 | Russ Rufer 35 | Sverre Sundsdal 36 | Takeshi Yoshino 37 | Vadim Berman 38 | Vlad Losev 39 | Wolfgang Klier 40 | Zhanyong Wan 41 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2008, Google Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/build-aux/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texmacs/kernel/7c2de69ef7dcb3209c7f76fe9a6406d1b816fa0b/3rdparty/benchmark/googletest/googlemock/build-aux/.keep -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/docs/Documentation.md: -------------------------------------------------------------------------------- 1 | This page lists all documentation wiki pages for Google Mock **(the SVN trunk version)** 2 | - **if you use a released version of Google Mock, please read the documentation for that specific version instead.** 3 | 4 | * [ForDummies](ForDummies.md) -- start here if you are new to Google Mock. 5 | * [CheatSheet](CheatSheet.md) -- a quick reference. 6 | * [CookBook](CookBook.md) -- recipes for doing various tasks using Google Mock. 7 | * [FrequentlyAskedQuestions](FrequentlyAskedQuestions.md) -- check here before asking a question on the mailing list. 8 | 9 | To contribute code to Google Mock, read: 10 | 11 | * [DevGuide](DevGuide.md) -- read this _before_ writing your first patch. 12 | * [Pump Manual](../googletest/docs/PumpManual.md) -- how we generate some of Google Mock's source files. 13 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/docs/KnownIssues.md: -------------------------------------------------------------------------------- 1 | As any non-trivial software system, Google Mock has some known limitations and problems. We are working on improving it, and welcome your help! The follow is a list of issues we know about. 2 | 3 | 4 | 5 | ## README contains outdated information on Google Mock's compatibility with other testing frameworks ## 6 | 7 | The `README` file in release 1.1.0 still says that Google Mock only works with Google Test. Actually, you can configure Google Mock to work with any testing framework you choose. 8 | 9 | ## Tests failing on machines using Power PC CPUs (e.g. some Macs) ## 10 | 11 | `gmock_output_test` and `gmock-printers_test` are known to fail with Power PC CPUs. This is due to portability issues with these tests, and is not an indication of problems in Google Mock itself. You can safely ignore them. 12 | 13 | ## Failed to resolve libgtest.so.0 in tests when built against installed Google Test ## 14 | 15 | This only applies if you manually built and installed Google Test, and then built a Google Mock against it (either explicitly, or because gtest-config was in your path post-install). In this situation, Libtool has a known issue with certain systems' ldconfig setup: 16 | 17 | http://article.gmane.org/gmane.comp.sysutils.automake.general/9025 18 | 19 | This requires a manual run of "sudo ldconfig" after the "sudo make install" for Google Test before any binaries which link against it can be executed. This isn't a bug in our install, but we should at least have documented it or hacked a work-around into our install. We should have one of these solutions in our next release. -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/docs/v1_5/Documentation.md: -------------------------------------------------------------------------------- 1 | This page lists all documentation wiki pages for Google Mock **version 1.5.0** -- **if you use a different version of Google Mock, please read the documentation for that specific version instead.** 2 | 3 | * [ForDummies](V1_5_ForDummies.md) -- start here if you are new to Google Mock. 4 | * [CheatSheet](V1_5_CheatSheet.md) -- a quick reference. 5 | * [CookBook](V1_5_CookBook.md) -- recipes for doing various tasks using Google Mock. 6 | * [FrequentlyAskedQuestions](V1_5_FrequentlyAskedQuestions.md) -- check here before asking a question on the mailing list. 7 | 8 | To contribute code to Google Mock, read: 9 | 10 | * DevGuide -- read this _before_ writing your first patch. 11 | * [Pump Manual](http://code.google.com/p/googletest/wiki/PumpManual) -- how we generate some of Google Mock's source files. -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/docs/v1_6/Documentation.md: -------------------------------------------------------------------------------- 1 | This page lists all documentation wiki pages for Google Mock **1.6** 2 | - **if you use a released version of Google Mock, please read the documentation for that specific version instead.** 3 | 4 | * [ForDummies](V1_6_ForDummies.md) -- start here if you are new to Google Mock. 5 | * [CheatSheet](V1_6_CheatSheet.md) -- a quick reference. 6 | * [CookBook](V1_6_CookBook.md) -- recipes for doing various tasks using Google Mock. 7 | * [FrequentlyAskedQuestions](V1_6_FrequentlyAskedQuestions.md) -- check here before asking a question on the mailing list. 8 | 9 | To contribute code to Google Mock, read: 10 | 11 | * [DevGuide](DevGuide.md) -- read this _before_ writing your first patch. 12 | * [Pump Manual](http://code.google.com/p/googletest/wiki/V1_6_PumpManual) -- how we generate some of Google Mock's source files. -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/docs/v1_7/Documentation.md: -------------------------------------------------------------------------------- 1 | This page lists all documentation wiki pages for Google Mock **(the SVN trunk version)** 2 | - **if you use a released version of Google Mock, please read the documentation for that specific version instead.** 3 | 4 | * [ForDummies](V1_7_ForDummies.md) -- start here if you are new to Google Mock. 5 | * [CheatSheet](V1_7_CheatSheet.md) -- a quick reference. 6 | * [CookBook](V1_7_CookBook.md) -- recipes for doing various tasks using Google Mock. 7 | * [FrequentlyAskedQuestions](V1_7_FrequentlyAskedQuestions.md) -- check here before asking a question on the mailing list. 8 | 9 | To contribute code to Google Mock, read: 10 | 11 | * [DevGuide](DevGuide.md) -- read this _before_ writing your first patch. 12 | * [Pump Manual](http://code.google.com/p/googletest/wiki/PumpManual) -- how we generate some of Google Mock's source files. -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h: -------------------------------------------------------------------------------- 1 | // This file was GENERATED by command: 2 | // pump.py gmock-generated-actions.h.pump 3 | // DO NOT EDIT BY HAND!!! 4 | 5 | #ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_ 6 | #define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_ 7 | 8 | #endif // GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_ 9 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump: -------------------------------------------------------------------------------- 1 | $$ -*- mode: c++; -*- 2 | $$ This is a Pump source file (http://go/pump). Please use Pump to convert 3 | $$ it to callback-actions.h. 4 | $$ 5 | $var max_callback_arity = 5 6 | $$}} This meta comment fixes auto-indentation in editors. 7 | #ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_ 8 | #define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_ 9 | 10 | #endif // GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_ 11 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/include/gmock/internal/custom/gmock-matchers.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // ============================================================ 31 | // An installation-specific extension point for gmock-matchers.h. 32 | // ============================================================ 33 | // 34 | // Adds google3 callback support to CallableTraits. 35 | // 36 | #ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_CALLBACK_MATCHERS_H_ 37 | #define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_CALLBACK_MATCHERS_H_ 38 | 39 | #endif // GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_CALLBACK_MATCHERS_H_ 40 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/include/gmock/internal/custom/gmock-port.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Injection point for custom user configurations. 31 | // The following macros can be defined: 32 | // 33 | // Flag related macros: 34 | // GMOCK_DECLARE_bool_(name) 35 | // GMOCK_DECLARE_int32_(name) 36 | // GMOCK_DECLARE_string_(name) 37 | // GMOCK_DEFINE_bool_(name, default_val, doc) 38 | // GMOCK_DEFINE_int32_(name, default_val, doc) 39 | // GMOCK_DEFINE_string_(name, default_val, doc) 40 | // 41 | // ** Custom implementation starts here ** 42 | 43 | #ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_ 44 | #define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_ 45 | 46 | #endif // GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_ 47 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/msvc/2005/gmock.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 9.00 3 | # Visual Studio 2005 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmock", "gmock.vcproj", "{34681F0D-CE45-415D-B5F2-5C662DFE3BD5}" 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmock_test", "gmock_test.vcproj", "{F10D22F8-AC7B-4213-8720-608E7D878CD2}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmock_main", "gmock_main.vcproj", "{E4EF614B-30DF-4954-8C53-580A0BF6B589}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Win32 = Debug|Win32 13 | Release|Win32 = Release|Win32 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Debug|Win32.Build.0 = Debug|Win32 18 | {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Release|Win32.ActiveCfg = Release|Win32 19 | {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Release|Win32.Build.0 = Release|Win32 20 | {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Debug|Win32.ActiveCfg = Debug|Win32 21 | {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Debug|Win32.Build.0 = Debug|Win32 22 | {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Release|Win32.ActiveCfg = Release|Win32 23 | {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Release|Win32.Build.0 = Release|Win32 24 | {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Debug|Win32.ActiveCfg = Debug|Win32 25 | {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Debug|Win32.Build.0 = Debug|Win32 26 | {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Release|Win32.ActiveCfg = Release|Win32 27 | {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Release|Win32.Build.0 = Release|Win32 28 | EndGlobalSection 29 | GlobalSection(SolutionProperties) = preSolution 30 | HideSolutionNode = FALSE 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/msvc/2005/gmock_config.vsprops: -------------------------------------------------------------------------------- 1 | 2 | 7 | 11 | 15 | 16 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/msvc/2010/gmock.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual C++ Express 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmock", "gmock.vcxproj", "{34681F0D-CE45-415D-B5F2-5C662DFE3BD5}" 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmock_test", "gmock_test.vcxproj", "{F10D22F8-AC7B-4213-8720-608E7D878CD2}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmock_main", "gmock_main.vcxproj", "{E4EF614B-30DF-4954-8C53-580A0BF6B589}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Win32 = Debug|Win32 13 | Release|Win32 = Release|Win32 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Debug|Win32.Build.0 = Debug|Win32 18 | {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Release|Win32.ActiveCfg = Release|Win32 19 | {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Release|Win32.Build.0 = Release|Win32 20 | {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Debug|Win32.ActiveCfg = Debug|Win32 21 | {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Debug|Win32.Build.0 = Debug|Win32 22 | {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Release|Win32.ActiveCfg = Release|Win32 23 | {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Release|Win32.Build.0 = Release|Win32 24 | {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Debug|Win32.ActiveCfg = Debug|Win32 25 | {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Debug|Win32.Build.0 = Debug|Win32 26 | {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Release|Win32.ActiveCfg = Release|Win32 27 | {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Release|Win32.Build.0 = Release|Win32 28 | EndGlobalSection 29 | GlobalSection(SolutionProperties) = preSolution 30 | HideSolutionNode = FALSE 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/msvc/2010/gmock_config.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ../../../googletest 5 | 6 | 7 | <_ProjectFileVersion>10.0.30319.1 8 | 9 | 10 | 11 | $(GTestDir)/include;%(AdditionalIncludeDirectories) 12 | 13 | 14 | 15 | 16 | $(GTestDir) 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/msvc/2015/gmock.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmock", "gmock.vcxproj", "{34681F0D-CE45-415D-B5F2-5C662DFE3BD5}" 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmock_test", "gmock_test.vcxproj", "{F10D22F8-AC7B-4213-8720-608E7D878CD2}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmock_main", "gmock_main.vcxproj", "{E4EF614B-30DF-4954-8C53-580A0BF6B589}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Win32 = Debug|Win32 13 | Release|Win32 = Release|Win32 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Debug|Win32.Build.0 = Debug|Win32 18 | {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Release|Win32.ActiveCfg = Release|Win32 19 | {34681F0D-CE45-415D-B5F2-5C662DFE3BD5}.Release|Win32.Build.0 = Release|Win32 20 | {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Debug|Win32.ActiveCfg = Debug|Win32 21 | {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Debug|Win32.Build.0 = Debug|Win32 22 | {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Release|Win32.ActiveCfg = Release|Win32 23 | {F10D22F8-AC7B-4213-8720-608E7D878CD2}.Release|Win32.Build.0 = Release|Win32 24 | {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Debug|Win32.ActiveCfg = Debug|Win32 25 | {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Debug|Win32.Build.0 = Debug|Win32 26 | {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Release|Win32.ActiveCfg = Release|Win32 27 | {E4EF614B-30DF-4954-8C53-580A0BF6B589}.Release|Win32.Build.0 = Release|Win32 28 | EndGlobalSection 29 | GlobalSection(SolutionProperties) = preSolution 30 | HideSolutionNode = FALSE 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/msvc/2015/gmock_config.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ../../../googletest 5 | 6 | 7 | <_ProjectFileVersion>10.0.30319.1 8 | 9 | 10 | 11 | $(GTestDir)/include;%(AdditionalIncludeDirectories) 12 | 13 | 14 | 15 | 16 | $(GTestDir) 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/scripts/generator/README: -------------------------------------------------------------------------------- 1 | 2 | The Google Mock class generator is an application that is part of cppclean. 3 | For more information about cppclean, see the README.cppclean file or 4 | visit http://code.google.com/p/cppclean/ 5 | 6 | cppclean requires Python 2.3.5 or later. If you don't have Python installed 7 | on your system, you will also need to install it. You can download Python 8 | from: http://www.python.org/download/releases/ 9 | 10 | To use the Google Mock class generator, you need to call it 11 | on the command line passing the header file and class for which you want 12 | to generate a Google Mock class. 13 | 14 | Make sure to install the scripts somewhere in your path. Then you can 15 | run the program. 16 | 17 | gmock_gen.py header-file.h [ClassName]... 18 | 19 | If no ClassNames are specified, all classes in the file are emitted. 20 | 21 | To change the indentation from the default of 2, set INDENT in 22 | the environment. For example to use an indent of 4 spaces: 23 | 24 | INDENT=4 gmock_gen.py header-file.h ClassName 25 | 26 | This version was made from SVN revision 281 in the cppclean repository. 27 | 28 | Known Limitations 29 | ----------------- 30 | Not all code will be generated properly. For example, when mocking templated 31 | classes, the template information is lost. You will need to add the template 32 | information manually. 33 | 34 | Not all permutations of using multiple pointers/references will be rendered 35 | properly. These will also have to be fixed manually. 36 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/scripts/generator/cpp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texmacs/kernel/7c2de69ef7dcb3209c7f76fe9a6406d1b816fa0b/3rdparty/benchmark/googletest/googlemock/scripts/generator/cpp/__init__.py -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/scripts/generator/cpp/keywords.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2007 Neal Norwitz 4 | # Portions Copyright 2007 Google Inc. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | 18 | """C++ keywords and helper utilities for determining keywords.""" 19 | 20 | __author__ = 'nnorwitz@google.com (Neal Norwitz)' 21 | 22 | 23 | try: 24 | # Python 3.x 25 | import builtins 26 | except ImportError: 27 | # Python 2.x 28 | import __builtin__ as builtins 29 | 30 | 31 | if not hasattr(builtins, 'set'): 32 | # Nominal support for Python 2.3. 33 | from sets import Set as set 34 | 35 | 36 | TYPES = set('bool char int long short double float void wchar_t unsigned signed'.split()) 37 | TYPE_MODIFIERS = set('auto register const inline extern static virtual volatile mutable'.split()) 38 | ACCESS = set('public protected private friend'.split()) 39 | 40 | CASTS = set('static_cast const_cast dynamic_cast reinterpret_cast'.split()) 41 | 42 | OTHERS = set('true false asm class namespace using explicit this operator sizeof'.split()) 43 | OTHER_TYPES = set('new delete typedef struct union enum typeid typename template'.split()) 44 | 45 | CONTROL = set('case switch default if else return goto'.split()) 46 | EXCEPTION = set('try catch throw'.split()) 47 | LOOP = set('while do for break continue'.split()) 48 | 49 | ALL = TYPES | TYPE_MODIFIERS | ACCESS | CASTS | OTHERS | OTHER_TYPES | CONTROL | EXCEPTION | LOOP 50 | 51 | 52 | def IsKeyword(token): 53 | return token in ALL 54 | 55 | def IsBuiltinType(token): 56 | if token in ('virtual', 'inline'): 57 | # These only apply to methods, they can't be types by themselves. 58 | return False 59 | return token in TYPES or token in TYPE_MODIFIERS 60 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/scripts/generator/cpp/utils.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2007 Neal Norwitz 4 | # Portions Copyright 2007 Google Inc. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | 18 | """Generic utilities for C++ parsing.""" 19 | 20 | __author__ = 'nnorwitz@google.com (Neal Norwitz)' 21 | 22 | 23 | import sys 24 | 25 | 26 | # Set to True to see the start/end token indices. 27 | DEBUG = True 28 | 29 | 30 | def ReadFile(filename, print_error=True): 31 | """Returns the contents of a file.""" 32 | try: 33 | fp = open(filename) 34 | try: 35 | return fp.read() 36 | finally: 37 | fp.close() 38 | except IOError: 39 | if print_error: 40 | print('Error reading %s: %s' % (filename, sys.exc_info()[1])) 41 | return None 42 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/scripts/generator/gmock_gen.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2008 Google Inc. All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | """Driver for starting up Google Mock class generator.""" 18 | 19 | __author__ = 'nnorwitz@google.com (Neal Norwitz)' 20 | 21 | import os 22 | import sys 23 | 24 | if __name__ == '__main__': 25 | # Add the directory of this script to the path so we can import gmock_class. 26 | sys.path.append(os.path.dirname(__file__)) 27 | 28 | from cpp import gmock_class 29 | # Fix the docstring in case they require the usage. 30 | gmock_class.__doc__ = gmock_class.__doc__.replace('gmock_class.py', __file__) 31 | gmock_class.main() 32 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/src/gmock-all.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | // 32 | // Google C++ Mocking Framework (Google Mock) 33 | // 34 | // This file #includes all Google Mock implementation .cc files. The 35 | // purpose is to allow a user to build Google Mock by compiling this 36 | // file alone. 37 | 38 | // This line ensures that gmock.h can be compiled on its own, even 39 | // when it's fused. 40 | #include "gmock/gmock.h" 41 | 42 | // The following lines pull in the real gmock *.cc files. 43 | #include "src/gmock-cardinalities.cc" 44 | #include "src/gmock-internal-utils.cc" 45 | #include "src/gmock-matchers.cc" 46 | #include "src/gmock-spec-builders.cc" 47 | #include "src/gmock.cc" 48 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/test/gmock-port_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: vladl@google.com (Vlad Losev) 31 | 32 | // Google Mock - a framework for writing C++ mock classes. 33 | // 34 | // This file tests the internal cross-platform support utilities. 35 | 36 | #include "gmock/internal/gmock-port.h" 37 | #include "gtest/gtest.h" 38 | 39 | // NOTE: if this file is left without tests for some reason, put a dummy 40 | // test here to make references to symbols in the gtest library and avoid 41 | // 'undefined symbol' linker errors in gmock_main: 42 | 43 | TEST(DummyTest, Dummy) {} 44 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/test/gmock_link2_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan), vladl@google.com (Vlad Losev) 31 | 32 | // Google Mock - a framework for writing C++ mock classes. 33 | // 34 | // This file is for verifying that various Google Mock constructs do not 35 | // produce linker errors when instantiated in different translation units. 36 | // Please see gmock_link_test.h for details. 37 | 38 | #define LinkTest LinkTest2 39 | 40 | #include "test/gmock_link_test.h" 41 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googlemock/test/gmock_link_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan), vladl@google.com (Vlad Losev) 31 | 32 | // Google Mock - a framework for writing C++ mock classes. 33 | // 34 | // This file is for verifying that various Google Mock constructs do not 35 | // produce linker errors when instantiated in different translation units. 36 | // Please see gmock_link_test.h for details. 37 | 38 | #define LinkTest LinkTest1 39 | 40 | #include "test/gmock_link_test.h" 41 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/.gitignore: -------------------------------------------------------------------------------- 1 | # python 2 | *.pyc 3 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This file contains a list of people who've made non-trivial 2 | # contribution to the Google C++ Testing Framework project. People 3 | # who commit code to the project are encouraged to add their names 4 | # here. Please keep the list sorted by first names. 5 | 6 | Ajay Joshi 7 | Balázs Dán 8 | Bharat Mediratta 9 | Chandler Carruth 10 | Chris Prince 11 | Chris Taylor 12 | Dan Egnor 13 | Eric Roman 14 | Hady Zalek 15 | Jeffrey Yasskin 16 | Jói Sigurðsson 17 | Keir Mierle 18 | Keith Ray 19 | Kenton Varda 20 | Manuel Klimek 21 | Markus Heule 22 | Mika Raento 23 | Miklós Fazekas 24 | Pasi Valminen 25 | Patrick Hanna 26 | Patrick Riley 27 | Peter Kaminski 28 | Preston Jackson 29 | Rainer Klaffenboeck 30 | Russ Cox 31 | Russ Rufer 32 | Sean Mcafee 33 | Sigurður Ásgeirsson 34 | Tracy Bialik 35 | Vadim Berman 36 | Vlad Losev 37 | Zhanyong Wan 38 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2008, Google Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/build-aux/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texmacs/kernel/7c2de69ef7dcb3209c7f76fe9a6406d1b816fa0b/3rdparty/benchmark/googletest/googletest/build-aux/.keep -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/codegear/gtest.groupproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {c1d923e0-6cba-4332-9b6f-3420acbf5091} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Default.Personality 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/codegear/gtest_all.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2009, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: Josh Kelley (joshkel@gmail.com) 31 | // 32 | // Google C++ Testing Framework (Google Test) 33 | // 34 | // C++Builder's IDE cannot build a static library from files with hyphens 35 | // in their name. See http://qc.codegear.com/wc/qcmain.aspx?d=70977 . 36 | // This file serves as a workaround. 37 | 38 | #include "src/gtest-all.cc" 39 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/codegear/gtest_link.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2009, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: Josh Kelley (joshkel@gmail.com) 31 | // 32 | // Google C++ Testing Framework (Google Test) 33 | // 34 | // Links gtest.lib and gtest_main.lib into the current project in C++Builder. 35 | // This means that these libraries can't be renamed, but it's the only way to 36 | // ensure that Debug versus Release test builds are linked against the 37 | // appropriate Debug or Release build of the libraries. 38 | 39 | #pragma link "gtest.lib" 40 | #pragma link "gtest_main.lib" 41 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/docs/Documentation.md: -------------------------------------------------------------------------------- 1 | This page lists all documentation wiki pages for Google Test **(the SVN trunk version)** 2 | -- **if you use a released version of Google Test, please read the 3 | documentation for that specific version instead.** 4 | 5 | * [Primer](Primer.md) -- start here if you are new to Google Test. 6 | * [Samples](Samples.md) -- learn from examples. 7 | * [AdvancedGuide](AdvancedGuide.md) -- learn more about Google Test. 8 | * [XcodeGuide](XcodeGuide.md) -- how to use Google Test in Xcode on Mac. 9 | * [Frequently-Asked Questions](FAQ.md) -- check here before asking a question on the mailing list. 10 | 11 | To contribute code to Google Test, read: 12 | 13 | * [DevGuide](DevGuide.md) -- read this _before_ writing your first patch. 14 | * [PumpManual](PumpManual.md) -- how we generate some of Google Test's source files. -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/docs/Samples.md: -------------------------------------------------------------------------------- 1 | If you're like us, you'd like to look at some Google Test sample code. The 2 | [samples folder](../samples) has a number of well-commented samples showing how to use a 3 | variety of Google Test features. 4 | 5 | * [Sample #1](../samples/sample1_unittest.cc) shows the basic steps of using Google Test to test C++ functions. 6 | * [Sample #2](../samples/sample2_unittest.cc) shows a more complex unit test for a class with multiple member functions. 7 | * [Sample #3](../samples/sample3_unittest.cc) uses a test fixture. 8 | * [Sample #4](../samples/sample4_unittest.cc) is another basic example of using Google Test. 9 | * [Sample #5](../samples/sample5_unittest.cc) teaches how to reuse a test fixture in multiple test cases by deriving sub-fixtures from it. 10 | * [Sample #6](../samples/sample6_unittest.cc) demonstrates type-parameterized tests. 11 | * [Sample #7](../samples/sample7_unittest.cc) teaches the basics of value-parameterized tests. 12 | * [Sample #8](../samples/sample8_unittest.cc) shows using `Combine()` in value-parameterized tests. 13 | * [Sample #9](../samples/sample9_unittest.cc) shows use of the listener API to modify Google Test's console output and the use of its reflection API to inspect test results. 14 | * [Sample #10](../samples/sample10_unittest.cc) shows use of the listener API to implement a primitive memory leak checker. 15 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/docs/V1_5_Documentation.md: -------------------------------------------------------------------------------- 1 | This page lists all official documentation wiki pages for Google Test **1.5.0** -- **if you use a different version of Google Test, make sure to read the documentation for that version instead.** 2 | 3 | * [Primer](V1_5_Primer.md) -- start here if you are new to Google Test. 4 | * [Samples](Samples.md) -- learn from examples. 5 | * [AdvancedGuide](V1_5_AdvancedGuide.md) -- learn more about Google Test. 6 | * [XcodeGuide](V1_5_XcodeGuide.md) -- how to use Google Test in Xcode on Mac. 7 | * [Frequently-Asked Questions](V1_5_FAQ.md) -- check here before asking a question on the mailing list. 8 | 9 | To contribute code to Google Test, read: 10 | 11 | * DevGuide -- read this _before_ writing your first patch. 12 | * [PumpManual](V1_5_PumpManual.md) -- how we generate some of Google Test's source files. -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/docs/V1_6_Documentation.md: -------------------------------------------------------------------------------- 1 | This page lists all documentation wiki pages for Google Test **1.6** 2 | -- **if you use a released version of Google Test, please read the 3 | documentation for that specific version instead.** 4 | 5 | * [Primer](V1_6_Primer.md) -- start here if you are new to Google Test. 6 | * [Samples](V1_6_Samples.md) -- learn from examples. 7 | * [AdvancedGuide](V1_6_AdvancedGuide.md) -- learn more about Google Test. 8 | * [XcodeGuide](V1_6_XcodeGuide.md) -- how to use Google Test in Xcode on Mac. 9 | * [Frequently-Asked Questions](V1_6_FAQ.md) -- check here before asking a question on the mailing list. 10 | 11 | To contribute code to Google Test, read: 12 | 13 | * [DevGuide](DevGuide.md) -- read this _before_ writing your first patch. 14 | * [PumpManual](V1_6_PumpManual.md) -- how we generate some of Google Test's source files. -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/docs/V1_6_Samples.md: -------------------------------------------------------------------------------- 1 | If you're like us, you'd like to look at some Google Test sample code. The 2 | [samples folder](../samples) has a number of well-commented samples showing how to use a 3 | variety of Google Test features. 4 | 5 | * [Sample #1](../samples/sample1_unittest.cc) shows the basic steps of using Google Test to test C++ functions. 6 | * [Sample #2](../samples/sample2_unittest.cc) shows a more complex unit test for a class with multiple member functions. 7 | * [Sample #3](../samples/sample3_unittest.cc) uses a test fixture. 8 | * [Sample #4](../samples/sample4_unittest.cc) is another basic example of using Google Test. 9 | * [Sample #5](../samples/sample5_unittest.cc) teaches how to reuse a test fixture in multiple test cases by deriving sub-fixtures from it. 10 | * [Sample #6](../samples/sample6_unittest.cc) demonstrates type-parameterized tests. 11 | * [Sample #7](../samples/sample7_unittest.cc) teaches the basics of value-parameterized tests. 12 | * [Sample #8](../samples/sample8_unittest.cc) shows using `Combine()` in value-parameterized tests. 13 | * [Sample #9](../samples/sample9_unittest.cc) shows use of the listener API to modify Google Test's console output and the use of its reflection API to inspect test results. 14 | * [Sample #10](../samples/sample10_unittest.cc) shows use of the listener API to implement a primitive memory leak checker. 15 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/docs/V1_7_Documentation.md: -------------------------------------------------------------------------------- 1 | This page lists all documentation wiki pages for Google Test **(the SVN trunk version)** 2 | -- **if you use a released version of Google Test, please read the 3 | documentation for that specific version instead.** 4 | 5 | * [Primer](V1_7_Primer.md) -- start here if you are new to Google Test. 6 | * [Samples](V1_7_Samples.md) -- learn from examples. 7 | * [AdvancedGuide](V1_7_AdvancedGuide.md) -- learn more about Google Test. 8 | * [XcodeGuide](V1_7_XcodeGuide.md) -- how to use Google Test in Xcode on Mac. 9 | * [Frequently-Asked Questions](V1_7_FAQ.md) -- check here before asking a question on the mailing list. 10 | 11 | To contribute code to Google Test, read: 12 | 13 | * [DevGuide](DevGuide.md) -- read this _before_ writing your first patch. 14 | * [PumpManual](V1_7_PumpManual.md) -- how we generate some of Google Test's source files. -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/docs/V1_7_Samples.md: -------------------------------------------------------------------------------- 1 | If you're like us, you'd like to look at some Google Test sample code. The 2 | [samples folder](../samples) has a number of well-commented samples showing how to use a 3 | variety of Google Test features. 4 | 5 | * [Sample #1](../samples/sample1_unittest.cc) shows the basic steps of using Google Test to test C++ functions. 6 | * [Sample #2](../samples/sample2_unittest.cc) shows a more complex unit test for a class with multiple member functions. 7 | * [Sample #3](../samples/sample3_unittest.cc) uses a test fixture. 8 | * [Sample #4](../samples/sample4_unittest.cc) is another basic example of using Google Test. 9 | * [Sample #5](../samples/sample5_unittest.cc) teaches how to reuse a test fixture in multiple test cases by deriving sub-fixtures from it. 10 | * [Sample #6](../samples/sample6_unittest.cc) demonstrates type-parameterized tests. 11 | * [Sample #7](../samples/sample7_unittest.cc) teaches the basics of value-parameterized tests. 12 | * [Sample #8](../samples/sample8_unittest.cc) shows using `Combine()` in value-parameterized tests. 13 | * [Sample #9](../samples/sample9_unittest.cc) shows use of the listener API to modify Google Test's console output and the use of its reflection API to inspect test results. 14 | * [Sample #10](../samples/sample10_unittest.cc) shows use of the listener API to implement a primitive memory leak checker. 15 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/include/gtest/gtest_prod.h: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | // 32 | // Google C++ Testing Framework definitions useful in production code. 33 | 34 | #ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_ 35 | #define GTEST_INCLUDE_GTEST_GTEST_PROD_H_ 36 | 37 | // When you need to test the private or protected members of a class, 38 | // use the FRIEND_TEST macro to declare your tests as friends of the 39 | // class. For example: 40 | // 41 | // class MyClass { 42 | // private: 43 | // void MyMethod(); 44 | // FRIEND_TEST(MyClassTest, MyMethod); 45 | // }; 46 | // 47 | // class MyClassTest : public testing::Test { 48 | // // ... 49 | // }; 50 | // 51 | // TEST_F(MyClassTest, MyMethod) { 52 | // // Can call MyClass::MyMethod() here. 53 | // } 54 | 55 | #define FRIEND_TEST(test_case_name, test_name)\ 56 | friend class test_case_name##_##test_name##_Test 57 | 58 | #endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_ 59 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/include/gtest/internal/custom/gtest-printers.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // This file provides an injection point for custom printers in a local 31 | // installation of gTest. 32 | // It will be included from gtest-printers.h and the overrides in this file 33 | // will be visible to everyone. 34 | // See documentation at gtest/gtest-printers.h for details on how to define a 35 | // custom printer. 36 | // 37 | // ** Custom implementation starts here ** 38 | 39 | #ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_ 40 | #define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_ 41 | 42 | #endif // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_ 43 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/include/gtest/internal/custom/gtest.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Injection point for custom user configurations. 31 | // The following macros can be defined: 32 | // 33 | // GTEST_OS_STACK_TRACE_GETTER_ - The name of an implementation of 34 | // OsStackTraceGetterInterface. 35 | // 36 | // ** Custom implementation starts here ** 37 | 38 | #ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_ 39 | #define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_ 40 | 41 | #endif // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_ 42 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/samples/sample1.h: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // A sample program demonstrating using Google C++ testing framework. 31 | // 32 | // Author: wan@google.com (Zhanyong Wan) 33 | 34 | #ifndef GTEST_SAMPLES_SAMPLE1_H_ 35 | #define GTEST_SAMPLES_SAMPLE1_H_ 36 | 37 | // Returns n! (the factorial of n). For negative n, n! is defined to be 1. 38 | int Factorial(int n); 39 | 40 | // Returns true iff n is a prime number. 41 | bool IsPrime(int n); 42 | 43 | #endif // GTEST_SAMPLES_SAMPLE1_H_ 44 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/samples/sample2.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // A sample program demonstrating using Google C++ testing framework. 31 | // 32 | // Author: wan@google.com (Zhanyong Wan) 33 | 34 | #include "sample2.h" 35 | 36 | #include 37 | 38 | // Clones a 0-terminated C string, allocating memory using new. 39 | const char* MyString::CloneCString(const char* a_c_string) { 40 | if (a_c_string == NULL) return NULL; 41 | 42 | const size_t len = strlen(a_c_string); 43 | char* const clone = new char[ len + 1 ]; 44 | memcpy(clone, a_c_string, len + 1); 45 | 46 | return clone; 47 | } 48 | 49 | // Sets the 0-terminated C string this MyString object 50 | // represents. 51 | void MyString::Set(const char* a_c_string) { 52 | // Makes sure this works when c_string == c_string_ 53 | const char* const temp = MyString::CloneCString(a_c_string); 54 | delete[] c_string_; 55 | c_string_ = temp; 56 | } 57 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/samples/sample4.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // A sample program demonstrating using Google C++ testing framework. 31 | // 32 | // Author: wan@google.com (Zhanyong Wan) 33 | 34 | #include 35 | 36 | #include "sample4.h" 37 | 38 | // Returns the current counter value, and increments it. 39 | int Counter::Increment() { 40 | return counter_++; 41 | } 42 | 43 | // Prints the current counter value to STDOUT. 44 | void Counter::Print() const { 45 | printf("%d", counter_); 46 | } 47 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/samples/sample4.h: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // A sample program demonstrating using Google C++ testing framework. 31 | // 32 | // Author: wan@google.com (Zhanyong Wan) 33 | 34 | #ifndef GTEST_SAMPLES_SAMPLE4_H_ 35 | #define GTEST_SAMPLES_SAMPLE4_H_ 36 | 37 | // A simple monotonic counter. 38 | class Counter { 39 | private: 40 | int counter_; 41 | 42 | public: 43 | // Creates a counter that starts at 0. 44 | Counter() : counter_(0) {} 45 | 46 | // Returns the current counter value, and increments it. 47 | int Increment(); 48 | 49 | // Prints the current counter value to STDOUT. 50 | void Print() const; 51 | }; 52 | 53 | #endif // GTEST_SAMPLES_SAMPLE4_H_ 54 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/samples/sample4_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | 32 | #include "gtest/gtest.h" 33 | #include "sample4.h" 34 | 35 | // Tests the Increment() method. 36 | TEST(Counter, Increment) { 37 | Counter c; 38 | 39 | // EXPECT_EQ() evaluates its arguments exactly once, so they 40 | // can have side effects. 41 | 42 | EXPECT_EQ(0, c.Increment()); 43 | EXPECT_EQ(1, c.Increment()); 44 | EXPECT_EQ(2, c.Increment()); 45 | } 46 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/src/gtest-all.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: mheule@google.com (Markus Heule) 31 | // 32 | // Google C++ Testing Framework (Google Test) 33 | // 34 | // Sometimes it's desirable to build Google Test by compiling a single file. 35 | // This file serves this purpose. 36 | 37 | // This line ensures that gtest.h can be compiled on its own, even 38 | // when it's fused. 39 | #include "gtest/gtest.h" 40 | 41 | // The following lines pull in the real gtest *.cc files. 42 | #include "src/gtest.cc" 43 | #include "src/gtest-death-test.cc" 44 | #include "src/gtest-filepath.cc" 45 | #include "src/gtest-port.cc" 46 | #include "src/gtest-printers.cc" 47 | #include "src/gtest-test-part.cc" 48 | #include "src/gtest-typed-test.cc" 49 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/src/gtest_main.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include 31 | 32 | #include "gtest/gtest.h" 33 | 34 | GTEST_API_ int main(int argc, char **argv) { 35 | printf("Running main() from gtest_main.cc\n"); 36 | testing::InitGoogleTest(&argc, argv); 37 | return RUN_ALL_TESTS(); 38 | } 39 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/test/gtest-param-test_test.h: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Authors: vladl@google.com (Vlad Losev) 31 | // 32 | // The Google C++ Testing Framework (Google Test) 33 | // 34 | // This header file provides classes and functions used internally 35 | // for testing Google Test itself. 36 | 37 | #ifndef GTEST_TEST_GTEST_PARAM_TEST_TEST_H_ 38 | #define GTEST_TEST_GTEST_PARAM_TEST_TEST_H_ 39 | 40 | #include "gtest/gtest.h" 41 | 42 | #if GTEST_HAS_PARAM_TEST 43 | 44 | // Test fixture for testing definition and instantiation of a test 45 | // in separate translation units. 46 | class ExternalInstantiationTest : public ::testing::TestWithParam { 47 | }; 48 | 49 | // Test fixture for testing instantiation of a test in multiple 50 | // translation units. 51 | class InstantiationInMultipleTranslaionUnitsTest 52 | : public ::testing::TestWithParam { 53 | }; 54 | 55 | #endif // GTEST_HAS_PARAM_TEST 56 | 57 | #endif // GTEST_TEST_GTEST_PARAM_TEST_TEST_H_ 58 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/test/gtest-typed-test2_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008 Google Inc. 2 | // All Rights Reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | 32 | #include 33 | 34 | #include "test/gtest-typed-test_test.h" 35 | #include "gtest/gtest.h" 36 | 37 | #if GTEST_HAS_TYPED_TEST_P 38 | 39 | // Tests that the same type-parameterized test case can be 40 | // instantiated in different translation units linked together. 41 | // (ContainerTest is also instantiated in gtest-typed-test_test.cc.) 42 | INSTANTIATE_TYPED_TEST_CASE_P(Vector, ContainerTest, 43 | testing::Types >); 44 | 45 | #endif // GTEST_HAS_TYPED_TEST_P 46 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/test/gtest_all_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2009, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | // 32 | // Tests for Google C++ Testing Framework (Google Test) 33 | // 34 | // Sometimes it's desirable to build most of Google Test's own tests 35 | // by compiling a single file. This file serves this purpose. 36 | #include "test/gtest-filepath_test.cc" 37 | #include "test/gtest-linked_ptr_test.cc" 38 | #include "test/gtest-message_test.cc" 39 | #include "test/gtest-options_test.cc" 40 | #include "test/gtest-port_test.cc" 41 | #include "test/gtest_pred_impl_unittest.cc" 42 | #include "test/gtest_prod_test.cc" 43 | #include "test/gtest-test-part_test.cc" 44 | #include "test/gtest-typed-test_test.cc" 45 | #include "test/gtest-typed-test2_test.cc" 46 | #include "test/gtest_unittest.cc" 47 | #include "test/production.cc" 48 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/test/gtest_help_test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2009, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | 32 | // This program is meant to be run by gtest_help_test.py. Do not run 33 | // it directly. 34 | 35 | #include "gtest/gtest.h" 36 | 37 | // When a help flag is specified, this program should skip the tests 38 | // and exit with 0; otherwise the following test will be executed, 39 | // causing this program to exit with a non-zero code. 40 | TEST(HelpFlagTest, ShouldNotBeRun) { 41 | ASSERT_TRUE(false) << "Tests shouldn't be run when --help is specified."; 42 | } 43 | 44 | #if GTEST_HAS_DEATH_TEST 45 | TEST(DeathTest, UsedByPythonScriptToDetectSupportForDeathTestsInThisBinary) {} 46 | #endif 47 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/test/gtest_main_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | 32 | #include "gtest/gtest.h" 33 | 34 | // Tests that we don't have to define main() when we link to 35 | // gtest_main instead of gtest. 36 | 37 | namespace { 38 | 39 | TEST(GTestMainTest, ShouldSucceed) { 40 | } 41 | 42 | } // namespace 43 | 44 | // We are using the main() function defined in src/gtest_main.cc, so 45 | // we don't define it here. 46 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/test/gtest_prod_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | // 32 | // Unit test for include/gtest/gtest_prod.h. 33 | 34 | #include "gtest/gtest.h" 35 | #include "test/production.h" 36 | 37 | // Tests that private members can be accessed from a TEST declared as 38 | // a friend of the class. 39 | TEST(PrivateCodeTest, CanAccessPrivateMembers) { 40 | PrivateCode a; 41 | EXPECT_EQ(0, a.x_); 42 | 43 | a.set_x(1); 44 | EXPECT_EQ(1, a.x_); 45 | } 46 | 47 | typedef testing::Test PrivateCodeFixtureTest; 48 | 49 | // Tests that private members can be accessed from a TEST_F declared 50 | // as a friend of the class. 51 | TEST_F(PrivateCodeFixtureTest, CanAccessPrivateMembers) { 52 | PrivateCode a; 53 | EXPECT_EQ(0, a.x_); 54 | 55 | a.set_x(2); 56 | EXPECT_EQ(2, a.x_); 57 | } 58 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/test/gtest_sole_header_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: mheule@google.com (Markus Heule) 31 | // 32 | // This test verifies that it's possible to use Google Test by including 33 | // the gtest.h header file alone. 34 | 35 | #include "gtest/gtest.h" 36 | 37 | namespace { 38 | 39 | void Subroutine() { 40 | EXPECT_EQ(42, 42); 41 | } 42 | 43 | TEST(NoFatalFailureTest, ExpectNoFatalFailure) { 44 | EXPECT_NO_FATAL_FAILURE(;); 45 | EXPECT_NO_FATAL_FAILURE(SUCCEED()); 46 | EXPECT_NO_FATAL_FAILURE(Subroutine()); 47 | EXPECT_NO_FATAL_FAILURE({ SUCCEED(); }); 48 | } 49 | 50 | TEST(NoFatalFailureTest, AssertNoFatalFailure) { 51 | ASSERT_NO_FATAL_FAILURE(;); 52 | ASSERT_NO_FATAL_FAILURE(SUCCEED()); 53 | ASSERT_NO_FATAL_FAILURE(Subroutine()); 54 | ASSERT_NO_FATAL_FAILURE({ SUCCEED(); }); 55 | } 56 | 57 | } // namespace 58 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/test/gtest_uninitialized_test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | 32 | #include "gtest/gtest.h" 33 | 34 | TEST(DummyTest, Dummy) { 35 | // This test doesn't verify anything. We just need it to create a 36 | // realistic stage for testing the behavior of Google Test when 37 | // RUN_ALL_TESTS() is called without testing::InitGoogleTest() being 38 | // called first. 39 | } 40 | 41 | int main() { 42 | return RUN_ALL_TESTS(); 43 | } 44 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/test/gtest_xml_outfile1_test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: keith.ray@gmail.com (Keith Ray) 31 | // 32 | // gtest_xml_outfile1_test_ writes some xml via TestProperty used by 33 | // gtest_xml_outfiles_test.py 34 | 35 | #include "gtest/gtest.h" 36 | 37 | class PropertyOne : public testing::Test { 38 | protected: 39 | virtual void SetUp() { 40 | RecordProperty("SetUpProp", 1); 41 | } 42 | virtual void TearDown() { 43 | RecordProperty("TearDownProp", 1); 44 | } 45 | }; 46 | 47 | TEST_F(PropertyOne, TestSomeProperties) { 48 | RecordProperty("TestSomeProperty", 1); 49 | } 50 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/test/gtest_xml_outfile2_test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: keith.ray@gmail.com (Keith Ray) 31 | // 32 | // gtest_xml_outfile2_test_ writes some xml via TestProperty used by 33 | // gtest_xml_outfiles_test.py 34 | 35 | #include "gtest/gtest.h" 36 | 37 | class PropertyTwo : public testing::Test { 38 | protected: 39 | virtual void SetUp() { 40 | RecordProperty("SetUpProp", 2); 41 | } 42 | virtual void TearDown() { 43 | RecordProperty("TearDownProp", 2); 44 | } 45 | }; 46 | 47 | TEST_F(PropertyTwo, TestSomeProperties) { 48 | RecordProperty("TestSomeProperty", 2); 49 | } 50 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/test/production.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | // 32 | // This is part of the unit test for include/gtest/gtest_prod.h. 33 | 34 | #include "production.h" 35 | 36 | PrivateCode::PrivateCode() : x_(0) {} 37 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/test/production.h: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | // 32 | // This is part of the unit test for include/gtest/gtest_prod.h. 33 | 34 | #ifndef GTEST_TEST_PRODUCTION_H_ 35 | #define GTEST_TEST_PRODUCTION_H_ 36 | 37 | #include "gtest/gtest_prod.h" 38 | 39 | class PrivateCode { 40 | public: 41 | // Declares a friend test that does not use a fixture. 42 | FRIEND_TEST(PrivateCodeTest, CanAccessPrivateMembers); 43 | 44 | // Declares a friend test that uses a fixture. 45 | FRIEND_TEST(PrivateCodeFixtureTest, CanAccessPrivateMembers); 46 | 47 | PrivateCode(); 48 | 49 | int x() const { return x_; } 50 | private: 51 | void set_x(int an_x) { x_ = an_x; } 52 | int x_; 53 | }; 54 | 55 | #endif // GTEST_TEST_PRODUCTION_H_ 56 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/xcode/Config/DebugProject.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // DebugProject.xcconfig 3 | // 4 | // These are Debug Configuration project settings for the gtest framework and 5 | // examples. It is set in the "Based On:" dropdown in the "Project" info 6 | // dialog. 7 | // This file is based on the Xcode Configuration files in: 8 | // http://code.google.com/p/google-toolbox-for-mac/ 9 | // 10 | 11 | #include "General.xcconfig" 12 | 13 | // No optimization 14 | GCC_OPTIMIZATION_LEVEL = 0 15 | 16 | // Deployment postprocessing is what triggers Xcode to strip, turn it off 17 | DEPLOYMENT_POSTPROCESSING = NO 18 | 19 | // Dead code stripping off 20 | DEAD_CODE_STRIPPING = NO 21 | 22 | // Debug symbols should be on obviously 23 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES 24 | 25 | // Define the DEBUG macro in all debug builds 26 | OTHER_CFLAGS = $(OTHER_CFLAGS) -DDEBUG=1 27 | 28 | // These are turned off to avoid STL incompatibilities with client code 29 | // // Turns on special C++ STL checks to "encourage" good STL use 30 | // GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS) _GLIBCXX_DEBUG_PEDANTIC _GLIBCXX_DEBUG _GLIBCPP_CONCEPT_CHECKS 31 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/xcode/Config/FrameworkTarget.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // FrameworkTarget.xcconfig 3 | // 4 | // These are Framework target settings for the gtest framework and examples. It 5 | // is set in the "Based On:" dropdown in the "Target" info dialog. 6 | // This file is based on the Xcode Configuration files in: 7 | // http://code.google.com/p/google-toolbox-for-mac/ 8 | // 9 | 10 | // Dynamic libs need to be position independent 11 | GCC_DYNAMIC_NO_PIC = NO 12 | 13 | // Dynamic libs should not have their external symbols stripped. 14 | STRIP_STYLE = non-global 15 | 16 | // Let the user install by specifying the $DSTROOT with xcodebuild 17 | SKIP_INSTALL = NO 18 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/xcode/Config/General.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // General.xcconfig 3 | // 4 | // These are General configuration settings for the gtest framework and 5 | // examples. 6 | // This file is based on the Xcode Configuration files in: 7 | // http://code.google.com/p/google-toolbox-for-mac/ 8 | // 9 | 10 | // Build for PPC and Intel, 32- and 64-bit 11 | ARCHS = i386 x86_64 ppc ppc64 12 | 13 | // Zerolink prevents link warnings so turn it off 14 | ZERO_LINK = NO 15 | 16 | // Prebinding considered unhelpful in 10.3 and later 17 | PREBINDING = NO 18 | 19 | // Strictest warning policy 20 | WARNING_CFLAGS = -Wall -Werror -Wendif-labels -Wnewline-eof -Wno-sign-compare -Wshadow 21 | 22 | // Work around Xcode bugs by using external strip. See: 23 | // http://lists.apple.com/archives/Xcode-users/2006/Feb/msg00050.html 24 | SEPARATE_STRIP = YES 25 | 26 | // Force C99 dialect 27 | GCC_C_LANGUAGE_STANDARD = c99 28 | 29 | // not sure why apple defaults this on, but it's pretty risky 30 | ALWAYS_SEARCH_USER_PATHS = NO 31 | 32 | // Turn on position dependent code for most cases (overridden where appropriate) 33 | GCC_DYNAMIC_NO_PIC = YES 34 | 35 | // Default SDK and minimum OS version is 10.4 36 | SDKROOT = $(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk 37 | MACOSX_DEPLOYMENT_TARGET = 10.4 38 | GCC_VERSION = 4.0 39 | 40 | // VERSIONING BUILD SETTINGS (used in Info.plist) 41 | GTEST_VERSIONINFO_ABOUT = © 2008 Google Inc. 42 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/xcode/Config/ReleaseProject.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // ReleaseProject.xcconfig 3 | // 4 | // These are Release Configuration project settings for the gtest framework 5 | // and examples. It is set in the "Based On:" dropdown in the "Project" info 6 | // dialog. 7 | // This file is based on the Xcode Configuration files in: 8 | // http://code.google.com/p/google-toolbox-for-mac/ 9 | // 10 | 11 | #include "General.xcconfig" 12 | 13 | // subconfig/Release.xcconfig 14 | 15 | // Optimize for space and size (Apple recommendation) 16 | GCC_OPTIMIZATION_LEVEL = s 17 | 18 | // Deploment postprocessing is what triggers Xcode to strip 19 | DEPLOYMENT_POSTPROCESSING = YES 20 | 21 | // No symbols 22 | GCC_GENERATE_DEBUGGING_SYMBOLS = NO 23 | 24 | // Dead code strip does not affect ObjC code but can help for C 25 | DEAD_CODE_STRIPPING = YES 26 | 27 | // NDEBUG is used by things like assert.h, so define it for general compat. 28 | // ASSERT going away in release tends to create unused vars. 29 | OTHER_CFLAGS = $(OTHER_CFLAGS) -DNDEBUG=1 -Wno-unused-variable 30 | 31 | // When we strip we want to strip all symbols in release, but save externals. 32 | STRIP_STYLE = all 33 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/xcode/Config/StaticLibraryTarget.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // StaticLibraryTarget.xcconfig 3 | // 4 | // These are static library target settings for libgtest.a. It 5 | // is set in the "Based On:" dropdown in the "Target" info dialog. 6 | // This file is based on the Xcode Configuration files in: 7 | // http://code.google.com/p/google-toolbox-for-mac/ 8 | // 9 | 10 | // Static libs can be included in bundles so make them position independent 11 | GCC_DYNAMIC_NO_PIC = NO 12 | 13 | // Static libs should not have their internal globals or external symbols 14 | // stripped. 15 | STRIP_STYLE = debugging 16 | 17 | // Let the user install by specifying the $DSTROOT with xcodebuild 18 | SKIP_INSTALL = NO 19 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/xcode/Config/TestTarget.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // TestTarget.xcconfig 3 | // 4 | // These are Test target settings for the gtest framework and examples. It 5 | // is set in the "Based On:" dropdown in the "Target" info dialog. 6 | 7 | PRODUCT_NAME = $(TARGET_NAME) 8 | HEADER_SEARCH_PATHS = ../include 9 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/xcode/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.google.${PRODUCT_NAME} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | GTEST_VERSIONINFO_LONG 21 | CFBundleShortVersionString 22 | GTEST_VERSIONINFO_SHORT 23 | CFBundleGetInfoString 24 | ${PRODUCT_NAME} GTEST_VERSIONINFO_LONG, ${GTEST_VERSIONINFO_ABOUT} 25 | NSHumanReadableCopyright 26 | ${GTEST_VERSIONINFO_ABOUT} 27 | CSResourcesFileMapped 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/xcode/Samples/FrameworkSample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.google.gtest.${PRODUCT_NAME:identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | CSResourcesFileMapped 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/googletest/xcode/Samples/FrameworkSample/widget.h: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: preston.a.jackson@gmail.com (Preston Jackson) 31 | // 32 | // Google Test - FrameworkSample 33 | // widget.h 34 | // 35 | 36 | // Widget is a very simple class used for demonstrating the use of gtest. It 37 | // simply stores two values a string and an integer, which are returned via 38 | // public accessors in multiple forms. 39 | 40 | #import 41 | 42 | class Widget { 43 | public: 44 | Widget(int number, const std::string& name); 45 | ~Widget(); 46 | 47 | // Public accessors to number data 48 | float GetFloatValue() const; 49 | int GetIntValue() const; 50 | 51 | // Public accessors to the string data 52 | std::string GetStringValue() const; 53 | void GetCharPtrValue(char* buffer, size_t max_size) const; 54 | 55 | private: 56 | // Data members 57 | float number_; 58 | std::string name_; 59 | }; 60 | -------------------------------------------------------------------------------- /3rdparty/benchmark/googletest/travis.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | set -evx 3 | env | sort 4 | 5 | mkdir build || true 6 | mkdir build/$GTEST_TARGET || true 7 | cd build/$GTEST_TARGET 8 | cmake -Dgtest_build_samples=ON \ 9 | -Dgmock_build_samples=ON \ 10 | -Dgtest_build_tests=ON \ 11 | -Dgmock_build_tests=ON \ 12 | -DCMAKE_CXX_FLAGS=$CXX_FLAGS \ 13 | ../../$GTEST_TARGET 14 | make 15 | CTEST_OUTPUT_ON_FAILURE=1 make test 16 | -------------------------------------------------------------------------------- /3rdparty/benchmark/releasing.md: -------------------------------------------------------------------------------- 1 | # How to release 2 | 3 | * Make sure you're on master and synced to HEAD 4 | * Ensure the project builds and tests run (sanity check only, obviously) 5 | * `parallel -j0 exec ::: test/*_test` can help ensure everything at least 6 | passes 7 | * Prepare release notes 8 | * `git log $(git describe --abbrev=0 --tags)..HEAD` gives you the list of 9 | commits between the last annotated tag and HEAD 10 | * Pick the most interesting. 11 | * Create a release through github's interface 12 | * Note this will create a lightweight tag. 13 | * Update this to an annotated tag: 14 | * `git pull --tags` 15 | * `git tag -a -f ` 16 | * `git push --force origin` 17 | -------------------------------------------------------------------------------- /3rdparty/benchmark/src/arraysize.h: -------------------------------------------------------------------------------- 1 | #ifndef BENCHMARK_ARRAYSIZE_H_ 2 | #define BENCHMARK_ARRAYSIZE_H_ 3 | 4 | #include "internal_macros.h" 5 | 6 | namespace benchmark { 7 | namespace internal { 8 | // The arraysize(arr) macro returns the # of elements in an array arr. 9 | // The expression is a compile-time constant, and therefore can be 10 | // used in defining new arrays, for example. If you use arraysize on 11 | // a pointer by mistake, you will get a compile-time error. 12 | // 13 | 14 | // This template function declaration is used in defining arraysize. 15 | // Note that the function doesn't need an implementation, as we only 16 | // use its type. 17 | template 18 | char (&ArraySizeHelper(T (&array)[N]))[N]; 19 | 20 | // That gcc wants both of these prototypes seems mysterious. VC, for 21 | // its part, can't decide which to use (another mystery). Matching of 22 | // template overloads: the final frontier. 23 | #ifndef COMPILER_MSVC 24 | template 25 | char (&ArraySizeHelper(const T (&array)[N]))[N]; 26 | #endif 27 | 28 | #define arraysize(array) (sizeof(::benchmark::internal::ArraySizeHelper(array))) 29 | 30 | } // end namespace internal 31 | } // end namespace benchmark 32 | 33 | #endif // BENCHMARK_ARRAYSIZE_H_ 34 | -------------------------------------------------------------------------------- /3rdparty/benchmark/src/benchmark_api_internal.h: -------------------------------------------------------------------------------- 1 | #ifndef BENCHMARK_API_INTERNAL_H 2 | #define BENCHMARK_API_INTERNAL_H 3 | 4 | #include "benchmark/benchmark.h" 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | namespace benchmark { 13 | namespace internal { 14 | 15 | // Information kept per benchmark we may want to run 16 | struct Benchmark::Instance { 17 | std::string name; 18 | Benchmark* benchmark; 19 | ReportMode report_mode; 20 | std::vector arg; 21 | TimeUnit time_unit; 22 | int range_multiplier; 23 | bool use_real_time; 24 | bool use_manual_time; 25 | BigO complexity; 26 | BigOFunc* complexity_lambda; 27 | UserCounters counters; 28 | const std::vector* statistics; 29 | bool last_benchmark_instance; 30 | int repetitions; 31 | double min_time; 32 | size_t iterations; 33 | int threads; // Number of concurrent threads to us 34 | }; 35 | 36 | bool FindBenchmarksInternal(const std::string& re, 37 | std::vector* benchmarks, 38 | std::ostream* Err); 39 | 40 | bool IsZero(double n); 41 | 42 | ConsoleReporter::OutputOptions GetOutputOptions(bool force_no_color = false); 43 | 44 | } // end namespace internal 45 | } // end namespace benchmark 46 | 47 | #endif // BENCHMARK_API_INTERNAL_H 48 | -------------------------------------------------------------------------------- /3rdparty/benchmark/src/benchmark_main.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "benchmark/benchmark.h" 16 | 17 | BENCHMARK_MAIN(); 18 | -------------------------------------------------------------------------------- /3rdparty/benchmark/src/benchmark_register.h: -------------------------------------------------------------------------------- 1 | #ifndef BENCHMARK_REGISTER_H 2 | #define BENCHMARK_REGISTER_H 3 | 4 | #include 5 | 6 | #include "check.h" 7 | 8 | template 9 | void AddRange(std::vector* dst, T lo, T hi, int mult) { 10 | CHECK_GE(lo, 0); 11 | CHECK_GE(hi, lo); 12 | CHECK_GE(mult, 2); 13 | 14 | // Add "lo" 15 | dst->push_back(lo); 16 | 17 | static const T kmax = std::numeric_limits::max(); 18 | 19 | // Now space out the benchmarks in multiples of "mult" 20 | for (T i = 1; i < kmax / mult; i *= mult) { 21 | if (i >= hi) break; 22 | if (i > lo) { 23 | dst->push_back(i); 24 | } 25 | } 26 | 27 | // Add "hi" (if different from "lo") 28 | if (hi != lo) { 29 | dst->push_back(hi); 30 | } 31 | } 32 | 33 | #endif // BENCHMARK_REGISTER_H 34 | -------------------------------------------------------------------------------- /3rdparty/benchmark/src/colorprint.h: -------------------------------------------------------------------------------- 1 | #ifndef BENCHMARK_COLORPRINT_H_ 2 | #define BENCHMARK_COLORPRINT_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace benchmark { 9 | enum LogColor { 10 | COLOR_DEFAULT, 11 | COLOR_RED, 12 | COLOR_GREEN, 13 | COLOR_YELLOW, 14 | COLOR_BLUE, 15 | COLOR_MAGENTA, 16 | COLOR_CYAN, 17 | COLOR_WHITE 18 | }; 19 | 20 | std::string FormatString(const char* msg, va_list args); 21 | std::string FormatString(const char* msg, ...); 22 | 23 | void ColorPrintf(std::ostream& out, LogColor color, const char* fmt, 24 | va_list args); 25 | void ColorPrintf(std::ostream& out, LogColor color, const char* fmt, ...); 26 | 27 | // Returns true if stdout appears to be a terminal that supports colored 28 | // output, false otherwise. 29 | bool IsColorTerminal(); 30 | 31 | } // end namespace benchmark 32 | 33 | #endif // BENCHMARK_COLORPRINT_H_ 34 | -------------------------------------------------------------------------------- /3rdparty/benchmark/src/complexity.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Ismael Jimenez Martinez. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Source project : https://github.com/ismaelJimenez/cpp.leastsq 16 | // Adapted to be used with google benchmark 17 | 18 | #ifndef COMPLEXITY_H_ 19 | #define COMPLEXITY_H_ 20 | 21 | #include 22 | #include 23 | 24 | #include "benchmark/benchmark.h" 25 | 26 | namespace benchmark { 27 | 28 | // Return a vector containing the bigO and RMS information for the specified 29 | // list of reports. If 'reports.size() < 2' an empty vector is returned. 30 | std::vector ComputeBigO( 31 | const std::vector& reports); 32 | 33 | // This data structure will contain the result returned by MinimalLeastSq 34 | // - coef : Estimated coeficient for the high-order term as 35 | // interpolated from data. 36 | // - rms : Normalized Root Mean Squared Error. 37 | // - complexity : Scalability form (e.g. oN, oNLogN). In case a scalability 38 | // form has been provided to MinimalLeastSq this will return 39 | // the same value. In case BigO::oAuto has been selected, this 40 | // parameter will return the best fitting curve detected. 41 | 42 | struct LeastSq { 43 | LeastSq() : coef(0.0), rms(0.0), complexity(oNone) {} 44 | 45 | double coef; 46 | double rms; 47 | BigO complexity; 48 | }; 49 | 50 | // Function to return an string for the calculated complexity 51 | std::string GetBigOString(BigO complexity); 52 | 53 | } // end namespace benchmark 54 | 55 | #endif // COMPLEXITY_H_ 56 | -------------------------------------------------------------------------------- /3rdparty/benchmark/src/counter.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "counter.h" 16 | 17 | namespace benchmark { 18 | namespace internal { 19 | 20 | double Finish(Counter const& c, double cpu_time, double num_threads) { 21 | double v = c.value; 22 | if (c.flags & Counter::kIsRate) { 23 | v /= cpu_time; 24 | } 25 | if (c.flags & Counter::kAvgThreads) { 26 | v /= num_threads; 27 | } 28 | return v; 29 | } 30 | 31 | void Finish(UserCounters *l, double cpu_time, double num_threads) { 32 | for (auto &c : *l) { 33 | c.second.value = Finish(c.second, cpu_time, num_threads); 34 | } 35 | } 36 | 37 | void Increment(UserCounters *l, UserCounters const& r) { 38 | // add counters present in both or just in *l 39 | for (auto &c : *l) { 40 | auto it = r.find(c.first); 41 | if (it != r.end()) { 42 | c.second.value = c.second + it->second; 43 | } 44 | } 45 | // add counters present in r, but not in *l 46 | for (auto const &tc : r) { 47 | auto it = l->find(tc.first); 48 | if (it == l->end()) { 49 | (*l)[tc.first] = tc.second; 50 | } 51 | } 52 | } 53 | 54 | bool SameNames(UserCounters const& l, UserCounters const& r) { 55 | if (&l == &r) return true; 56 | if (l.size() != r.size()) { 57 | return false; 58 | } 59 | for (auto const& c : l) { 60 | if (r.find(c.first) == r.end()) { 61 | return false; 62 | } 63 | } 64 | return true; 65 | } 66 | 67 | } // end namespace internal 68 | } // end namespace benchmark 69 | -------------------------------------------------------------------------------- /3rdparty/benchmark/src/counter.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "benchmark/benchmark.h" 16 | 17 | namespace benchmark { 18 | 19 | // these counter-related functions are hidden to reduce API surface. 20 | namespace internal { 21 | void Finish(UserCounters *l, double time, double num_threads); 22 | void Increment(UserCounters *l, UserCounters const& r); 23 | bool SameNames(UserCounters const& l, UserCounters const& r); 24 | } // end namespace internal 25 | 26 | } //end namespace benchmark 27 | -------------------------------------------------------------------------------- /3rdparty/benchmark/src/log.h: -------------------------------------------------------------------------------- 1 | #ifndef BENCHMARK_LOG_H_ 2 | #define BENCHMARK_LOG_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include "benchmark/benchmark.h" 8 | 9 | namespace benchmark { 10 | namespace internal { 11 | 12 | typedef std::basic_ostream&(EndLType)(std::basic_ostream&); 13 | 14 | class LogType { 15 | friend LogType& GetNullLogInstance(); 16 | friend LogType& GetErrorLogInstance(); 17 | 18 | // FIXME: Add locking to output. 19 | template 20 | friend LogType& operator<<(LogType&, Tp const&); 21 | friend LogType& operator<<(LogType&, EndLType*); 22 | 23 | private: 24 | LogType(std::ostream* out) : out_(out) {} 25 | std::ostream* out_; 26 | BENCHMARK_DISALLOW_COPY_AND_ASSIGN(LogType); 27 | }; 28 | 29 | template 30 | LogType& operator<<(LogType& log, Tp const& value) { 31 | if (log.out_) { 32 | *log.out_ << value; 33 | } 34 | return log; 35 | } 36 | 37 | inline LogType& operator<<(LogType& log, EndLType* m) { 38 | if (log.out_) { 39 | *log.out_ << m; 40 | } 41 | return log; 42 | } 43 | 44 | inline int& LogLevel() { 45 | static int log_level = 0; 46 | return log_level; 47 | } 48 | 49 | inline LogType& GetNullLogInstance() { 50 | static LogType log(nullptr); 51 | return log; 52 | } 53 | 54 | inline LogType& GetErrorLogInstance() { 55 | static LogType log(&std::clog); 56 | return log; 57 | } 58 | 59 | inline LogType& GetLogInstanceForLevel(int level) { 60 | if (level <= LogLevel()) { 61 | return GetErrorLogInstance(); 62 | } 63 | return GetNullLogInstance(); 64 | } 65 | 66 | } // end namespace internal 67 | } // end namespace benchmark 68 | 69 | #define VLOG(x) \ 70 | (::benchmark::internal::GetLogInstanceForLevel(x) << "-- LOG(" << x << "):" \ 71 | " ") 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /3rdparty/benchmark/src/sleep.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "sleep.h" 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | #include "internal_macros.h" 22 | 23 | #ifdef BENCHMARK_OS_WINDOWS 24 | #include 25 | #endif 26 | 27 | namespace benchmark { 28 | #ifdef BENCHMARK_OS_WINDOWS 29 | // Window's Sleep takes milliseconds argument. 30 | void SleepForMilliseconds(int milliseconds) { Sleep(milliseconds); } 31 | void SleepForSeconds(double seconds) { 32 | SleepForMilliseconds(static_cast(kNumMillisPerSecond * seconds)); 33 | } 34 | #else // BENCHMARK_OS_WINDOWS 35 | void SleepForMicroseconds(int microseconds) { 36 | struct timespec sleep_time; 37 | sleep_time.tv_sec = microseconds / kNumMicrosPerSecond; 38 | sleep_time.tv_nsec = (microseconds % kNumMicrosPerSecond) * kNumNanosPerMicro; 39 | while (nanosleep(&sleep_time, &sleep_time) != 0 && errno == EINTR) 40 | ; // Ignore signals and wait for the full interval to elapse. 41 | } 42 | 43 | void SleepForMilliseconds(int milliseconds) { 44 | SleepForMicroseconds(milliseconds * kNumMicrosPerMilli); 45 | } 46 | 47 | void SleepForSeconds(double seconds) { 48 | SleepForMicroseconds(static_cast(seconds * kNumMicrosPerSecond)); 49 | } 50 | #endif // BENCHMARK_OS_WINDOWS 51 | } // end namespace benchmark 52 | -------------------------------------------------------------------------------- /3rdparty/benchmark/src/sleep.h: -------------------------------------------------------------------------------- 1 | #ifndef BENCHMARK_SLEEP_H_ 2 | #define BENCHMARK_SLEEP_H_ 3 | 4 | namespace benchmark { 5 | const int kNumMillisPerSecond = 1000; 6 | const int kNumMicrosPerMilli = 1000; 7 | const int kNumMicrosPerSecond = kNumMillisPerSecond * 1000; 8 | const int kNumNanosPerMicro = 1000; 9 | const int kNumNanosPerSecond = kNumNanosPerMicro * kNumMicrosPerSecond; 10 | 11 | void SleepForMilliseconds(int milliseconds); 12 | void SleepForSeconds(double seconds); 13 | } // end namespace benchmark 14 | 15 | #endif // BENCHMARK_SLEEP_H_ 16 | -------------------------------------------------------------------------------- /3rdparty/benchmark/src/statistics.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Ismael Jimenez Martinez. All rights reserved. 2 | // Copyright 2017 Roman Lebedev. All rights reserved. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | 16 | #ifndef STATISTICS_H_ 17 | #define STATISTICS_H_ 18 | 19 | #include 20 | 21 | #include "benchmark/benchmark.h" 22 | 23 | namespace benchmark { 24 | 25 | // Return a vector containing the mean, median and standard devation information 26 | // (and any user-specified info) for the specified list of reports. If 'reports' 27 | // contains less than two non-errored runs an empty vector is returned 28 | std::vector ComputeStats( 29 | const std::vector& reports); 30 | 31 | double StatisticsMean(const std::vector& v); 32 | double StatisticsMedian(const std::vector& v); 33 | double StatisticsStdDev(const std::vector& v); 34 | 35 | } // end namespace benchmark 36 | 37 | #endif // STATISTICS_H_ 38 | -------------------------------------------------------------------------------- /3rdparty/benchmark/src/string_util.h: -------------------------------------------------------------------------------- 1 | #ifndef BENCHMARK_STRING_UTIL_H_ 2 | #define BENCHMARK_STRING_UTIL_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include "internal_macros.h" 8 | 9 | namespace benchmark { 10 | 11 | void AppendHumanReadable(int n, std::string* str); 12 | 13 | std::string HumanReadableNumber(double n, double one_k = 1024.0); 14 | 15 | std::string StrFormat(const char* format, ...); 16 | 17 | inline std::ostream& StrCatImp(std::ostream& out) BENCHMARK_NOEXCEPT { 18 | return out; 19 | } 20 | 21 | template 22 | inline std::ostream& StrCatImp(std::ostream& out, First&& f, 23 | Rest&&... rest) { 24 | out << std::forward(f); 25 | return StrCatImp(out, std::forward(rest)...); 26 | } 27 | 28 | template 29 | inline std::string StrCat(Args&&... args) { 30 | std::ostringstream ss; 31 | StrCatImp(ss, std::forward(args)...); 32 | return ss.str(); 33 | } 34 | 35 | void ReplaceAll(std::string* str, const std::string& from, 36 | const std::string& to); 37 | 38 | } // end namespace benchmark 39 | 40 | #endif // BENCHMARK_STRING_UTIL_H_ 41 | -------------------------------------------------------------------------------- /3rdparty/benchmark/src/thread_manager.h: -------------------------------------------------------------------------------- 1 | #ifndef BENCHMARK_THREAD_MANAGER_H 2 | #define BENCHMARK_THREAD_MANAGER_H 3 | 4 | #include 5 | 6 | #include "benchmark/benchmark.h" 7 | #include "mutex.h" 8 | 9 | namespace benchmark { 10 | namespace internal { 11 | 12 | class ThreadManager { 13 | public: 14 | ThreadManager(int num_threads) 15 | : alive_threads_(num_threads), start_stop_barrier_(num_threads) {} 16 | 17 | Mutex& GetBenchmarkMutex() const RETURN_CAPABILITY(benchmark_mutex_) { 18 | return benchmark_mutex_; 19 | } 20 | 21 | bool StartStopBarrier() EXCLUDES(end_cond_mutex_) { 22 | return start_stop_barrier_.wait(); 23 | } 24 | 25 | void NotifyThreadComplete() EXCLUDES(end_cond_mutex_) { 26 | start_stop_barrier_.removeThread(); 27 | if (--alive_threads_ == 0) { 28 | MutexLock lock(end_cond_mutex_); 29 | end_condition_.notify_all(); 30 | } 31 | } 32 | 33 | void WaitForAllThreads() EXCLUDES(end_cond_mutex_) { 34 | MutexLock lock(end_cond_mutex_); 35 | end_condition_.wait(lock.native_handle(), 36 | [this]() { return alive_threads_ == 0; }); 37 | } 38 | 39 | public: 40 | struct Result { 41 | int64_t iterations = 0; 42 | double real_time_used = 0; 43 | double cpu_time_used = 0; 44 | double manual_time_used = 0; 45 | int64_t bytes_processed = 0; 46 | int64_t items_processed = 0; 47 | int64_t complexity_n = 0; 48 | std::string report_label_; 49 | std::string error_message_; 50 | bool has_error_ = false; 51 | UserCounters counters; 52 | }; 53 | GUARDED_BY(GetBenchmarkMutex()) Result results; 54 | 55 | private: 56 | mutable Mutex benchmark_mutex_; 57 | std::atomic alive_threads_; 58 | Barrier start_stop_barrier_; 59 | Mutex end_cond_mutex_; 60 | Condition end_condition_; 61 | }; 62 | 63 | } // namespace internal 64 | } // namespace benchmark 65 | 66 | #endif // BENCHMARK_THREAD_MANAGER_H 67 | -------------------------------------------------------------------------------- /3rdparty/benchmark/src/thread_timer.h: -------------------------------------------------------------------------------- 1 | #ifndef BENCHMARK_THREAD_TIMER_H 2 | #define BENCHMARK_THREAD_TIMER_H 3 | 4 | #include "check.h" 5 | #include "timers.h" 6 | 7 | namespace benchmark { 8 | namespace internal { 9 | 10 | class ThreadTimer { 11 | public: 12 | ThreadTimer() = default; 13 | 14 | // Called by each thread 15 | void StartTimer() { 16 | running_ = true; 17 | start_real_time_ = ChronoClockNow(); 18 | start_cpu_time_ = ThreadCPUUsage(); 19 | } 20 | 21 | // Called by each thread 22 | void StopTimer() { 23 | CHECK(running_); 24 | running_ = false; 25 | real_time_used_ += ChronoClockNow() - start_real_time_; 26 | // Floating point error can result in the subtraction producing a negative 27 | // time. Guard against that. 28 | cpu_time_used_ += std::max(ThreadCPUUsage() - start_cpu_time_, 0); 29 | } 30 | 31 | // Called by each thread 32 | void SetIterationTime(double seconds) { manual_time_used_ += seconds; } 33 | 34 | bool running() const { return running_; } 35 | 36 | // REQUIRES: timer is not running 37 | double real_time_used() { 38 | CHECK(!running_); 39 | return real_time_used_; 40 | } 41 | 42 | // REQUIRES: timer is not running 43 | double cpu_time_used() { 44 | CHECK(!running_); 45 | return cpu_time_used_; 46 | } 47 | 48 | // REQUIRES: timer is not running 49 | double manual_time_used() { 50 | CHECK(!running_); 51 | return manual_time_used_; 52 | } 53 | 54 | private: 55 | bool running_ = false; // Is the timer running 56 | double start_real_time_ = 0; // If running_ 57 | double start_cpu_time_ = 0; // If running_ 58 | 59 | // Accumulated time so far (does not contain current slice if running_) 60 | double real_time_used_ = 0; 61 | double cpu_time_used_ = 0; 62 | // Manually set iteration time. User sets this with SetIterationTime(seconds). 63 | double manual_time_used_ = 0; 64 | }; 65 | 66 | } // namespace internal 67 | } // namespace benchmark 68 | 69 | #endif // BENCHMARK_THREAD_TIMER_H 70 | -------------------------------------------------------------------------------- /3rdparty/benchmark/src/timers.h: -------------------------------------------------------------------------------- 1 | #ifndef BENCHMARK_TIMERS_H 2 | #define BENCHMARK_TIMERS_H 3 | 4 | #include 5 | #include 6 | 7 | namespace benchmark { 8 | 9 | // Return the CPU usage of the current process 10 | double ProcessCPUUsage(); 11 | 12 | // Return the CPU usage of the children of the current process 13 | double ChildrenCPUUsage(); 14 | 15 | // Return the CPU usage of the current thread 16 | double ThreadCPUUsage(); 17 | 18 | #if defined(HAVE_STEADY_CLOCK) 19 | template 20 | struct ChooseSteadyClock { 21 | typedef std::chrono::high_resolution_clock type; 22 | }; 23 | 24 | template <> 25 | struct ChooseSteadyClock { 26 | typedef std::chrono::steady_clock type; 27 | }; 28 | #endif 29 | 30 | struct ChooseClockType { 31 | #if defined(HAVE_STEADY_CLOCK) 32 | typedef ChooseSteadyClock<>::type type; 33 | #else 34 | typedef std::chrono::high_resolution_clock type; 35 | #endif 36 | }; 37 | 38 | inline double ChronoClockNow() { 39 | typedef ChooseClockType::type ClockType; 40 | using FpSeconds = std::chrono::duration; 41 | return FpSeconds(ClockType::now().time_since_epoch()).count(); 42 | } 43 | 44 | std::string LocalDateTimeString(); 45 | 46 | } // end namespace benchmark 47 | 48 | #endif // BENCHMARK_TIMERS_H 49 | -------------------------------------------------------------------------------- /3rdparty/benchmark/test/AssemblyTests.cmake: -------------------------------------------------------------------------------- 1 | 2 | include(split_list) 3 | 4 | set(ASM_TEST_FLAGS "") 5 | check_cxx_compiler_flag(-O3 BENCHMARK_HAS_O3_FLAG) 6 | if (BENCHMARK_HAS_O3_FLAG) 7 | list(APPEND ASM_TEST_FLAGS -O3) 8 | endif() 9 | 10 | check_cxx_compiler_flag(-g0 BENCHMARK_HAS_G0_FLAG) 11 | if (BENCHMARK_HAS_G0_FLAG) 12 | list(APPEND ASM_TEST_FLAGS -g0) 13 | endif() 14 | 15 | check_cxx_compiler_flag(-fno-stack-protector BENCHMARK_HAS_FNO_STACK_PROTECTOR_FLAG) 16 | if (BENCHMARK_HAS_FNO_STACK_PROTECTOR_FLAG) 17 | list(APPEND ASM_TEST_FLAGS -fno-stack-protector) 18 | endif() 19 | 20 | split_list(ASM_TEST_FLAGS) 21 | string(TOUPPER "${CMAKE_CXX_COMPILER_ID}" ASM_TEST_COMPILER) 22 | 23 | macro(add_filecheck_test name) 24 | cmake_parse_arguments(ARG "" "" "CHECK_PREFIXES" ${ARGV}) 25 | add_library(${name} OBJECT ${name}.cc) 26 | set_target_properties(${name} PROPERTIES COMPILE_FLAGS "-S ${ASM_TEST_FLAGS}") 27 | set(ASM_OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/${name}.s") 28 | add_custom_target(copy_${name} ALL 29 | COMMAND ${PROJECT_SOURCE_DIR}/tools/strip_asm.py 30 | $ 31 | ${ASM_OUTPUT_FILE} 32 | BYPRODUCTS ${ASM_OUTPUT_FILE}) 33 | add_dependencies(copy_${name} ${name}) 34 | if (NOT ARG_CHECK_PREFIXES) 35 | set(ARG_CHECK_PREFIXES "CHECK") 36 | endif() 37 | foreach(prefix ${ARG_CHECK_PREFIXES}) 38 | add_test(NAME run_${name}_${prefix} 39 | COMMAND 40 | ${LLVM_FILECHECK_EXE} ${name}.cc 41 | --input-file=${ASM_OUTPUT_FILE} 42 | --check-prefixes=CHECK,CHECK-${ASM_TEST_COMPILER} 43 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) 44 | endforeach() 45 | endmacro() 46 | 47 | -------------------------------------------------------------------------------- /3rdparty/benchmark/test/benchmark_gtest.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "../src/benchmark_register.h" 4 | #include "gmock/gmock.h" 5 | #include "gtest/gtest.h" 6 | 7 | namespace { 8 | 9 | TEST(AddRangeTest, Simple) { 10 | std::vector dst; 11 | AddRange(&dst, 1, 2, 2); 12 | EXPECT_THAT(dst, testing::ElementsAre(1, 2)); 13 | } 14 | 15 | TEST(AddRangeTest, Simple64) { 16 | std::vector dst; 17 | AddRange(&dst, static_cast(1), static_cast(2), 2); 18 | EXPECT_THAT(dst, testing::ElementsAre(1, 2)); 19 | } 20 | 21 | TEST(AddRangeTest, Advanced) { 22 | std::vector dst; 23 | AddRange(&dst, 5, 15, 2); 24 | EXPECT_THAT(dst, testing::ElementsAre(5, 8, 15)); 25 | } 26 | 27 | TEST(AddRangeTest, Advanced64) { 28 | std::vector dst; 29 | AddRange(&dst, static_cast(5), static_cast(15), 2); 30 | EXPECT_THAT(dst, testing::ElementsAre(5, 8, 15)); 31 | } 32 | 33 | } // end namespace 34 | -------------------------------------------------------------------------------- /3rdparty/benchmark/test/clobber_memory_assembly_test.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef __clang__ 4 | #pragma clang diagnostic ignored "-Wreturn-type" 5 | #endif 6 | 7 | extern "C" { 8 | 9 | extern int ExternInt; 10 | extern int ExternInt2; 11 | extern int ExternInt3; 12 | 13 | } 14 | 15 | // CHECK-LABEL: test_basic: 16 | extern "C" void test_basic() { 17 | int x; 18 | benchmark::DoNotOptimize(&x); 19 | x = 101; 20 | benchmark::ClobberMemory(); 21 | // CHECK: leaq [[DEST:[^,]+]], %rax 22 | // CHECK: movl $101, [[DEST]] 23 | // CHECK: ret 24 | } 25 | 26 | // CHECK-LABEL: test_redundant_store: 27 | extern "C" void test_redundant_store() { 28 | ExternInt = 3; 29 | benchmark::ClobberMemory(); 30 | ExternInt = 51; 31 | // CHECK-DAG: ExternInt 32 | // CHECK-DAG: movl $3 33 | // CHECK: movl $51 34 | } 35 | 36 | // CHECK-LABEL: test_redundant_read: 37 | extern "C" void test_redundant_read() { 38 | int x; 39 | benchmark::DoNotOptimize(&x); 40 | x = ExternInt; 41 | benchmark::ClobberMemory(); 42 | x = ExternInt2; 43 | // CHECK: leaq [[DEST:[^,]+]], %rax 44 | // CHECK: ExternInt(%rip) 45 | // CHECK: movl %eax, [[DEST]] 46 | // CHECK-NOT: ExternInt2 47 | // CHECK: ret 48 | } 49 | 50 | // CHECK-LABEL: test_redundant_read2: 51 | extern "C" void test_redundant_read2() { 52 | int x; 53 | benchmark::DoNotOptimize(&x); 54 | x = ExternInt; 55 | benchmark::ClobberMemory(); 56 | x = ExternInt2; 57 | benchmark::ClobberMemory(); 58 | // CHECK: leaq [[DEST:[^,]+]], %rax 59 | // CHECK: ExternInt(%rip) 60 | // CHECK: movl %eax, [[DEST]] 61 | // CHECK: ExternInt2(%rip) 62 | // CHECK: movl %eax, [[DEST]] 63 | // CHECK: ret 64 | } 65 | -------------------------------------------------------------------------------- /3rdparty/benchmark/test/cxx03_test.cc: -------------------------------------------------------------------------------- 1 | #undef NDEBUG 2 | #include 3 | #include 4 | 5 | #include "benchmark/benchmark.h" 6 | 7 | #if __cplusplus >= 201103L 8 | #error C++11 or greater detected. Should be C++03. 9 | #endif 10 | 11 | #ifdef BENCHMARK_HAS_CXX11 12 | #error C++11 or greater detected by the library. BENCHMARK_HAS_CXX11 is defined. 13 | #endif 14 | 15 | void BM_empty(benchmark::State& state) { 16 | while (state.KeepRunning()) { 17 | volatile std::size_t x = state.iterations(); 18 | ((void)x); 19 | } 20 | } 21 | BENCHMARK(BM_empty); 22 | 23 | // The new C++11 interface for args/ranges requires initializer list support. 24 | // Therefore we provide the old interface to support C++03. 25 | void BM_old_arg_range_interface(benchmark::State& state) { 26 | assert((state.range(0) == 1 && state.range(1) == 2) || 27 | (state.range(0) == 5 && state.range(1) == 6)); 28 | while (state.KeepRunning()) { 29 | } 30 | } 31 | BENCHMARK(BM_old_arg_range_interface)->ArgPair(1, 2)->RangePair(5, 5, 6, 6); 32 | 33 | template 34 | void BM_template2(benchmark::State& state) { 35 | BM_empty(state); 36 | } 37 | BENCHMARK_TEMPLATE2(BM_template2, int, long); 38 | 39 | template 40 | void BM_template1(benchmark::State& state) { 41 | BM_empty(state); 42 | } 43 | BENCHMARK_TEMPLATE(BM_template1, long); 44 | BENCHMARK_TEMPLATE1(BM_template1, int); 45 | 46 | template 47 | struct BM_Fixture : public ::benchmark::Fixture { 48 | }; 49 | 50 | BENCHMARK_TEMPLATE_F(BM_Fixture, BM_template1, long)(benchmark::State& state) { 51 | BM_empty(state); 52 | } 53 | BENCHMARK_TEMPLATE1_F(BM_Fixture, BM_template2, int)(benchmark::State& state) { 54 | BM_empty(state); 55 | } 56 | 57 | void BM_counters(benchmark::State& state) { 58 | BM_empty(state); 59 | state.counters["Foo"] = 2; 60 | } 61 | BENCHMARK(BM_counters); 62 | 63 | BENCHMARK_MAIN(); 64 | -------------------------------------------------------------------------------- /3rdparty/benchmark/test/diagnostics_test.cc: -------------------------------------------------------------------------------- 1 | // Testing: 2 | // State::PauseTiming() 3 | // State::ResumeTiming() 4 | // Test that CHECK's within these function diagnose when they are called 5 | // outside of the KeepRunning() loop. 6 | // 7 | // NOTE: Users should NOT include or use src/check.h. This is only done in 8 | // order to test library internals. 9 | 10 | #include 11 | #include 12 | 13 | #include "../src/check.h" 14 | #include "benchmark/benchmark.h" 15 | 16 | #if defined(__GNUC__) && !defined(__EXCEPTIONS) 17 | #define TEST_HAS_NO_EXCEPTIONS 18 | #endif 19 | 20 | void TestHandler() { 21 | #ifndef TEST_HAS_NO_EXCEPTIONS 22 | throw std::logic_error(""); 23 | #else 24 | std::abort(); 25 | #endif 26 | } 27 | 28 | void try_invalid_pause_resume(benchmark::State& state) { 29 | #if !defined(TEST_BENCHMARK_LIBRARY_HAS_NO_ASSERTIONS) && !defined(TEST_HAS_NO_EXCEPTIONS) 30 | try { 31 | state.PauseTiming(); 32 | std::abort(); 33 | } catch (std::logic_error const&) { 34 | } 35 | try { 36 | state.ResumeTiming(); 37 | std::abort(); 38 | } catch (std::logic_error const&) { 39 | } 40 | #else 41 | (void)state; // avoid unused warning 42 | #endif 43 | } 44 | 45 | void BM_diagnostic_test(benchmark::State& state) { 46 | static bool called_once = false; 47 | 48 | if (called_once == false) try_invalid_pause_resume(state); 49 | 50 | for (auto _ : state) { 51 | benchmark::DoNotOptimize(state.iterations()); 52 | } 53 | 54 | if (called_once == false) try_invalid_pause_resume(state); 55 | 56 | called_once = true; 57 | } 58 | BENCHMARK(BM_diagnostic_test); 59 | 60 | 61 | void BM_diagnostic_test_keep_running(benchmark::State& state) { 62 | static bool called_once = false; 63 | 64 | if (called_once == false) try_invalid_pause_resume(state); 65 | 66 | while(state.KeepRunning()) { 67 | benchmark::DoNotOptimize(state.iterations()); 68 | } 69 | 70 | if (called_once == false) try_invalid_pause_resume(state); 71 | 72 | called_once = true; 73 | } 74 | BENCHMARK(BM_diagnostic_test_keep_running); 75 | 76 | int main(int argc, char* argv[]) { 77 | benchmark::internal::GetAbortHandler() = &TestHandler; 78 | benchmark::Initialize(&argc, argv); 79 | benchmark::RunSpecifiedBenchmarks(); 80 | } 81 | -------------------------------------------------------------------------------- /3rdparty/benchmark/test/donotoptimize_test.cc: -------------------------------------------------------------------------------- 1 | #include "benchmark/benchmark.h" 2 | 3 | #include 4 | 5 | namespace { 6 | #if defined(__GNUC__) 7 | std::uint64_t double_up(const std::uint64_t x) __attribute__((const)); 8 | #endif 9 | std::uint64_t double_up(const std::uint64_t x) { return x * 2; } 10 | } 11 | 12 | // Using DoNotOptimize on types like BitRef seem to cause a lot of problems 13 | // with the inline assembly on both GCC and Clang. 14 | struct BitRef { 15 | int index; 16 | unsigned char &byte; 17 | 18 | public: 19 | static BitRef Make() { 20 | static unsigned char arr[2] = {}; 21 | BitRef b(1, arr[0]); 22 | return b; 23 | } 24 | private: 25 | BitRef(int i, unsigned char& b) : index(i), byte(b) {} 26 | }; 27 | 28 | int main(int, char*[]) { 29 | // this test verifies compilation of DoNotOptimize() for some types 30 | 31 | char buffer8[8] = ""; 32 | benchmark::DoNotOptimize(buffer8); 33 | 34 | char buffer20[20] = ""; 35 | benchmark::DoNotOptimize(buffer20); 36 | 37 | char buffer1024[1024] = ""; 38 | benchmark::DoNotOptimize(buffer1024); 39 | benchmark::DoNotOptimize(&buffer1024[0]); 40 | 41 | int x = 123; 42 | benchmark::DoNotOptimize(x); 43 | benchmark::DoNotOptimize(&x); 44 | benchmark::DoNotOptimize(x += 42); 45 | 46 | benchmark::DoNotOptimize(double_up(x)); 47 | 48 | // These tests are to e 49 | benchmark::DoNotOptimize(BitRef::Make()); 50 | BitRef lval = BitRef::Make(); 51 | benchmark::DoNotOptimize(lval); 52 | } 53 | -------------------------------------------------------------------------------- /3rdparty/benchmark/test/fixture_test.cc: -------------------------------------------------------------------------------- 1 | 2 | #include "benchmark/benchmark.h" 3 | 4 | #include 5 | #include 6 | 7 | class MyFixture : public ::benchmark::Fixture { 8 | public: 9 | void SetUp(const ::benchmark::State& state) { 10 | if (state.thread_index == 0) { 11 | assert(data.get() == nullptr); 12 | data.reset(new int(42)); 13 | } 14 | } 15 | 16 | void TearDown(const ::benchmark::State& state) { 17 | if (state.thread_index == 0) { 18 | assert(data.get() != nullptr); 19 | data.reset(); 20 | } 21 | } 22 | 23 | ~MyFixture() { assert(data == nullptr); } 24 | 25 | std::unique_ptr data; 26 | }; 27 | 28 | BENCHMARK_F(MyFixture, Foo)(benchmark::State &st) { 29 | assert(data.get() != nullptr); 30 | assert(*data == 42); 31 | for (auto _ : st) { 32 | } 33 | } 34 | 35 | BENCHMARK_DEFINE_F(MyFixture, Bar)(benchmark::State& st) { 36 | if (st.thread_index == 0) { 37 | assert(data.get() != nullptr); 38 | assert(*data == 42); 39 | } 40 | for (auto _ : st) { 41 | assert(data.get() != nullptr); 42 | assert(*data == 42); 43 | } 44 | st.SetItemsProcessed(st.range(0)); 45 | } 46 | BENCHMARK_REGISTER_F(MyFixture, Bar)->Arg(42); 47 | BENCHMARK_REGISTER_F(MyFixture, Bar)->Arg(42)->ThreadPerCpu(); 48 | 49 | BENCHMARK_MAIN(); 50 | -------------------------------------------------------------------------------- /3rdparty/benchmark/test/link_main_test.cc: -------------------------------------------------------------------------------- 1 | #include "benchmark/benchmark.h" 2 | 3 | void BM_empty(benchmark::State& state) { 4 | for (auto _ : state) { 5 | benchmark::DoNotOptimize(state.iterations()); 6 | } 7 | } 8 | BENCHMARK(BM_empty); 9 | -------------------------------------------------------------------------------- /3rdparty/benchmark/test/map_test.cc: -------------------------------------------------------------------------------- 1 | #include "benchmark/benchmark.h" 2 | 3 | #include 4 | #include 5 | 6 | namespace { 7 | 8 | std::map ConstructRandomMap(int size) { 9 | std::map m; 10 | for (int i = 0; i < size; ++i) { 11 | m.insert(std::make_pair(std::rand() % size, std::rand() % size)); 12 | } 13 | return m; 14 | } 15 | 16 | } // namespace 17 | 18 | // Basic version. 19 | static void BM_MapLookup(benchmark::State& state) { 20 | const int size = static_cast(state.range(0)); 21 | std::map m; 22 | for (auto _ : state) { 23 | state.PauseTiming(); 24 | m = ConstructRandomMap(size); 25 | state.ResumeTiming(); 26 | for (int i = 0; i < size; ++i) { 27 | benchmark::DoNotOptimize(m.find(std::rand() % size)); 28 | } 29 | } 30 | state.SetItemsProcessed(state.iterations() * size); 31 | } 32 | BENCHMARK(BM_MapLookup)->Range(1 << 3, 1 << 12); 33 | 34 | // Using fixtures. 35 | class MapFixture : public ::benchmark::Fixture { 36 | public: 37 | void SetUp(const ::benchmark::State& st) { 38 | m = ConstructRandomMap(static_cast(st.range(0))); 39 | } 40 | 41 | void TearDown(const ::benchmark::State&) { m.clear(); } 42 | 43 | std::map m; 44 | }; 45 | 46 | BENCHMARK_DEFINE_F(MapFixture, Lookup)(benchmark::State& state) { 47 | const int size = static_cast(state.range(0)); 48 | for (auto _ : state) { 49 | for (int i = 0; i < size; ++i) { 50 | benchmark::DoNotOptimize(m.find(std::rand() % size)); 51 | } 52 | } 53 | state.SetItemsProcessed(state.iterations() * size); 54 | } 55 | BENCHMARK_REGISTER_F(MapFixture, Lookup)->Range(1 << 3, 1 << 12); 56 | 57 | BENCHMARK_MAIN(); 58 | -------------------------------------------------------------------------------- /3rdparty/benchmark/test/options_test.cc: -------------------------------------------------------------------------------- 1 | #include "benchmark/benchmark.h" 2 | #include 3 | #include 4 | 5 | #if defined(NDEBUG) 6 | #undef NDEBUG 7 | #endif 8 | #include 9 | 10 | void BM_basic(benchmark::State& state) { 11 | for (auto _ : state) { 12 | } 13 | } 14 | 15 | void BM_basic_slow(benchmark::State& state) { 16 | std::chrono::milliseconds sleep_duration(state.range(0)); 17 | for (auto _ : state) { 18 | std::this_thread::sleep_for( 19 | std::chrono::duration_cast(sleep_duration)); 20 | } 21 | } 22 | 23 | BENCHMARK(BM_basic); 24 | BENCHMARK(BM_basic)->Arg(42); 25 | BENCHMARK(BM_basic_slow)->Arg(10)->Unit(benchmark::kNanosecond); 26 | BENCHMARK(BM_basic_slow)->Arg(100)->Unit(benchmark::kMicrosecond); 27 | BENCHMARK(BM_basic_slow)->Arg(1000)->Unit(benchmark::kMillisecond); 28 | BENCHMARK(BM_basic)->Range(1, 8); 29 | BENCHMARK(BM_basic)->RangeMultiplier(2)->Range(1, 8); 30 | BENCHMARK(BM_basic)->DenseRange(10, 15); 31 | BENCHMARK(BM_basic)->Args({42, 42}); 32 | BENCHMARK(BM_basic)->Ranges({{64, 512}, {64, 512}}); 33 | BENCHMARK(BM_basic)->MinTime(0.7); 34 | BENCHMARK(BM_basic)->UseRealTime(); 35 | BENCHMARK(BM_basic)->ThreadRange(2, 4); 36 | BENCHMARK(BM_basic)->ThreadPerCpu(); 37 | BENCHMARK(BM_basic)->Repetitions(3); 38 | 39 | void CustomArgs(benchmark::internal::Benchmark* b) { 40 | for (int i = 0; i < 10; ++i) { 41 | b->Arg(i); 42 | } 43 | } 44 | 45 | BENCHMARK(BM_basic)->Apply(CustomArgs); 46 | 47 | void BM_explicit_iteration_count(benchmark::State& state) { 48 | // Test that benchmarks specified with an explicit iteration count are 49 | // only run once. 50 | static bool invoked_before = false; 51 | assert(!invoked_before); 52 | invoked_before = true; 53 | 54 | // Test that the requested iteration count is respected. 55 | assert(state.max_iterations == 42); 56 | size_t actual_iterations = 0; 57 | for (auto _ : state) 58 | ++actual_iterations; 59 | assert(state.iterations() == state.max_iterations); 60 | assert(state.iterations() == 42); 61 | 62 | } 63 | BENCHMARK(BM_explicit_iteration_count)->Iterations(42); 64 | 65 | BENCHMARK_MAIN(); 66 | -------------------------------------------------------------------------------- /3rdparty/benchmark/test/state_assembly_test.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef __clang__ 4 | #pragma clang diagnostic ignored "-Wreturn-type" 5 | #endif 6 | 7 | extern "C" { 8 | extern int ExternInt; 9 | benchmark::State& GetState(); 10 | void Fn(); 11 | } 12 | 13 | using benchmark::State; 14 | 15 | // CHECK-LABEL: test_for_auto_loop: 16 | extern "C" int test_for_auto_loop() { 17 | State& S = GetState(); 18 | int x = 42; 19 | // CHECK: [[CALL:call(q)*]] _ZN9benchmark5State16StartKeepRunningEv 20 | // CHECK-NEXT: testq %rbx, %rbx 21 | // CHECK-NEXT: je [[LOOP_END:.*]] 22 | 23 | for (auto _ : S) { 24 | // CHECK: .L[[LOOP_HEAD:[a-zA-Z0-9_]+]]: 25 | // CHECK-GNU-NEXT: subq $1, %rbx 26 | // CHECK-CLANG-NEXT: {{(addq \$1,|incq)}} %rax 27 | // CHECK-NEXT: jne .L[[LOOP_HEAD]] 28 | benchmark::DoNotOptimize(x); 29 | } 30 | // CHECK: [[LOOP_END]]: 31 | // CHECK: [[CALL]] _ZN9benchmark5State17FinishKeepRunningEv 32 | 33 | // CHECK: movl $101, %eax 34 | // CHECK: ret 35 | return 101; 36 | } 37 | 38 | // CHECK-LABEL: test_while_loop: 39 | extern "C" int test_while_loop() { 40 | State& S = GetState(); 41 | int x = 42; 42 | 43 | // CHECK: j{{(e|mp)}} .L[[LOOP_HEADER:[a-zA-Z0-9_]+]] 44 | // CHECK-NEXT: .L[[LOOP_BODY:[a-zA-Z0-9_]+]]: 45 | while (S.KeepRunning()) { 46 | // CHECK-GNU-NEXT: subq $1, %[[IREG:[a-z]+]] 47 | // CHECK-CLANG-NEXT: {{(addq \$-1,|decq)}} %[[IREG:[a-z]+]] 48 | // CHECK: movq %[[IREG]], [[DEST:.*]] 49 | benchmark::DoNotOptimize(x); 50 | } 51 | // CHECK-DAG: movq [[DEST]], %[[IREG]] 52 | // CHECK-DAG: testq %[[IREG]], %[[IREG]] 53 | // CHECK-DAG: jne .L[[LOOP_BODY]] 54 | // CHECK-DAG: .L[[LOOP_HEADER]]: 55 | 56 | // CHECK: cmpb $0 57 | // CHECK-NEXT: jne .L[[LOOP_END:[a-zA-Z0-9_]+]] 58 | // CHECK: [[CALL:call(q)*]] _ZN9benchmark5State16StartKeepRunningEv 59 | 60 | // CHECK: .L[[LOOP_END]]: 61 | // CHECK: [[CALL]] _ZN9benchmark5State17FinishKeepRunningEv 62 | 63 | // CHECK: movl $101, %eax 64 | // CHECK: ret 65 | return 101; 66 | } 67 | -------------------------------------------------------------------------------- /3rdparty/benchmark/test/statistics_gtest.cc: -------------------------------------------------------------------------------- 1 | //===---------------------------------------------------------------------===// 2 | // statistics_test - Unit tests for src/statistics.cc 3 | //===---------------------------------------------------------------------===// 4 | 5 | #include "../src/statistics.h" 6 | #include "gtest/gtest.h" 7 | 8 | namespace { 9 | TEST(StatisticsTest, Mean) { 10 | std::vector Inputs; 11 | { 12 | Inputs = {42, 42, 42, 42}; 13 | double Res = benchmark::StatisticsMean(Inputs); 14 | EXPECT_DOUBLE_EQ(Res, 42.0); 15 | } 16 | { 17 | Inputs = {1, 2, 3, 4}; 18 | double Res = benchmark::StatisticsMean(Inputs); 19 | EXPECT_DOUBLE_EQ(Res, 2.5); 20 | } 21 | { 22 | Inputs = {1, 2, 5, 10, 10, 14}; 23 | double Res = benchmark::StatisticsMean(Inputs); 24 | EXPECT_DOUBLE_EQ(Res, 7.0); 25 | } 26 | } 27 | 28 | TEST(StatisticsTest, Median) { 29 | std::vector Inputs; 30 | { 31 | Inputs = {42, 42, 42, 42}; 32 | double Res = benchmark::StatisticsMedian(Inputs); 33 | EXPECT_DOUBLE_EQ(Res, 42.0); 34 | } 35 | { 36 | Inputs = {1, 2, 3, 4}; 37 | double Res = benchmark::StatisticsMedian(Inputs); 38 | EXPECT_DOUBLE_EQ(Res, 2.5); 39 | } 40 | { 41 | Inputs = {1, 2, 5, 10, 10}; 42 | double Res = benchmark::StatisticsMedian(Inputs); 43 | EXPECT_DOUBLE_EQ(Res, 5.0); 44 | } 45 | } 46 | 47 | TEST(StatisticsTest, StdDev) { 48 | std::vector Inputs; 49 | { 50 | Inputs = {101, 101, 101, 101}; 51 | double Res = benchmark::StatisticsStdDev(Inputs); 52 | EXPECT_DOUBLE_EQ(Res, 0.0); 53 | } 54 | { 55 | Inputs = {1, 2, 3}; 56 | double Res = benchmark::StatisticsStdDev(Inputs); 57 | EXPECT_DOUBLE_EQ(Res, 1.0); 58 | } 59 | } 60 | 61 | } // end namespace 62 | -------------------------------------------------------------------------------- /3rdparty/benchmark/test/templated_fixture_test.cc: -------------------------------------------------------------------------------- 1 | 2 | #include "benchmark/benchmark.h" 3 | 4 | #include 5 | #include 6 | 7 | template 8 | class MyFixture : public ::benchmark::Fixture { 9 | public: 10 | MyFixture() : data(0) {} 11 | 12 | T data; 13 | }; 14 | 15 | BENCHMARK_TEMPLATE_F(MyFixture, Foo, int)(benchmark::State &st) { 16 | for (auto _ : st) { 17 | data += 1; 18 | } 19 | } 20 | 21 | BENCHMARK_TEMPLATE_DEFINE_F(MyFixture, Bar, double)(benchmark::State& st) { 22 | for (auto _ : st) { 23 | data += 1.0; 24 | } 25 | } 26 | BENCHMARK_REGISTER_F(MyFixture, Bar); 27 | 28 | BENCHMARK_MAIN(); 29 | -------------------------------------------------------------------------------- /3rdparty/benchmark/tools/gbench/Inputs/test2_run.json: -------------------------------------------------------------------------------- 1 | { 2 | "context": { 3 | "date": "2016-08-02 17:44:46", 4 | "num_cpus": 4, 5 | "mhz_per_cpu": 4228, 6 | "cpu_scaling_enabled": false, 7 | "library_build_type": "release" 8 | }, 9 | "benchmarks": [ 10 | { 11 | "name": "BM_Hi", 12 | "iterations": 1234, 13 | "real_time": 42, 14 | "cpu_time": 24, 15 | "time_unit": "ms" 16 | }, 17 | { 18 | "name": "BM_Zero", 19 | "iterations": 1000, 20 | "real_time": 10, 21 | "cpu_time": 10, 22 | "time_unit": "ns" 23 | }, 24 | { 25 | "name": "BM_Zero/4", 26 | "iterations": 4000, 27 | "real_time": 40, 28 | "cpu_time": 40, 29 | "time_unit": "ns" 30 | }, 31 | { 32 | "name": "Prefix/BM_Zero", 33 | "iterations": 2000, 34 | "real_time": 20, 35 | "cpu_time": 20, 36 | "time_unit": "ns" 37 | }, 38 | { 39 | "name": "Prefix/BM_Zero/3", 40 | "iterations": 3000, 41 | "real_time": 30, 42 | "cpu_time": 30, 43 | "time_unit": "ns" 44 | }, 45 | { 46 | "name": "BM_One", 47 | "iterations": 5000, 48 | "real_time": 5, 49 | "cpu_time": 5, 50 | "time_unit": "ns" 51 | }, 52 | { 53 | "name": "BM_One/4", 54 | "iterations": 2000, 55 | "real_time": 20, 56 | "cpu_time": 20, 57 | "time_unit": "ns" 58 | }, 59 | { 60 | "name": "Prefix/BM_One", 61 | "iterations": 1000, 62 | "real_time": 10, 63 | "cpu_time": 10, 64 | "time_unit": "ns" 65 | }, 66 | { 67 | "name": "Prefix/BM_One/3", 68 | "iterations": 1500, 69 | "real_time": 15, 70 | "cpu_time": 15, 71 | "time_unit": "ns" 72 | }, 73 | { 74 | "name": "BM_Bye", 75 | "iterations": 5321, 76 | "real_time": 11, 77 | "cpu_time": 63, 78 | "time_unit": "ns" 79 | } 80 | ] 81 | } 82 | -------------------------------------------------------------------------------- /3rdparty/benchmark/tools/gbench/__init__.py: -------------------------------------------------------------------------------- 1 | """Google Benchmark tooling""" 2 | 3 | __author__ = 'Eric Fiselier' 4 | __email__ = 'eric@efcs.ca' 5 | __versioninfo__ = (0, 5, 0) 6 | __version__ = '.'.join(str(v) for v in __versioninfo__) + 'dev' 7 | 8 | __all__ = [] 9 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.5) 2 | 3 | project (KERNEL CXX C) # check for C/C++ compiler 4 | 5 | set (CMAKE_CXX_STANDARD 11) 6 | set (CMAKE_CXX_FLAGS "-Wno-deprecated-register") 7 | 8 | set (Kernel_Include_Dirs 9 | ${KERNEL_SOURCE_DIR}/src/Kernel/Containers/ 10 | ${KERNEL_SOURCE_DIR}/src/Kernel/Abstractions/ 11 | ${KERNEL_SOURCE_DIR}/src/Kernel/Types/ 12 | ${KERNEL_SOURCE_DIR}/src/System/Misc/ 13 | ${KERNEL_SOURCE_DIR}/src/System/Files/ 14 | ${KERNEL_SOURCE_DIR}/src/Data/String/ 15 | ${KERNEL_SOURCE_DIR}/src/Data/Drd/ 16 | ${KERNEL_SOURCE_DIR}/src/Data/Tree/ 17 | ) 18 | 19 | file (GLOB_RECURSE Kernel_SRCS 20 | "${KERNEL_SOURCE_DIR}/src/Kernel/*.cpp" 21 | "${KERNEL_SOURCE_DIR}/src/System/*.cpp" 22 | "${KERNEL_SOURCE_DIR}/src/Data/*.cpp" 23 | ) 24 | 25 | include_directories(${Kernel_Include_Dirs}) 26 | 27 | add_library(kernel STATIC ${Kernel_SRCS}) 28 | 29 | ### -------------------------------------------------------------------- 30 | ### Testing 31 | ### -------------------------------------------------------------------- 32 | include (CTest) 33 | set (GTEST_ROOT "${KERNEL_SOURCE_DIR}/3rdparty/benchmark/googletest/googletest") 34 | set (GTEST_INCLUDE_DIR ${GTEST_ROOT}/include) 35 | set (GTEST_LIBRARIES gtest gtest_main) 36 | set (GTEST_MAIN_LIBRARY gtest_main) 37 | set (GTEST_LIBRARY gtest) 38 | 39 | add_subdirectory (3rdparty/benchmark EXCLUDE_FROM_ALL) 40 | add_subdirectory (${GTEST_ROOT} EXCLUDE_FROM_ALL) 41 | find_package (GTest REQUIRED) 42 | 43 | enable_testing () 44 | 45 | add_subdirectory (tests) 46 | add_subdirectory (benchmark) 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Collection for GNU TeXmacs 2 | [![Join the chat at https://gitter.im/texmacs/Lobby](https://badges.gitter.im/texmacs/Lobby.svg)](https://gitter.im/texmacs/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 3 | 4 | ## Goals 5 | Extract the Kernel of GNU TeXmacs with minimum modification. 6 | Git diffs on source code of this project should be easily backported to the SVN repo. 7 | 8 | ## GSoC NOTICE 9 | GSoC students **all over the world** are welcome to contribute on GNU TeXmacs starting from this project. 10 | -------------------------------------------------------------------------------- /benchmark/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB_RECURSE BENCH_SRC_FILES "*.cpp") 2 | 3 | include_directories(../3rdparty/benchmark/include) 4 | 5 | # from list of files we'll create tests test_name.cpp -> test_name 6 | foreach (_bench_file ${BENCH_SRC_FILES}) 7 | get_filename_component (_bench_name ${_bench_file} NAME_WE) 8 | add_executable (${_bench_name} 9 | ${_bench_file} 10 | ) 11 | target_link_libraries (${_bench_name} 12 | kernel 13 | benchmark_main 14 | ) 15 | endforeach () 16 | -------------------------------------------------------------------------------- /benchmark/Kernel/Containers/list_bench.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "list.hpp" 3 | 4 | 5 | static list gen(int64_t n) { 6 | auto normal = list(); 7 | for (long i=0; iArg(1) 19 | ->Arg(2) 20 | ->Arg(4) 21 | ->Arg(8) 22 | ->Arg(16) 23 | ->Arg(32) 24 | ->Arg(64) 25 | ->Arg(128) 26 | ->Arg(256) 27 | ->Arg(512) 28 | ->Arg(1024); 29 | -------------------------------------------------------------------------------- /src/Data/Drd/drd_mode.hpp: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | * MODULE : drd_mode.hpp 4 | * DESCRIPTION: global variables that affect drd-based routines 5 | * COPYRIGHT : (C) 2005 Joris van der Hoeven 6 | ******************************************************************************* 7 | * This software falls under the GNU general public license version 3 or later. 8 | * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE 9 | * in the root directory or . 10 | ******************************************************************************/ 11 | 12 | #ifndef DRD_MODE_H 13 | #define DRD_MODE_H 14 | 15 | #define DRD_ACCESS_NORMAL 0 16 | #define DRD_ACCESS_HIDDEN 1 17 | #define DRD_ACCESS_SOURCE 2 18 | 19 | #define DRD_WRITABLE_NORMAL 0 20 | #define DRD_WRITABLE_INPUT 1 21 | #define DRD_WRITABLE_ANY 2 22 | 23 | int set_access_mode (int mode); 24 | int get_access_mode (); 25 | int set_writable_mode (int mode); 26 | int get_writable_mode (); 27 | 28 | #endif // defined DRD_MODE_H 29 | -------------------------------------------------------------------------------- /src/Data/Drd/drd_std.hpp: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | * MODULE : drd_std.hpp 4 | * DESCRIPTION: standard drd for TeXmacs; most other drd's inherit from it 5 | * COPYRIGHT : (C) 2003 Joris van der Hoeven 6 | ******************************************************************************* 7 | * This software falls under the GNU general public license version 3 or later. 8 | * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE 9 | * in the root directory or . 10 | ******************************************************************************/ 11 | 12 | #ifndef DRD_STD_H 13 | #define DRD_STD_H 14 | #include "drd_info.hpp" 15 | 16 | extern drd_info std_drd; 17 | extern drd_info the_drd; 18 | extern hashmap STD_CODE; 19 | 20 | inline bool std_contains (string s) { return STD_CODE->contains (s); } 21 | 22 | void init_std_drd (); 23 | 24 | struct with_drd { 25 | drd_info old_drd; 26 | inline with_drd (drd_info new_drd): old_drd (the_drd) { the_drd= new_drd; } 27 | inline ~with_drd () { the_drd= old_drd; } 28 | }; 29 | 30 | #endif // defined DRD_STD_H 31 | -------------------------------------------------------------------------------- /src/Data/Tree/tree_cursor.hpp: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | * MODULE : tree_cursor.hpp 4 | * DESCRIPTION: abstract cursor handling 5 | * COPYRIGHT : (C) 1999 Joris van der Hoeven 6 | ******************************************************************************* 7 | * This software falls under the GNU general public license version 3 or later. 8 | * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE 9 | * in the root directory or . 10 | ******************************************************************************/ 11 | 12 | #ifndef TREE_CURSOR_H 13 | #define TREE_CURSOR_H 14 | #include "path.hpp" 15 | 16 | bool is_inside (tree t, path p); 17 | path closest_inside (tree t, path p); 18 | bool is_accessible_cursor (tree t, path p); 19 | path closest_accessible (tree t, path p, int dir= 0); 20 | path closest_accessible_inside (tree t, path p, int dir= 0); 21 | void show_hidden_upwards (tree t, path p); 22 | 23 | bool valid_cursor (tree t, path p, bool start_flag= false); 24 | path start (tree t, path p); 25 | path end (tree t, path p); 26 | path start (tree t); 27 | path end (tree t); 28 | path correct_cursor (tree t, path p, bool forwards= false); 29 | path super_correct (tree t, path p, bool forwards= false); 30 | path shift (tree t, path p, int dir); 31 | 32 | #endif // defined TREE_CURSOR_H 33 | -------------------------------------------------------------------------------- /src/Kernel/Abstractions/blackbox.hpp: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | * MODULE : blackbox.hpp 4 | * DESCRIPTION: For hiding the implementation of a type 5 | * COPYRIGHT : (C) 2005 Joris van der Hoeven 6 | ******************************************************************************* 7 | * This software falls under the GNU general public license version 3 or later. 8 | * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE 9 | * in the root directory or . 10 | ******************************************************************************/ 11 | 12 | #ifndef BLACKBOX_H 13 | #define BLACKBOX_H 14 | #include "basic.hpp" 15 | 16 | class blackbox_rep: public abstract_struct { 17 | public: 18 | inline blackbox_rep () {} 19 | inline virtual ~blackbox_rep () {} 20 | virtual int get_type () = 0; 21 | virtual bool equal (blackbox_rep* ptr) = 0; 22 | virtual tm_ostream& display (tm_ostream& out) = 0; 23 | }; 24 | 25 | class blackbox { 26 | public: 27 | ABSTRACT_NULL(blackbox); 28 | }; 29 | ABSTRACT_NULL_CODE(blackbox); 30 | 31 | template 32 | class whitebox_rep: public blackbox_rep { 33 | public: 34 | T data; 35 | public: 36 | inline whitebox_rep (const T& data2): data (data2) {} 37 | inline ~whitebox_rep () {} 38 | inline int get_type () { return type_helper::id; } 39 | inline bool equal (blackbox_rep* ptr) { 40 | return ptr != NULL && ptr->get_type () == type_helper::id && 41 | ((whitebox_rep*) ptr)->data == data; } 42 | inline tm_ostream& display (tm_ostream& out) { return out << data; } 43 | }; 44 | 45 | inline bool operator == (blackbox bb1, blackbox bb2) { 46 | if (is_nil (bb1)) return is_nil (bb2); 47 | else return bb1->equal (bb2.rep); } 48 | inline bool operator != (blackbox bb1, blackbox bb2) { 49 | if (is_nil (bb1)) return !is_nil (bb2); 50 | else return !bb1->equal (bb2.rep); } 51 | inline tm_ostream& operator << (tm_ostream& out, blackbox bb) { 52 | if (is_nil (bb)) return out << "nil"; 53 | else return bb->display (out); } 54 | 55 | inline int 56 | type_box (blackbox bb) { 57 | return is_nil (bb)? 0: bb->get_type (); 58 | } 59 | 60 | template blackbox 61 | close_box (const T& data) { 62 | return tm_new > (data); 63 | } 64 | 65 | template T 66 | open_box (blackbox bb) { 67 | ASSERT (type_box (bb) == type_helper::id, "type mismatch"); 68 | return ((whitebox_rep*) bb.rep) -> data; 69 | } 70 | 71 | #endif // BLACKBOX_H 72 | -------------------------------------------------------------------------------- /src/Kernel/Containers/hashfunc.cpp: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | * MODULE : hashfunc.cpp 4 | * DESCRIPTION: fixed size hashfuncs with reference counting 5 | * COPYRIGHT : (C) 1999 Joris van der Hoeven 6 | ******************************************************************************* 7 | * This software falls under the GNU general public license version 3 or later. 8 | * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE 9 | * in the root directory or . 10 | ******************************************************************************/ 11 | 12 | #ifndef HASHFUNC_CC 13 | #define HASHFUNC_CC 14 | #include "hashfunc.hpp" 15 | 16 | template U 17 | hashfunc_rep::apply (T x) { 18 | if (remember->contains (x)) return remember[x]; 19 | U y= func (x); 20 | remember(x)= y; 21 | return y; 22 | } 23 | 24 | #endif // defined HASHFUNC_CC 25 | -------------------------------------------------------------------------------- /src/Kernel/Containers/hashfunc.hpp: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | * MODULE : hashfunc.hpp 4 | * DESCRIPTION: functions with a memorizing hash table 5 | * COPYRIGHT : (C) 1999 Joris van der Hoeven 6 | ******************************************************************************* 7 | * This software falls under the GNU general public license version 3 or later. 8 | * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE 9 | * in the root directory or . 10 | ******************************************************************************/ 11 | 12 | #ifndef HASHFUNC_H 13 | #define HASHFUNC_H 14 | #include "hashmap.hpp" 15 | 16 | template class hashfunc_rep: public concrete_struct { 17 | U (*func) (T); // the function 18 | hashmap remember; // remembered values 19 | public: 20 | inline hashfunc_rep (U (*func2) (T), U init): 21 | func (func2), remember (init) {} 22 | U apply (T x); 23 | }; 24 | 25 | template class hashfunc { 26 | CONCRETE_TEMPLATE_2(hashfunc,T,U); 27 | inline hashfunc (U (*func) (T), U init): 28 | rep (tm_new > (func, init)) {} 29 | inline U operator [] (T x) { return rep->apply (x); } 30 | // operator tree (); 31 | }; 32 | CONCRETE_TEMPLATE_2_CODE(hashfunc,class,T,class,U); 33 | 34 | #include "hashfunc.cpp" 35 | 36 | #endif // defined HASHFUNC_H 37 | -------------------------------------------------------------------------------- /src/Kernel/Containers/iterator.hpp: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | * MODULE : iterator.hpp 4 | * DESCRIPTION: dynamic iterators 5 | * COPYRIGHT : (C) 1999 Joris van der Hoeven 6 | ******************************************************************************* 7 | * This software falls under the GNU general public license version 3 or later. 8 | * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE 9 | * in the root directory or . 10 | ******************************************************************************/ 11 | 12 | #ifndef ITERATOR_H 13 | #define ITERATOR_H 14 | #include "hashset.hpp" 15 | #include "hashmap.hpp" 16 | 17 | extern int iterator_count; 18 | 19 | template class iterator_rep: public abstract_struct { 20 | public: 21 | inline iterator_rep () { TM_DEBUG(iterator_count++); } 22 | inline virtual ~iterator_rep () { TM_DEBUG(iterator_count--); } 23 | virtual bool busy () = 0; 24 | virtual T next () = 0; 25 | virtual int remains (); 26 | }; 27 | 28 | template struct iterator { 29 | ABSTRACT_TEMPLATE(iterator,T); 30 | operator tree (); 31 | }; 32 | ABSTRACT_TEMPLATE_CODE(iterator,class,T); 33 | 34 | template tm_ostream& operator << (tm_ostream& out, iterator it); 35 | 36 | template iterator iterate (hashmap h); 37 | template iterator iterate (hashset h); 38 | 39 | #include "iterator.cpp" 40 | 41 | #endif // defined ITERATOR_H 42 | -------------------------------------------------------------------------------- /src/Kernel/Containers/promise.hpp: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | * MODULE : promise.hpp 4 | * DESCRIPTION: promises 5 | * COPYRIGHT : (C) 2007 Joris van der Hoeven 6 | ******************************************************************************* 7 | * This software falls under the GNU general public license version 3 or later. 8 | * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE 9 | * in the root directory or . 10 | ******************************************************************************/ 11 | 12 | #ifndef PROMISE_H 13 | #define PROMISE_H 14 | // #include "tree.hpp" 15 | 16 | // class tree; 17 | template class promise_rep; 18 | template class promise; 19 | template tm_ostream& operator << (tm_ostream& out, promise cmd); 20 | template bool is_nil (promise l); 21 | 22 | template 23 | class promise_rep: public abstract_struct { 24 | public: 25 | inline promise_rep () {} 26 | inline virtual ~promise_rep () {} 27 | inline virtual tm_ostream& print (tm_ostream& out); 28 | virtual T eval () = 0; 29 | }; 30 | 31 | template 32 | class promise { 33 | public: 34 | ABSTRACT_NULL_TEMPLATE(promise,T); 35 | inline T operator () (); 36 | friend tm_ostream& operator << LESSGTR (tm_ostream& out, promise cmd); 37 | }; 38 | ABSTRACT_NULL_TEMPLATE_CODE(promise,class,T); 39 | 40 | #define TMPL template 41 | TMPL inline tm_ostream& promise_rep::print (tm_ostream& out) { 42 | return out << "promise"; } 43 | TMPL inline T promise::operator () () { 44 | return rep->eval (); } 45 | TMPL inline bool operator == (promise mw1, promise mw2) { 46 | return mw1.rep == mw2.rep; } 47 | TMPL inline tm_ostream& operator << (tm_ostream& out, promise cmd) { 48 | if (is_nil (cmd)) return out << "(null)"; else return cmd->print(out); } 49 | #undef TMPL 50 | 51 | #endif // defined PROMISE_H 52 | -------------------------------------------------------------------------------- /src/Kernel/Containers/rel_hashmap.hpp: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | * MODULE : rel_hashmap.hpp 4 | * DESCRIPTION: see rel_hashmap.cpp 5 | * COPYRIGHT : (C) 1999 Joris van der Hoeven 6 | ******************************************************************************* 7 | * This software falls under the GNU general public license version 3 or later. 8 | * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE 9 | * in the root directory or . 10 | ******************************************************************************/ 11 | 12 | #ifndef REL_HASMAP_H 13 | #define REL_HASMAP_H 14 | #include "hashmap.hpp" 15 | 16 | template class rel_hashmap; 17 | template class rel_hashmap_rep; 18 | template bool is_nil (rel_hashmap h); 19 | 20 | template class rel_hashmap { 21 | CONCRETE_NULL_TEMPLATE_2(rel_hashmap,T,U); 22 | inline rel_hashmap (U init); 23 | inline rel_hashmap (hashmap item); 24 | inline rel_hashmap (hashmap item, rel_hashmap next); 25 | U operator [] (T x); 26 | U& operator () (T x); 27 | }; 28 | 29 | template class rel_hashmap_rep: concrete_struct { 30 | public: 31 | hashmap item; 32 | rel_hashmap next; 33 | 34 | inline rel_hashmap_rep (hashmap item2, rel_hashmap next2): 35 | item(item2), next(next2) {} 36 | bool contains (T x); 37 | void extend (); 38 | void shorten (); 39 | void merge (); 40 | void find_changes (hashmap& CH); 41 | void find_differences (hashmap& CH); 42 | void change (hashmap CH); 43 | 44 | friend class rel_hashmap; 45 | }; 46 | 47 | CONCRETE_NULL_TEMPLATE_2_CODE(rel_hashmap,class,T,class,U); 48 | #define TMPL template 49 | TMPL inline rel_hashmap::rel_hashmap (U init): 50 | rep (tm_new > (hashmap (init), rel_hashmap ())) {} 51 | TMPL inline rel_hashmap::rel_hashmap (hashmap item): 52 | rep (tm_new > (item, rel_hashmap ())) {} 53 | TMPL inline rel_hashmap::rel_hashmap 54 | (hashmap item, rel_hashmap next): 55 | rep (tm_new > (item, next)) {} 56 | 57 | TMPL tm_ostream& operator << (tm_ostream& out, rel_hashmap H); 58 | #undef TMPL 59 | 60 | #include "rel_hashmap.cpp" 61 | 62 | #endif // defined REL_HASMAP_H 63 | -------------------------------------------------------------------------------- /src/Kernel/Containers/unary_function.hpp: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | * MODULE : unary_function.hpp 4 | * DESCRIPTION: unary functions 5 | * COPYRIGHT : (C) 2013 Joris van der Hoeven 6 | ******************************************************************************* 7 | * This software falls under the GNU general public license version 3 or later. 8 | * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE 9 | * in the root directory or . 10 | ******************************************************************************/ 11 | 12 | #ifndef UNARY_FUNCTION_H 13 | #define UNARY_FUNCTION_H 14 | // #include "tree.hpp" 15 | 16 | #define TMPL template 17 | 18 | // class tree; 19 | TMPL class unary_function_rep; 20 | TMPL class unary_function; 21 | TMPL bool is_nil (unary_function l); 22 | 23 | TMPL 24 | class unary_function_rep: public abstract_struct { 25 | public: 26 | inline unary_function_rep () {} 27 | inline virtual ~unary_function_rep () {} 28 | virtual T eval (const S& arg) = 0; 29 | }; 30 | 31 | TMPL 32 | class unary_function { 33 | public: 34 | ABSTRACT_NULL_TEMPLATE_2(unary_function,T,S); 35 | inline T operator () (const S& arg); 36 | }; 37 | ABSTRACT_NULL_TEMPLATE_2_CODE(unary_function,typename,T,typename,S); 38 | 39 | TMPL inline T unary_function::operator () (const S& arg) { 40 | return rep->eval (arg); } 41 | 42 | TMPL inline bool 43 | operator == (unary_function mw1, unary_function mw2) { 44 | return mw1.rep == mw2.rep; } 45 | 46 | #undef TMPL 47 | 48 | #endif // defined UNARY_FUNCTION_H 49 | -------------------------------------------------------------------------------- /src/Kernel/Types/generic_tree.hpp: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | * MODULE : generic_tree.hpp 4 | * DESCRIPTION: generic objects as trees 5 | * COPYRIGHT : (C) 2009 Joris van der Hoeven 6 | ******************************************************************************* 7 | * This software falls under the GNU general public license version 3 or later. 8 | * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE 9 | * in the root directory or . 10 | ******************************************************************************/ 11 | 12 | #ifndef GENERIC_TREE_H 13 | #define GENERIC_TREE_H 14 | #include "tree.hpp" 15 | #include "blackbox.hpp" 16 | 17 | class generic_rep: public tree_rep { 18 | public: 19 | blackbox data; 20 | template inline generic_rep (const T& x): 21 | tree_rep ((tree_label) type_helper::id), 22 | data (close_box (x)) {} 23 | friend class tree; 24 | }; 25 | 26 | inline blackbox 27 | as_blackbox (const tree& t) { 28 | return ((generic_rep*) t.rep) -> data; 29 | } 30 | 31 | template 32 | struct convert_helper { 33 | static inline T op (const F& x) { return (T) x; } 34 | }; 35 | 36 | template 37 | struct convert_helper { 38 | static inline tree op (const F& data) { 39 | return tree ((tree_rep*) tm_new (data)); } 40 | }; 41 | 42 | template 43 | struct convert_helper { 44 | static inline T op (const tree& t) { 45 | return open_box (as_blackbox (t)); } 46 | }; 47 | 48 | template inline bool is (const tree& t) { 49 | return ((int) L(t)) == type_helper::id; } 50 | template inline T as (const F& t) { 51 | return convert_helper::op (t); } 52 | 53 | #endif // defined GENERIC_TREE_H 54 | -------------------------------------------------------------------------------- /src/Kernel/Types/parse_string.hpp: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | * MODULE : parse_string.hpp 4 | * DESCRIPTION: strings from which it is both easy to read and write characters 5 | * they are used for entity replacement in the XML parser 6 | * COPYRIGHT : (C) 2005 Joris van der Hoeven 7 | ******************************************************************************* 8 | * This software falls under the GNU general public license version 3 or later. 9 | * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE 10 | * in the root directory or . 11 | ******************************************************************************/ 12 | 13 | #ifndef PARSE_STRING_H 14 | #define PARSE_STRING_H 15 | #include "string.hpp" 16 | #include "list.hpp" 17 | 18 | class parse_string; 19 | class parse_string_rep: concrete_struct { 20 | list l; // strings left to parse 21 | list p; // positions in each string 22 | 23 | public: 24 | inline parse_string_rep (): l (), p () {} 25 | inline parse_string_rep (string s): l (s), p (0) {} 26 | inline ~parse_string_rep () {} 27 | 28 | void advance (int n); 29 | string read (int n); 30 | void write (string s); 31 | char get_char (int n); 32 | string get_string (int n); 33 | bool test (string s); 34 | 35 | friend class parse_string; 36 | friend tm_ostream& operator << (tm_ostream& out, parse_string s); 37 | friend bool test (parse_string s, string what); 38 | }; 39 | 40 | class parse_string { 41 | CONCRETE(parse_string); 42 | inline parse_string (): rep (tm_new ()) {} 43 | inline parse_string (string s): rep (tm_new (s)) {} 44 | inline char operator [] (int i) { return rep->get_char (i); } 45 | inline operator bool () { return !is_nil (rep->l); } 46 | inline void operator += (int i) { rep->advance (i); } 47 | }; 48 | CONCRETE_CODE(parse_string); 49 | 50 | bool test (parse_string s, string what); 51 | 52 | #endif // defined PARSE_STRING_H 53 | -------------------------------------------------------------------------------- /src/Kernel/Types/path.hpp: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | * MODULE : path.hpp 4 | * DESCRIPTION: paths are integer lists, 5 | * which are for instance useful to select subtrees in trees 6 | * COPYRIGHT : (C) 1999 Joris van der Hoeven 7 | ******************************************************************************* 8 | * This software falls under the GNU general public license version 3 or later. 9 | * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE 10 | * in the root directory or . 11 | ******************************************************************************/ 12 | 13 | #ifndef PATH_H 14 | #define PATH_H 15 | #include "list.hpp" 16 | typedef list path; 17 | #include "tree_cursor.hpp" 18 | 19 | /****************************************************************************** 20 | * General routines 21 | ******************************************************************************/ 22 | 23 | bool zero_path (path p); 24 | int hash (path p); 25 | string as_string (path p); 26 | path as_path (string s); 27 | bool version_inf_eq (string v1, string v2); 28 | bool version_inf (string v1, string v2); 29 | 30 | /****************************************************************************** 31 | * Operations on paths 32 | ******************************************************************************/ 33 | 34 | path path_up (path p); 35 | path path_up (path p, int times); 36 | bool path_inf (path p1, path p2); 37 | bool path_inf_eq (path p1, path p2); 38 | bool path_less (path p1, path p2); 39 | bool path_less_eq (path p1, path p2); 40 | path path_add (path p, int plus); 41 | path path_add (path p, int plus, int pos); 42 | #define path_inc(p) path_add(p,1) 43 | #define path_dec(p) path_add(p,-1) 44 | path operator / (path p, path q); 45 | path common (path start, path end); 46 | inline path strip (path p, path q) { return p / q; } 47 | 48 | /****************************************************************************** 49 | * Getting subtrees from paths 50 | ******************************************************************************/ 51 | 52 | bool has_subtree (tree t, path p); 53 | tree& subtree (tree& t, path p); 54 | tree& parent_subtree (tree& t, path p); 55 | 56 | #endif // defined PATH_H 57 | -------------------------------------------------------------------------------- /src/Kernel/Types/tree_label.cpp: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | * MODULE : tree_label.cpp 4 | * DESCRIPTION: labels of trees 5 | * COPYRIGHT : (C) 1999 Joris van der Hoeven 6 | ******************************************************************************* 7 | * This software falls under the GNU general public license version 3 or later. 8 | * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE 9 | * in the root directory or . 10 | ******************************************************************************/ 11 | 12 | #include "tree_label.hpp" 13 | #include "hashmap.hpp" 14 | 15 | hashmap CONSTRUCTOR_NAME ("?"); 16 | hashmap CONSTRUCTOR_CODE (UNKNOWN); 17 | 18 | /****************************************************************************** 19 | * Setting up the conversion tables 20 | ******************************************************************************/ 21 | 22 | static tree_label next_tree_label= START_EXTENSIONS; 23 | 24 | void 25 | make_tree_label (tree_label l, string s) { 26 | CONSTRUCTOR_NAME ((int) l) = s; 27 | CONSTRUCTOR_CODE (s) = (int) l; 28 | } 29 | 30 | tree_label 31 | make_tree_label (string s) { 32 | if (CONSTRUCTOR_CODE->contains (s)) 33 | return (tree_label) CONSTRUCTOR_CODE[s]; 34 | tree_label l= next_tree_label; 35 | next_tree_label= (tree_label) (((int) next_tree_label) + 1); 36 | make_tree_label (l, s); 37 | return l; 38 | } 39 | 40 | /****************************************************************************** 41 | * Conversions between tree_labels and strings 42 | ******************************************************************************/ 43 | 44 | string 45 | as_string (tree_label l) { 46 | return CONSTRUCTOR_NAME[(int) l]; 47 | } 48 | 49 | tree_label 50 | as_tree_label (string s) { 51 | return (tree_label) CONSTRUCTOR_CODE[s]; 52 | } 53 | 54 | bool 55 | existing_tree_label (string s) { 56 | return CONSTRUCTOR_CODE->contains (s); 57 | } 58 | -------------------------------------------------------------------------------- /src/System/Misc/tm_configure.hpp: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | * MODULE : tm_configure.gen.in or tm_configure.gen.h 4 | * DESCRIPTION: Defines system dependent macros (using autoconf) 5 | * COPYRIGHT : (C) 1999 Joris van der Hoeven 6 | ******************************************************************************* 7 | * This software falls under the GNU general public license version 3 or later. 8 | * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE 9 | * in the root directory or . 10 | ******************************************************************************/ 11 | 12 | #ifndef TM_CONFIGURE_H 13 | #define TM_CONFIGURE_H 14 | 15 | #define STD_SETENV 16 | 17 | #define TEXMACS_VERSION "1.99.8" 18 | #define TEXMACS_SOURCES "" 19 | #define OS_GNU_LINUX 20 | #define WORD_LENGTH 8 21 | #define WORD_LENGTH_INC 7 22 | #define WORD_MASK 0xfffffffffffffff8 23 | #define MAX_FAST 264 // WORD_LENGTH more than power of 2 24 | 25 | #define HOST_OS "linux-gnu" 26 | #define HOST_VENDOR "pc" 27 | #define HOST_CPU "x86_64" 28 | #define BUILD_USER "rendong" 29 | #define BUILD_DATE "2018-12-23T21:14:12" 30 | 31 | #define TM_DEVEL "TeXmacs-1.99.8" 32 | #define TM_DEVEL_RELEASE "TeXmacs-1.99.8-1" 33 | #define TM_STABLE "TeXmacs-1.99.8" 34 | #define TM_STABLE_RELEASE "TeXmacs-1.99.8-1" 35 | 36 | #endif // defined TM_CONFIGURE_H 37 | -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB_RECURSE TEST_SRC_FILES "*.cpp") 2 | 3 | # from list of files we'll create tests test_name.cpp -> test_name 4 | foreach (_test_file ${TEST_SRC_FILES}) 5 | get_filename_component (_test_name ${_test_file} NAME_WE) 6 | add_executable (${_test_name} 7 | ${_test_file} 8 | ) 9 | target_link_libraries (${_test_name} 10 | ${GTEST_LIBRARY} 11 | ${GTEST_MAIN_LIBRARY} 12 | kernel 13 | ) 14 | add_test (${_test_name} ${_test_name}) 15 | set_tests_properties (${_test_name} PROPERTIES TIMEOUT 5) 16 | endforeach () 17 | -------------------------------------------------------------------------------- /tests/Data/String/analyze_test.cpp: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | * MODULE : analyze_test.cpp 4 | * DESCRIPTION: Properties of characters and strings 5 | * COPYRIGHT : (C) 2019 Darcy Shen 6 | ******************************************************************************* 7 | * This software falls under the GNU general public license version 3 or later. 8 | * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE 9 | * in the root directory or . 10 | ******************************************************************************/ 11 | 12 | #include "gtest/gtest.h" 13 | 14 | #include "analyze.hpp" 15 | 16 | TEST (string, is_alpha) { 17 | for (unsigned char c=0; c<255; c++) { 18 | if ((c>=65 && c<=90) || (c>=97 && c<=122)) { 19 | ASSERT_TRUE (is_alpha (c)); 20 | } else { 21 | ASSERT_FALSE (is_alpha (c)); 22 | } 23 | } 24 | } 25 | 26 | TEST (string, locase_all) { 27 | ASSERT_TRUE (locase_all (string ("true")) == string ("true")); 28 | ASSERT_TRUE (locase_all (string ("TRue")) == string ("true")); 29 | ASSERT_TRUE (locase_all (string ("TRUE")) == string ("true")); 30 | ASSERT_TRUE (locase_all (string ("123TRUE")) == string ("123true")); 31 | } 32 | 33 | TEST (string, upcase_all) { 34 | ASSERT_TRUE (upcase_all (string ("true")) == string ("TRUE")); 35 | ASSERT_TRUE (upcase_all (string ("TRue")) == string ("TRUE")); 36 | ASSERT_TRUE (upcase_all (string ("TRUE")) == string ("TRUE")); 37 | ASSERT_TRUE (upcase_all (string ("123true")) == string ("123TRUE")); 38 | } 39 | 40 | TEST (string, string_minus) { 41 | ASSERT_TRUE (string_minus ("Hello World", "eo") == string ("Hll Wrld")); 42 | ASSERT_TRUE (string_minus ("", "abc") == string ("")); 43 | ASSERT_TRUE (string_minus ("abc", "") == string ("abc")); 44 | } 45 | 46 | TEST (string, string_union) { 47 | ASSERT_TRUE (string_union ("abc", "") == string("abc")); 48 | ASSERT_TRUE (string_union ("", "abc") == string("abc")); 49 | ASSERT_TRUE (string_union ("Hello World", "eo") == string ("Hll Wrldeo")); 50 | } 51 | 52 | TEST (string, starts) { 53 | ASSERT_TRUE (starts ("abc_def", "abc")); 54 | ASSERT_FALSE (starts ("abc_def", "def")); 55 | ASSERT_TRUE (starts ("abc", "")); 56 | ASSERT_TRUE (starts ("", "")); 57 | } 58 | 59 | TEST (string, ends) { 60 | ASSERT_TRUE (ends ("abc_def", "def")); 61 | ASSERT_TRUE (ends ("abc_def", "")); 62 | ASSERT_FALSE (ends ("abc_def", "de")); 63 | } 64 | -------------------------------------------------------------------------------- /tests/Kernel/Types/tree_test.cpp: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | * MODULE : tree_test.cpp 4 | * DESCRIPTION: Tests on tree 5 | * COPYRIGHT : (C) 2019 Darcy Shen 6 | ******************************************************************************* 7 | * This software falls under the GNU general public license version 3 or later. 8 | * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE 9 | * in the root directory or . 10 | ******************************************************************************/ 11 | 12 | #include "gtest/gtest.h" 13 | 14 | #include "tree.hpp" 15 | 16 | TEST (tree, is_atomic) { 17 | ASSERT_TRUE (is_atomic (tree ())); 18 | } 19 | 20 | TEST (tree, is_tuple) { 21 | ASSERT_TRUE (is_tuple (tuple ())); 22 | ASSERT_TRUE (is_tuple (tuple (tree ()))); 23 | ASSERT_TRUE (is_tuple (tuple (tree (), tree ()))); 24 | ASSERT_TRUE (is_tuple (tuple (tree (), tree (), tree ()))); 25 | ASSERT_TRUE (is_tuple (tuple (tree (), tree (), tree (), tree ()))); 26 | ASSERT_TRUE (is_tuple (tuple (tree (), tree (), tree (), tree (), tree ()))); 27 | } 28 | 29 | TEST (tree, is_concat) { 30 | ASSERT_TRUE (is_concat (concat ())); 31 | ASSERT_TRUE (is_concat (concat (tree ()))); 32 | ASSERT_TRUE (is_concat (concat (tree (), tree ()))); 33 | ASSERT_TRUE (is_concat (concat (tree (), tree (), tree ()))); 34 | ASSERT_TRUE (is_concat (concat (tree (), tree (), tree (), tree ()))); 35 | ASSERT_TRUE (is_concat (concat (tree (), tree (), tree (), tree (), tree ()))); 36 | } --------------------------------------------------------------------------------