├── .gitignore ├── README.md ├── benchmarkLibsTest.sln ├── celeroTest ├── Celero-master.zip ├── Celero-master │ ├── .gitattributes │ ├── .gitignore │ ├── .travis.yml │ ├── ALL_BUILD.vcxproj │ ├── ALL_BUILD.vcxproj.filters │ ├── CMakeLists.txt │ ├── CONTRIBUTING.md │ ├── CeleroProject.sln │ ├── Doxyfile │ ├── INSTALL.vcxproj │ ├── INSTALL.vcxproj.filters │ ├── README.md │ ├── ZERO_CHECK.vcxproj │ ├── ZERO_CHECK.vcxproj.filters │ ├── celero.vcxproj │ ├── celero.vcxproj.filters │ ├── experiments │ │ ├── CMakeLists.txt │ │ ├── DemoDoNotOptimizeAway │ │ │ ├── CMakeLists.txt │ │ │ └── DemoDoNotOptimizeAway.cpp │ │ ├── DemoFileWrite │ │ │ ├── CMakeLists.txt │ │ │ └── DemoFileWrite.cpp │ │ ├── DemoMultithread │ │ │ ├── CMakeLists.txt │ │ │ └── DemoMultithread.cpp │ │ ├── DemoSimple │ │ │ ├── CMakeLists.txt │ │ │ └── DemoSimple.cpp │ │ ├── DemoSimpleJUnit │ │ │ ├── CMakeLists.txt │ │ │ └── DemoSimpleJUnit.cpp │ │ ├── DemoSleep │ │ │ ├── CMakeLists.txt │ │ │ └── DemoSleep.cpp │ │ ├── DemoToString │ │ │ ├── CMakeLists.txt │ │ │ └── DemoToString.cpp │ │ ├── DemoTransform │ │ │ ├── CMakeLists.txt │ │ │ └── DemoTransform.cpp │ │ ├── ExperimentCostOfPimpl │ │ │ ├── CMakeLists.txt │ │ │ └── ExperimentCostOfPimpl.cpp │ │ ├── ExperimentParameterPassing │ │ │ ├── CMakeLists.txt │ │ │ └── ExperimentParameterPassing.cpp │ │ ├── ExperimentSimpleComparison │ │ │ ├── CMakeLists.txt │ │ │ └── ExperimentSimpleComparison.cpp │ │ └── ExperimentSortingRandomInts │ │ │ ├── CMakeLists.txt │ │ │ └── ExperimentSortingRandomInts.cpp │ ├── include │ │ └── celero │ │ │ ├── Archive.h │ │ │ ├── Benchmark.h │ │ │ ├── Callbacks.h │ │ │ ├── Celero.h │ │ │ ├── CommandLine.h │ │ │ ├── Console.h │ │ │ ├── Distribution.h │ │ │ ├── Executor.h │ │ │ ├── Experiment.h │ │ │ ├── Export.h │ │ │ ├── Factory.h │ │ │ ├── FileReader.h │ │ │ ├── GenericFactory.h │ │ │ ├── JUnit.h │ │ │ ├── Pimpl.h │ │ │ ├── PimplImpl.h │ │ │ ├── Print.h │ │ │ ├── Result.h │ │ │ ├── ResultTable.h │ │ │ ├── Statistics.h │ │ │ ├── TestFixture.h │ │ │ ├── TestVector.h │ │ │ ├── ThreadLocal.h │ │ │ ├── ThreadTestFixture.h │ │ │ ├── Timer.h │ │ │ └── Utilities.h │ ├── license.txt │ └── src │ │ ├── Archive.cpp │ │ ├── Benchmark.cpp │ │ ├── Callbacks.cpp │ │ ├── Celero.cpp │ │ ├── Console.cpp │ │ ├── Distribution.cpp │ │ ├── Executor.cpp │ │ ├── Experiment.cpp │ │ ├── JUnit.cpp │ │ ├── Print.cpp │ │ ├── Result.cpp │ │ ├── ResultTable.cpp │ │ ├── Statistics.cpp │ │ ├── TestFixture.cpp │ │ ├── TestVector.cpp │ │ ├── ThreadTestFixture.cpp │ │ ├── Timer.cpp │ │ └── Utilities.cpp ├── Release │ └── celeroTest.log ├── celeroCompressBools.cpp ├── celeroCompressBools.vcxproj ├── celeroParticles.cpp ├── celeroParticles.filters ├── celeroParticles.vcxproj ├── celeroTest.cpp ├── celeroTest.vcxproj ├── celeroTest.vcxproj.filters └── celeroTest.vcxproj.user ├── commonTest.h ├── googleBenchmarkTest ├── benchmark-master32 │ ├── .gitignore │ ├── .travis-setup.sh │ ├── .travis.yml │ ├── .ycm_extra_conf.py │ ├── ALL_BUILD.vcxproj │ ├── ALL_BUILD.vcxproj.filters │ ├── AUTHORS │ ├── CMakeLists.txt │ ├── CONTRIBUTING.md │ ├── CONTRIBUTORS │ ├── INSTALL.vcxproj │ ├── INSTALL.vcxproj.filters │ ├── LICENSE │ ├── README.md │ ├── RUN_TESTS.vcxproj │ ├── RUN_TESTS.vcxproj.filters │ ├── Win32 │ │ └── MinSizeRel │ │ │ └── ZERO_CHECK │ │ │ └── ZERO_CHECK.tlog │ │ │ ├── ZERO_CHECK.lastbuildstate │ │ │ ├── custombuild.command.1.tlog │ │ │ ├── custombuild.read.1.tlog │ │ │ └── custombuild.write.1.tlog │ ├── ZERO_CHECK.vcxproj │ ├── ZERO_CHECK.vcxproj.filters │ ├── appveyor.yml │ ├── benchmark.sln │ ├── cmake │ │ ├── AddCXXCompilerFlag.cmake │ │ ├── CXXFeatureCheck.cmake │ │ ├── GetGitVersion.cmake │ │ ├── gnu_posix_regex.cpp │ │ ├── posix_regex.cpp │ │ ├── std_regex.cpp │ │ ├── steady_clock.cpp │ │ └── thread_safety_attributes.cpp │ ├── include │ │ └── benchmark │ │ │ ├── benchmark.h │ │ │ ├── benchmark_api.h │ │ │ ├── macros.h │ │ │ └── reporter.h │ ├── mingw.py │ ├── src │ │ ├── CMakeLists.txt │ │ ├── INSTALL.vcxproj │ │ ├── INSTALL.vcxproj.filters │ │ ├── MinSizeRel │ │ │ └── benchmark.lib │ │ ├── RUN_TESTS.vcxproj │ │ ├── RUN_TESTS.vcxproj.filters │ │ ├── arraysize.h │ │ ├── benchmark.cc │ │ ├── benchmark.vcxproj │ │ ├── benchmark.vcxproj.filters │ │ ├── check.h │ │ ├── colorprint.cc │ │ ├── colorprint.h │ │ ├── commandlineflags.cc │ │ ├── commandlineflags.h │ │ ├── console_reporter.cc │ │ ├── csv_reporter.cc │ │ ├── cycleclock.h │ │ ├── internal_macros.h │ │ ├── json_reporter.cc │ │ ├── log.cc │ │ ├── log.h │ │ ├── mutex.h │ │ ├── re.h │ │ ├── re_posix.cc │ │ ├── re_std.cc │ │ ├── reporter.cc │ │ ├── sleep.cc │ │ ├── sleep.h │ │ ├── stat.h │ │ ├── string_util.cc │ │ ├── string_util.h │ │ ├── sysinfo.cc │ │ ├── sysinfo.h │ │ ├── walltime.cc │ │ └── walltime.h │ └── test │ │ ├── CMakeLists.txt │ │ ├── INSTALL.vcxproj │ │ ├── INSTALL.vcxproj.filters │ │ ├── RUN_TESTS.vcxproj │ │ ├── RUN_TESTS.vcxproj.filters │ │ ├── basic_test.cc │ │ ├── basic_test.vcxproj │ │ ├── basic_test.vcxproj.filters │ │ ├── benchmark_test.cc │ │ ├── benchmark_test.vcxproj │ │ ├── benchmark_test.vcxproj.filters │ │ ├── cxx03_test.cc │ │ ├── cxx03_test.vcxproj │ │ ├── cxx03_test.vcxproj.filters │ │ ├── filter_test.cc │ │ ├── filter_test.vcxproj │ │ ├── filter_test.vcxproj.filters │ │ ├── fixture_test.cc │ │ ├── fixture_test.vcxproj │ │ ├── fixture_test.vcxproj.filters │ │ ├── map_test.cc │ │ ├── map_test.vcxproj │ │ ├── map_test.vcxproj.filters │ │ ├── options_test.cc │ │ ├── options_test.vcxproj │ │ └── options_test.vcxproj.filters ├── googleBenchmarkParticles.cpp ├── googleBenchmarkParticles.vcxproj ├── googleBenchmarkTest.cpp └── googleBenchmarkTest.vcxproj ├── hayaiTest ├── hayai-master │ ├── .gitignore │ ├── .travis.yml │ ├── AUTHORS.md │ ├── CMakeLists.txt │ ├── LICENSE.md │ ├── README.md │ ├── Vagrantfile │ ├── debian │ │ ├── compat │ │ ├── control │ │ ├── dirs │ │ ├── libhayai-dev.dirs │ │ ├── libhayai-dev.install │ │ ├── rules │ │ └── source │ │ │ └── format │ ├── hayai-config.cmake.in │ ├── sample │ │ ├── CMakeLists.txt │ │ ├── delivery_man.hpp │ │ ├── delivery_man_benchmark.cpp │ │ ├── delivery_man_benchmark_parameterized.cpp │ │ ├── delivery_man_benchmark_parameterized_with_fixture.cpp │ │ ├── delivery_man_benchmark_with_fixture.cpp │ │ └── delivery_man_sleep.cpp │ ├── script │ │ ├── clean │ │ ├── debianize │ │ └── travis-cmake │ ├── src │ │ ├── CMakeLists.txt │ │ ├── hayai.hpp │ │ ├── hayai_benchmarker.hpp │ │ ├── hayai_clock.hpp │ │ ├── hayai_compatibility.hpp │ │ ├── hayai_console.hpp │ │ ├── hayai_console_outputter.hpp │ │ ├── hayai_default_test_factory.hpp │ │ ├── hayai_fixture.hpp │ │ ├── hayai_json_outputter.hpp │ │ ├── hayai_junit_xml_outputter.hpp │ │ ├── hayai_main.hpp │ │ ├── hayai_outputter.hpp │ │ ├── hayai_posix_main.cpp │ │ ├── hayai_test.hpp │ │ ├── hayai_test_descriptor.hpp │ │ ├── hayai_test_factory.hpp │ │ └── hayai_test_result.hpp │ ├── tests │ │ ├── CMakeLists.txt │ │ ├── base.hpp │ │ └── hayai_test_parameter_descriptor.cpp │ └── vendor │ │ └── gtest │ │ ├── CHANGES │ │ ├── CMakeLists.txt │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── README │ │ ├── aclocal.m4 │ │ ├── build-aux │ │ ├── config.guess │ │ ├── config.h.in │ │ ├── config.sub │ │ ├── depcomp │ │ ├── install-sh │ │ ├── ltmain.sh │ │ └── missing │ │ ├── cmake │ │ └── internal_utils.cmake │ │ ├── codegear │ │ ├── gtest.cbproj │ │ ├── gtest.groupproj │ │ ├── gtest_all.cc │ │ ├── gtest_link.cc │ │ ├── gtest_main.cbproj │ │ └── gtest_unittest.cbproj │ │ ├── configure │ │ ├── configure.ac │ │ ├── fused-src │ │ └── gtest │ │ │ ├── gtest-all.cc │ │ │ ├── gtest.h │ │ │ └── gtest_main.cc │ │ ├── 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 │ │ │ ├── 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.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 │ │ ├── libtool.m4 │ │ ├── ltoptions.m4 │ │ ├── ltsugar.m4 │ │ ├── ltversion.m4 │ │ └── lt~obsolete.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 │ │ ├── fuse_gtest_files.py │ │ ├── gen_gtest_pred_impl.py │ │ ├── gtest-config.in │ │ └── pump.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 ├── hayaiTest.cpp ├── hayaiTest.vcxproj └── hayaiTest.vcxproj.filters ├── noniusTest ├── nonius-1.1.2 │ └── nonius │ │ ├── doc │ │ ├── authoring-benchmarks.html │ │ ├── css │ │ │ ├── print.css │ │ │ ├── pygment_trac.css │ │ │ └── stylesheet.css │ │ ├── favicon.png │ │ ├── images │ │ │ ├── body-bg.png │ │ │ ├── highlight-bg.jpg │ │ │ └── hr.png │ │ └── index.html │ │ └── nonius.h++ ├── noniusCompressBools.cpp ├── noniusCompressBools.vcxproj ├── noniusParticles.cpp ├── noniusParticles.filters ├── noniusParticles.vcxproj ├── noniusTest.cpp ├── noniusTest.vcxproj └── noniusTest.vcxproj.filters └── particles.h /README.md: -------------------------------------------------------------------------------- 1 | # benchmarkLibsTest 2 | Micro Benchmark library tests 3 | Library tested: Nonius, Hayai, Celero, Google Benchmark 4 | 5 | Full description can be found in my blog post: http://www.bfilipek.com/2016/01/micro-benchmarking-libraries-for-c.html 6 | 7 | Additional posts: http://www.bfilipek.com/2016/02/revisiting-old-benchmark-vector-of.html 8 | 9 | Google Benchmark lib: http://www.bfilipek.com/2016/05/google-benchmark-library.html 10 | 11 | Packing bools experiment: http://www.bfilipek.com/2017/04/packing-bools.html 12 | -------------------------------------------------------------------------------- /celeroTest/Celero-master.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenbf/benchmarkLibsTest/35cc3c702a929dd9156e10a62e4a15682a1b5c97/celeroTest/Celero-master.zip -------------------------------------------------------------------------------- /celeroTest/Celero-master/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | compiler: 3 | - gcc 4 | # - clang # This is not currently working because it seems to still be looking at GCC include directories. 5 | 6 | before_install: 7 | - echo "yes" | sudo add-apt-repository ppa:kalakris/cmake 8 | - echo "yes" | sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y 9 | - sudo apt-get update -qq 10 | - sudo apt-get install -qq 11 | - sudo apt-get install cmake 12 | # g++4.8.1 13 | - if [ "$CXX" == "g++" ]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi 14 | 15 | # clang 3.4 16 | - if [ "$CXX" == "clang++" ]; then sudo add-apt-repository -y ppa:h-rayflood/llvm; fi 17 | 18 | - sudo apt-get update -qq 19 | 20 | install: 21 | # g++4.8.1 22 | - if [ "$CXX" = "g++" ]; then sudo apt-get install -qq g++-4.8; fi 23 | - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi 24 | - if [ "$CXX" = "g++" ]; then sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90; fi 25 | - if [ "$CXX" = "g++" ]; then sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 90; fi 26 | - if [ "$CXX" = "g++" ]; then sudo apt-get install libstdc++-4.8-dev; fi 27 | 28 | # clang 3.4 29 | - if [ "$CXX" == "clang++" ]; then sudo apt-get install --allow-unauthenticated -qq clang-3.4; fi 30 | - if [ "$CXX" == "clang++" ]; then export CXX="clang++-3.4"; fi 31 | 32 | # command to run tests 33 | script: 34 | - cd /home/travis/build/DigitalInBlue/Celero 35 | - pwd 36 | - mkdir build 37 | - pwd 38 | - cd build 39 | - pwd 40 | - cmake .. 41 | - ls 42 | - make 43 | 44 | branches: 45 | only: 46 | - master 47 | - develop -------------------------------------------------------------------------------- /celeroTest/Celero-master/ALL_BUILD.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/INSTALL.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | CMake Rules 6 | 7 | 8 | 9 | 10 | {F0E2576A-270E-3513-867B-4825C4CC51FB} 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/ZERO_CHECK.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | CMake Rules 6 | 7 | 8 | 9 | 10 | {F0E2576A-270E-3513-867B-4825C4CC51FB} 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/experiments/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(CELERO_ENABLE_EXPERIMENTS) 2 | # Run the SUBDIRLIST macro located in the top level CMakeLists.txt file. 3 | FILE(GLOB _ALL_FILES ./ ./*) 4 | FOREACH(_FILE ${_ALL_FILES}) 5 | IF(IS_DIRECTORY ${_FILE}) 6 | ADD_SUBDIRECTORY(${_FILE}) 7 | ENDIF() 8 | ENDFOREACH() 9 | endif() 10 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/experiments/DemoFileWrite/DemoFileWrite.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | CELERO_MAIN 4 | 5 | class BaseFixture : public celero::TestFixture 6 | { 7 | public: 8 | std::vector> getExperimentValues() const override 9 | { 10 | std::vector> bufferSizes; 11 | bufferSizes.push_back(std::pair(32, 0)); 12 | bufferSizes.push_back(std::pair(64, 0)); 13 | bufferSizes.push_back(std::pair(128, 0)); 14 | bufferSizes.push_back(std::pair(256, 0)); 15 | bufferSizes.push_back(std::pair(512, 0)); 16 | bufferSizes.push_back(std::pair(1024, 0)); 17 | bufferSizes.push_back(std::pair(2048, 0)); 18 | bufferSizes.push_back(std::pair(4096, 0)); 19 | return bufferSizes; 20 | } 21 | 22 | // Scale the experiment values to megabytes. 23 | double getExperimentValueResultScale() const override 24 | { 25 | return 1024.0 * 1024.0; 26 | } 27 | 28 | void setUp(int64_t experimentValue) override 29 | { 30 | for(auto i = 0; i < experimentValue; ++i) 31 | { 32 | this->buffer.push_back(rand() % 256); 33 | } 34 | } 35 | 36 | void tearDown() override 37 | { 38 | this->buffer.clear(); 39 | } 40 | 41 | std::vector buffer; 42 | }; 43 | 44 | class StdFileFixture : public BaseFixture 45 | { 46 | public: 47 | void setUp(int64_t experimentValue) override 48 | { 49 | BaseFixture::setUp(experimentValue); 50 | this->file = fopen("FileWrite.out", "wb"); 51 | } 52 | 53 | void tearDown() override 54 | { 55 | fclose(this->file); 56 | BaseFixture::tearDown(); 57 | } 58 | 59 | FILE* file; 60 | }; 61 | 62 | BASELINE_F(FileWrite, fwrite, StdFileFixture, 30, 5000) 63 | { 64 | fwrite(buffer.data(), sizeof(char), buffer.size() * sizeof(char), file); 65 | } 66 | 67 | BENCHMARK_F(FileWrite, fwrite_with_fflush, StdFileFixture, 30, 5000) 68 | { 69 | fwrite(buffer.data(), sizeof(char), buffer.size() * sizeof(char), file); 70 | fflush(file); 71 | } 72 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/experiments/DemoMultithread/DemoMultithread.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | CELERO_MAIN 7 | 8 | class BaseFixture : public celero::ThreadTestFixture 9 | { 10 | public: 11 | int counter; 12 | 13 | void setUp(int64_t) override 14 | { 15 | this->counter = 0; 16 | } 17 | }; 18 | 19 | class AtomicFixture : public celero::ThreadTestFixture 20 | { 21 | public: 22 | std::atomic counter; 23 | 24 | void setUp(int64_t) override 25 | { 26 | this->counter = 0; 27 | } 28 | }; 29 | 30 | class MutexFixture : public celero::ThreadTestFixture 31 | { 32 | public: 33 | int counter; 34 | std::mutex mutex; 35 | 36 | void setUp(int64_t) override 37 | { 38 | this->counter = 0; 39 | } 40 | }; 41 | 42 | BASELINE_T(DemoMultithread, Baseline, BaseFixture, 10, 10000000, 8) 43 | { 44 | ++counter; 45 | } 46 | 47 | BENCHMARK_T(DemoMultithread, Atomic, AtomicFixture, 10, 10000000, 8) 48 | { 49 | ++counter; 50 | } 51 | 52 | BENCHMARK_T(DemoMultithread, Mutex, MutexFixture, 10, 10000000, 8) 53 | { 54 | std::lock_guard lock(mutex); 55 | ++counter; 56 | } 57 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/experiments/DemoSimple/DemoSimple.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #ifndef WIN32 6 | #include 7 | #include 8 | #endif 9 | 10 | /// 11 | /// This is the main(int argc, char** argv) for the entire celero program. 12 | /// You can write your own, or use this macro to insert the standard one into the project. 13 | /// 14 | CELERO_MAIN 15 | 16 | std::random_device RandomDevice; 17 | std::uniform_int_distribution UniformDistribution(0, 1024); 18 | 19 | /// In reality, all of the "Complex" cases take the same amount of time to run. 20 | /// The difference in the results is a product of measurement error. 21 | /// 22 | /// Interestingly, taking the sin of a constant number here resulted in a 23 | /// great deal of optimization in clang and gcc. 24 | BASELINE(DemoSimple, Baseline, 30, 1000000) 25 | { 26 | celero::DoNotOptimizeAway(static_cast(sin(fmod(UniformDistribution(RandomDevice), 3.14159265)))); 27 | } 28 | 29 | /// Run a test consisting of 1 sample of 710000 iterations per measurement. 30 | /// There are not enough samples here to likely get a meaningful result. 31 | BENCHMARK(DemoSimple, Complex1, 1, 710000) 32 | { 33 | celero::DoNotOptimizeAway(static_cast(sin(fmod(UniformDistribution(RandomDevice), 3.14159265)))); 34 | } 35 | 36 | /// Run a test consisting of 30 samples of 710000 iterations per measurement. 37 | /// There are not enough samples here to get a reasonable measurement 38 | /// It should get a Basline number lower than the previous test. 39 | BENCHMARK(DemoSimple, Complex2, 30, 710000) 40 | { 41 | celero::DoNotOptimizeAway(static_cast(sin(fmod(UniformDistribution(RandomDevice), 3.14159265)))); 42 | } 43 | 44 | /// Run a test consisting of 60 samples of 710000 iterations per measurement. 45 | /// There are not enough samples here to get a reasonable measurement 46 | /// It should get a Basline number lower than the previous test. 47 | BENCHMARK(DemoSimple, Complex3, 60, 710000) 48 | { 49 | celero::DoNotOptimizeAway(static_cast(sin(fmod(UniformDistribution(RandomDevice), 3.14159265)))); 50 | } 51 | 52 | /// Run a test consisting of 60 samples of 7100000 iterations per measurement. 53 | /// Samples here are much large and there are more of them. Expect a better answer here. 54 | /* 55 | BENCHMARK(DemoSimple, Complex4, 600, 20000000) 56 | { 57 | celero::DoNotOptimizeAway(static_cast(sin(fmod(rand(), 3.14159265)))); 58 | } 59 | */ 60 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/experiments/DemoSimpleJUnit/DemoSimpleJUnit.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifndef WIN32 4 | #include 5 | #include 6 | #endif 7 | 8 | /// 9 | /// This is the main(int argc, char** argv) for the entire celero program. 10 | /// You can write your own, or use this macro to insert the standard one into the project. 11 | /// 12 | CELERO_MAIN 13 | 14 | /// Run an automatic baseline. 15 | /// In reality, all of the "Complex" cases take the same amount of time to run. 16 | /// The difference in the results is a product of measurement error. 17 | BASELINE(DemoSimple, Baseline, 1, 7100000) 18 | { 19 | celero::DoNotOptimizeAway(static_cast(sin(3.14159265))); 20 | } 21 | 22 | /// Run an automatic test. 23 | /// Celero will help make sure enough samples are taken to get a reasonable measurement 24 | BENCHMARK_TEST(DemoSimple, Complex1, 1, 7100000, 1.0) 25 | { 26 | celero::DoNotOptimizeAway(static_cast(sin(fmod(rand(), 3.14159265)))); 27 | } 28 | 29 | /// Run a manual test consisting of 1 sample of 7100000 iterations per measurement. 30 | BENCHMARK_TEST(DemoSimple, Complex2, 1, 7100000, 3.71) 31 | { 32 | celero::DoNotOptimizeAway(static_cast(sin(fmod(rand(), 3.14159265)))); 33 | } 34 | 35 | /// Run a manual test consisting of 60 samples of 7100000 iterations per measurement. 36 | BENCHMARK_TEST(DemoSimple, Complex3, 60, 7100000, 5.0) 37 | { 38 | celero::DoNotOptimizeAway(static_cast(sin(fmod(rand(), 3.14159265)))); 39 | } 40 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/experiments/DemoSleep/DemoSleep.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | /// 7 | /// This is the main(int argc, char** argv) for the entire celero program. 8 | /// You can write your own, or use this macro to insert the standard one into the project. 9 | /// 10 | CELERO_MAIN 11 | 12 | BASELINE(DemoSleep, Baseline, 60, 1) 13 | { 14 | std::this_thread::sleep_for(std::chrono::microseconds(100000)); 15 | } 16 | 17 | BENCHMARK(DemoSleep, HalfBaseline, 60, 1) 18 | { 19 | std::this_thread::sleep_for(std::chrono::microseconds(50000)); 20 | } 21 | 22 | BENCHMARK(DemoSleep, TwiceBaseline, 60, 1) 23 | { 24 | std::this_thread::sleep_for(std::chrono::microseconds(200000)); 25 | } 26 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/include/celero/Archive.h: -------------------------------------------------------------------------------- 1 | #ifndef H_CELERO_ARCHIVE_H 2 | #define H_CELERO_ARCHIVE_H 3 | 4 | /// 5 | /// \author John Farrier 6 | /// 7 | /// \copyright Copyright 2015 John Farrier 8 | /// 9 | /// Licensed under the Apache License, Version 2.0 (the "License"); 10 | /// you may not use this file except in compliance with the License. 11 | /// You may obtain a copy of the License at 12 | /// 13 | /// http://www.apache.org/licenses/LICENSE-2.0 14 | /// 15 | /// Unless required by applicable law or agreed to in writing, software 16 | /// distributed under the License is distributed on an "AS IS" BASIS, 17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | /// See the License for the specific language governing permissions and 19 | /// limitations under the License. 20 | /// 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | namespace celero 27 | { 28 | /// 29 | /// \class Archive 30 | /// 31 | /// \author John Farrier 32 | /// 33 | class CELERO_EXPORT Archive 34 | { 35 | public: 36 | /// 37 | /// Singleton 38 | /// 39 | static Archive& Instance(); 40 | 41 | /// 42 | /// Specify a file name for a results output file. 43 | /// 44 | /// \param x The name of the output file in which to store Celero's results. 45 | /// 46 | void setFileName(const std::string& x); 47 | 48 | /// 49 | /// Adds or updates a result which will be saved to a results archive file. 50 | /// 51 | /// This should re-save on every new result so that the output can be monitored externally. 52 | /// 53 | void add(std::shared_ptr x); 54 | 55 | /// 56 | /// Saves all current results to a results archive file. 57 | /// 58 | /// Will overwrite all existing data and refresh with new data. 59 | /// 60 | void save(); 61 | 62 | private: 63 | /// 64 | /// Default Constructor 65 | /// 66 | Archive(); 67 | 68 | /// 69 | /// Non-copyable. 70 | /// Visual studio 2012 does not support "delete" here. 71 | /// 72 | Archive(Archive&){} 73 | 74 | /// 75 | /// Default Destructor 76 | /// 77 | ~Archive(); 78 | 79 | /// 80 | /// Non-assignable. 81 | /// Visual studio 2012 does not support "delete" here. 82 | /// 83 | Archive& operator=(const Archive&){return *this;} 84 | 85 | /// 86 | /// \brief Pimpl Idiom 87 | /// 88 | class Impl; 89 | 90 | /// 91 | /// \brief Pimpl Idiom 92 | /// 93 | Pimpl pimpl; 94 | }; 95 | } 96 | 97 | #endif 98 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/include/celero/Callbacks.h: -------------------------------------------------------------------------------- 1 | #ifndef H_CELERO_CALLBACKS_H 2 | #define H_CELERO_CALLBACKS_H 3 | 4 | /// 5 | /// \namespace celero 6 | /// 7 | /// \author John Farrier 8 | /// 9 | /// \copyright Copyright 2015 John Farrier 10 | /// 11 | /// Licensed under the Apache License, Version 2.0 (the "License"); 12 | /// you may not use this file except in compliance with the License. 13 | /// You may obtain a copy of the License at 14 | /// 15 | /// http://www.apache.org/licenses/LICENSE-2.0 16 | /// 17 | /// Unless required by applicable law or agreed to in writing, software 18 | /// distributed under the License is distributed on an "AS IS" BASIS, 19 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | /// See the License for the specific language governing permissions and 21 | /// limitations under the License. 22 | /// 23 | /// Ideas from Nick Brunn's Hayai (https://github.com/nickbruun/hayai) were used and I likely owe him a beer. 24 | /// 25 | /// Special thanks to the band "3" for providing the development soundtrack. 26 | /// 27 | /// "Iterations" refers to how many loops of the test function are measured as a time. 28 | /// For very fast code, many iterations would help amoratize measurement error. 29 | /// 30 | /// "Samples" refers to how many sets of "iterations" will be performed. Each "sample" is 31 | /// a single measurement. Set to 0 to have Celero decide how many samples are required 32 | /// for a minimally significant answer. 33 | /// 34 | /// It is highly encouraged to only run this code compiled in a "Release" mode to use all available optimizations. 35 | /// 36 | 37 | #include 38 | #include 39 | 40 | #include 41 | #include 42 | 43 | namespace celero 44 | { 45 | /// 46 | /// \brief Add a function to call when a experiment is completed. 47 | /// 48 | /// This will be called at the end of a complete experiment (benchmark + experiment results.) 49 | /// 50 | CELERO_EXPORT void AddExperimentCompleteFunction(std::function)> x); 51 | 52 | /// 53 | /// \brief Add a function to call when a experiment is completed. 54 | /// 55 | /// This will be called at the end of every benchmark or user experiment upon completion. 56 | /// 57 | CELERO_EXPORT void AddExperimentResultCompleteFunction(std::function)> x); 58 | 59 | namespace impl 60 | { 61 | void ExperimentComplete(std::shared_ptr x); 62 | void ExperimentResultComplete(std::shared_ptr x); 63 | } 64 | } 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/include/celero/Console.h: -------------------------------------------------------------------------------- 1 | #ifndef H_CELERO_CONSOLE_H 2 | #define H_CELERO_CONSOLE_H 3 | 4 | /// 5 | /// \author John Farrier 6 | /// 7 | /// \copyright Copyright 2015 John Farrier 8 | /// 9 | /// Licensed under the Apache License, Version 2.0 (the "License"); 10 | /// you may not use this file except in compliance with the License. 11 | /// You may obtain a copy of the License at 12 | /// 13 | /// http://www.apache.org/licenses/LICENSE-2.0 14 | /// 15 | /// Unless required by applicable law or agreed to in writing, software 16 | /// distributed under the License is distributed on an "AS IS" BASIS, 17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | /// See the License for the specific language governing permissions and 19 | /// limitations under the License. 20 | /// 21 | 22 | #include 23 | 24 | namespace celero 25 | { 26 | /// 27 | /// \namespace console 28 | /// 29 | /// \author John farrier 30 | /// 31 | namespace console 32 | { 33 | /// 34 | /// \enum ConsoleColor 35 | /// 36 | /// \author John farrier 37 | /// 38 | enum ConsoleColor 39 | { 40 | ConsoleColor_Default, 41 | ConsoleColor_Red, 42 | ConsoleColor_Red_Bold, 43 | ConsoleColor_Green, 44 | ConsoleColor_Green_Bold, 45 | ConsoleColor_Blue, 46 | ConsoleColor_Blue_Bold, 47 | ConsoleColor_Cyan, 48 | ConsoleColor_Cyan_Bold, 49 | ConsoleColor_Yellow, 50 | ConsoleColor_Yellow_Bold, 51 | ConsoleColor_White, 52 | ConsoleColor_White_Bold, 53 | ConsoleColor_WhiteOnRed, 54 | ConsoleColor_WhiteOnRed_Bold, 55 | ConsoleColor_Purple_Bold 56 | }; 57 | 58 | /// 59 | /// Set the color of std::out on the console. 60 | /// 61 | CELERO_EXPORT void SetConsoleColor(const celero::console::ConsoleColor x); 62 | } 63 | } 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/include/celero/Distribution.h: -------------------------------------------------------------------------------- 1 | #ifndef H_CELERO_DISTRIBUTION_H 2 | #define H_CELERO_DISTRIBUTION_H 3 | 4 | /// 5 | /// \author John Farrier 6 | /// 7 | /// \copyright Copyright 2015 John Farrier 8 | /// 9 | /// Licensed under the Apache License, Version 2.0 (the "License"); 10 | /// you may not use this file except in compliance with the License. 11 | /// You may obtain a copy of the License at 12 | /// 13 | /// http://www.apache.org/licenses/LICENSE-2.0 14 | /// 15 | /// Unless required by applicable law or agreed to in writing, software 16 | /// distributed under the License is distributed on an "AS IS" BASIS, 17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | /// See the License for the specific language governing permissions and 19 | /// limitations under the License. 20 | /// 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | namespace celero 27 | { 28 | /// 29 | /// Collects results from Celero for analysis of a hard-coded internal trivial measurement case. 30 | /// 31 | CELERO_EXPORT std::vector BuildDistribution(uint64_t numberOfSamples, uint64_t iterationsPerSample); 32 | 33 | /// 34 | /// Builds a .csv file to help determine Celero's measurement distribution. 35 | /// 36 | CELERO_EXPORT void RunDistribution(uint64_t iterationsPerSample); 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/include/celero/Executor.h: -------------------------------------------------------------------------------- 1 | #ifndef H_CELERO_EXECUTOR_H 2 | #define H_CELERO_EXECUTOR_H 3 | 4 | /// 5 | /// \author John Farrier 6 | /// 7 | /// \copyright Copyright 2015 John Farrier 8 | /// 9 | /// Licensed under the Apache License, Version 2.0 (the "License"); 10 | /// you may not use this file except in compliance with the License. 11 | /// You may obtain a copy of the License at 12 | /// 13 | /// http://www.apache.org/licenses/LICENSE-2.0 14 | /// 15 | /// Unless required by applicable law or agreed to in writing, software 16 | /// distributed under the License is distributed on an "AS IS" BASIS, 17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | /// See the License for the specific language governing permissions and 19 | /// limitations under the License. 20 | /// 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | namespace celero 28 | { 29 | namespace executor 30 | { 31 | /// 32 | /// Run all baselines and experiments registered within the final application. 33 | /// 34 | void RunAll(); 35 | 36 | /// 37 | /// Run all baselines (but not experiments) registered within the final application. 38 | /// 39 | void RunAllBaselines(); 40 | 41 | /// 42 | /// Run a specific benchmark's baseline. 43 | /// 44 | void RunBaseline(std::shared_ptr x); 45 | 46 | /// 47 | /// Run all experiments registered within the final application. 48 | /// 49 | void RunAllExperiments(); 50 | 51 | /// 52 | /// Run all experiments within a specific benchmark. 53 | /// 54 | void RunExperiments(std::shared_ptr x); 55 | 56 | /// 57 | /// Run a specific benchmark. 58 | /// 59 | void Run(std::shared_ptr x); 60 | 61 | /// 62 | /// Run a specific experiment. 63 | /// 64 | /// If the baseline is not complete for the given experiment, it will be executed first. 65 | /// 66 | void Run(std::shared_ptr x); 67 | 68 | /// 69 | /// Run a specific benchmark with the specified name. 70 | /// 71 | void Run(const std::string& group); 72 | 73 | /// 74 | /// Run a specific benchmark with the specified name and one specific experiment within it. 75 | /// 76 | /// If the baseline is not complete for the given experiment, it will be executed first. 77 | /// 78 | void Run(const std::string& group, const std::string& experiment); 79 | } 80 | } 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/include/celero/Export.h: -------------------------------------------------------------------------------- 1 | #ifndef H_CELERO_EXPORT_H 2 | #define H_CELERO_EXPORT_H 3 | 4 | /// 5 | /// \author John Farrier 6 | /// 7 | /// \copyright Copyright 2015 John Farrier 8 | /// 9 | /// Licensed under the Apache License, Version 2.0 (the "License"); 10 | /// you may not use this file except in compliance with the License. 11 | /// You may obtain a copy of the License at 12 | /// 13 | /// http://www.apache.org/licenses/LICENSE-2.0 14 | /// 15 | /// Unless required by applicable law or agreed to in writing, software 16 | /// distributed under the License is distributed on an "AS IS" BASIS, 17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | /// See the License for the specific language governing permissions and 19 | /// limitations under the License. 20 | /// 21 | 22 | #ifdef CELERO_STATIC 23 | #define CELERO_EXPORT 24 | #define CELERO_EXPORT_C 25 | #else 26 | #ifdef WIN32 27 | #if defined CELERO_EXPORTS 28 | #define CELERO_EXPORT _declspec(dllexport) 29 | #define CELERO_EXPORT_C extern "C" _declspec(dllexport) 30 | #else 31 | #define CELERO_EXPORT _declspec(dllimport) 32 | #define CELERO_EXPORT_C extern "C" _declspec(dllimport) 33 | #endif 34 | #else 35 | #define CELERO_EXPORT 36 | #define CELERO_EXPORT_C extern "C" 37 | #endif 38 | #endif 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/include/celero/Factory.h: -------------------------------------------------------------------------------- 1 | #ifndef H_CELERO_FACTORY_H 2 | #define H_CELERO_FACTORY_H 3 | 4 | /// 5 | /// \author John Farrier 6 | /// 7 | /// \copyright Copyright 2015 John Farrier 8 | /// 9 | /// Licensed under the Apache License, Version 2.0 (the "License"); 10 | /// you may not use this file except in compliance with the License. 11 | /// You may obtain a copy of the License at 12 | /// 13 | /// http://www.apache.org/licenses/LICENSE-2.0 14 | /// 15 | /// Unless required by applicable law or agreed to in writing, software 16 | /// distributed under the License is distributed on an "AS IS" BASIS, 17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | /// See the License for the specific language governing permissions and 19 | /// limitations under the License. 20 | /// 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | namespace celero 27 | { 28 | /// 29 | /// \class Factory 30 | /// 31 | /// \author John Farrier 32 | /// 33 | /// Pure Virtual Base class for benchmarks. 34 | /// 35 | class CELERO_EXPORT Factory 36 | { 37 | public: 38 | /// 39 | /// \brief Default Constructor 40 | /// 41 | Factory() 42 | { 43 | } 44 | 45 | /// 46 | /// \brief Virtual Destructor 47 | /// 48 | virtual ~Factory() 49 | { 50 | } 51 | 52 | /// 53 | /// \brief Pure virtual function. 54 | /// 55 | virtual std::shared_ptr Create() = 0; 56 | }; 57 | } 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/include/celero/FileReader.h: -------------------------------------------------------------------------------- 1 | #ifndef H_CELERO_FILEREADER_H 2 | #define H_CELERO_FILEREADER_H 3 | 4 | /// 5 | /// \author John Farrier 6 | /// 7 | /// \copyright Copyright 2015 John Farrier 8 | /// 9 | /// Licensed under the Apache License, Version 2.0 (the "License"); 10 | /// you may not use this file except in compliance with the License. 11 | /// You may obtain a copy of the License at 12 | /// 13 | /// http://www.apache.org/licenses/LICENSE-2.0 14 | /// 15 | /// Unless required by applicable law or agreed to in writing, software 16 | /// distributed under the License is distributed on an "AS IS" BASIS, 17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | /// See the License for the specific language governing permissions and 19 | /// limitations under the License. 20 | /// 21 | 22 | #include 23 | 24 | namespace celero 25 | { 26 | /// \struct FileReader 27 | /// 28 | /// A helper struct to aid in reading CSV files. 29 | /// 30 | /// Classify commas as whitespace. 31 | /// 32 | struct FieldReader : std::ctype 33 | { 34 | FieldReader() : std::ctype(FieldReader::GetTable()) 35 | { 36 | } 37 | 38 | static std::ctype_base::mask const* GetTable() 39 | { 40 | static std::vector rc(table_size, std::ctype_base::mask()); 41 | rc[','] = std::ctype_base::space; 42 | rc['\n'] = std::ctype_base::space; 43 | rc['\r'] = std::ctype_base::space; 44 | return &rc[0]; 45 | } 46 | }; 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/include/celero/GenericFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef H_CELERO_GENERICFACTORY_H 2 | #define H_CELERO_GENERICFACTORY_H 3 | 4 | /// 5 | /// \author John Farrier 6 | /// 7 | /// \copyright Copyright 2015 John Farrier 8 | /// 9 | /// Licensed under the Apache License, Version 2.0 (the "License"); 10 | /// you may not use this file except in compliance with the License. 11 | /// You may obtain a copy of the License at 12 | /// 13 | /// http://www.apache.org/licenses/LICENSE-2.0 14 | /// 15 | /// Unless required by applicable law or agreed to in writing, software 16 | /// distributed under the License is distributed on an "AS IS" BASIS, 17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | /// See the License for the specific language governing permissions and 19 | /// limitations under the License. 20 | /// 21 | 22 | #include 23 | #include 24 | 25 | namespace celero 26 | { 27 | /// 28 | /// \class GenericFactory 29 | /// 30 | /// \author John farrier 31 | /// 32 | template class GenericFactory : public Factory 33 | { 34 | public: 35 | /// 36 | /// \brief Default Constructor 37 | /// 38 | GenericFactory() : Factory() 39 | { 40 | } 41 | 42 | /// 43 | /// \brief Virtual Destructor 44 | /// 45 | virtual ~GenericFactory() 46 | { 47 | } 48 | 49 | /// 50 | /// \brief Overload the pure virtual base class function. 51 | /// 52 | virtual std::shared_ptr Create() 53 | { 54 | return std::make_shared(); 55 | } 56 | }; 57 | } 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/include/celero/JUnit.h: -------------------------------------------------------------------------------- 1 | #ifndef H_CELERO_JUNIT_H 2 | #define H_CELERO_JUNIT_H 3 | 4 | /// 5 | /// \author John Farrier 6 | /// 7 | /// \copyright Copyright 2015 John Farrier 8 | /// 9 | /// Licensed under the Apache License, Version 2.0 (the "License"); 10 | /// you may not use this file except in compliance with the License. 11 | /// You may obtain a copy of the License at 12 | /// 13 | /// http://www.apache.org/licenses/LICENSE-2.0 14 | /// 15 | /// Unless required by applicable law or agreed to in writing, software 16 | /// distributed under the License is distributed on an "AS IS" BASIS, 17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | /// See the License for the specific language governing permissions and 19 | /// limitations under the License. 20 | /// 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | namespace celero 27 | { 28 | /// 29 | /// \class JUnit 30 | /// 31 | /// \author John Farrier 32 | /// 33 | class JUnit 34 | { 35 | public: 36 | /// 37 | /// Singleton 38 | /// 39 | static JUnit& Instance(); 40 | 41 | /// 42 | /// Specify a file name for a results output file. 43 | /// 44 | /// \param x The name of the output file in which to store Celero's results. 45 | /// 46 | void setFileName(const std::string& x); 47 | 48 | /// 49 | /// Add a new result to the JUnit output XML. 50 | /// 51 | /// This should re-save on every new result so that the output can be monitored externally. 52 | /// 53 | void add(std::shared_ptr x); 54 | 55 | /// 56 | /// 57 | /// 58 | void save(); 59 | 60 | private: 61 | /// 62 | /// Default Constructor 63 | /// 64 | JUnit(); 65 | 66 | /// 67 | /// Default Destructor 68 | /// 69 | ~JUnit(); 70 | 71 | /// 72 | /// \brief Pimpl Idiom 73 | /// 74 | class Impl; 75 | 76 | /// 77 | /// \brief Pimpl Idiom 78 | /// 79 | Pimpl pimpl; 80 | }; 81 | } 82 | 83 | #endif 84 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/include/celero/Pimpl.h: -------------------------------------------------------------------------------- 1 | #ifndef H_CELERO_PIMPL_H 2 | #define H_CELERO_PIMPL_H 3 | 4 | /// 5 | /// \author John Farrier 6 | /// 7 | /// \copyright Copyright 2015 John Farrier 8 | /// 9 | /// Licensed under the Apache License, Version 2.0 (the "License"); 10 | /// you may not use this file except in compliance with the License. 11 | /// You may obtain a copy of the License at 12 | /// 13 | /// http://www.apache.org/licenses/LICENSE-2.0 14 | /// 15 | /// Unless required by applicable law or agreed to in writing, software 16 | /// distributed under the License is distributed on an "AS IS" BASIS, 17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | /// See the License for the specific language governing permissions and 19 | /// limitations under the License. 20 | /// 21 | 22 | #include 23 | #include 24 | 25 | namespace celero 26 | { 27 | /// 28 | /// \class Pimpl 29 | /// 30 | /// \author Herb Sutter 31 | /// \author John Farrier 32 | /// 33 | /// Classes using this must overload the assignment operator. 34 | /// Original code by Herb Sutter. Adapted for more primitive compilers by John Farrier. 35 | /// 36 | template class Pimpl 37 | { 38 | public: 39 | Pimpl(); 40 | //template Pimpl( Args&& ... ); 41 | template Pimpl(Arg1&&); 42 | template Pimpl(Arg1&&, Arg2&&); 43 | template Pimpl(Arg1&&, Arg2&&, Arg3&&); 44 | template Pimpl(Arg1&&, Arg2&&, Arg3&&, Arg4&&); 45 | template Pimpl(Arg1&&, Arg2&&, Arg3&&, Arg4&&, Arg5&&); 46 | template Pimpl(Arg1&&, Arg2&&, Arg3&&, Arg4&&, Arg5&&, Arg6&&); 47 | ~Pimpl(); 48 | 49 | T* operator->(); 50 | const T* operator->() const; 51 | T& operator*(); 52 | 53 | private: 54 | std::unique_ptr _pimpl; 55 | }; 56 | } 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/include/celero/Print.h: -------------------------------------------------------------------------------- 1 | #ifndef H_CELERO_PRINT_H 2 | #define H_CELERO_PRINT_H 3 | 4 | /// 5 | /// \author John Farrier 6 | /// 7 | /// \copyright Copyright 2015 John Farrier 8 | /// 9 | /// Licensed under the Apache License, Version 2.0 (the "License"); 10 | /// you may not use this file except in compliance with the License. 11 | /// You may obtain a copy of the License at 12 | /// 13 | /// http://www.apache.org/licenses/LICENSE-2.0 14 | /// 15 | /// Unless required by applicable law or agreed to in writing, software 16 | /// distributed under the License is distributed on an "AS IS" BASIS, 17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | /// See the License for the specific language governing permissions and 19 | /// limitations under the License. 20 | /// 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | namespace celero 27 | { 28 | /// 29 | /// \namespace print 30 | /// 31 | /// \author John farrier 32 | /// 33 | namespace print 34 | { 35 | //void StageBanner(const std::string& x); 36 | //void GreenBar(const std::string& x); 37 | //void Run(const std::string& x); 38 | //void Status(const std::string& x); 39 | //void Failure(const std::string& x); 40 | //void Run(std::shared_ptr x); 41 | //void Done(std::shared_ptr x); 42 | //void Baseline(std::shared_ptr x); 43 | //void SummaryTest(const std::string& x); 44 | //void Summary(std::shared_ptr x); 45 | 46 | void Console(const std::string& x); 47 | void TableBanner(); 48 | void TableRowHeader(std::shared_ptr x); 49 | void TableResult(std::shared_ptr x); 50 | } 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/include/celero/ResultTable.h: -------------------------------------------------------------------------------- 1 | #ifndef H_CELERO_RESULTTABLE_H 2 | #define H_CELERO_RESULTTABLE_H 3 | 4 | /// 5 | /// \author John Farrier 6 | /// 7 | /// \copyright Copyright 2015 John Farrier 8 | /// 9 | /// Licensed under the Apache License, Version 2.0 (the "License"); 10 | /// you may not use this file except in compliance with the License. 11 | /// You may obtain a copy of the License at 12 | /// 13 | /// http://www.apache.org/licenses/LICENSE-2.0 14 | /// 15 | /// Unless required by applicable law or agreed to in writing, software 16 | /// distributed under the License is distributed on an "AS IS" BASIS, 17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | /// See the License for the specific language governing permissions and 19 | /// limitations under the License. 20 | /// 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | namespace celero 27 | { 28 | /// 29 | /// \class ResultTable 30 | /// 31 | /// \author John Farrier 32 | /// 33 | class ResultTable 34 | { 35 | public: 36 | /// 37 | /// Singleton 38 | /// 39 | static ResultTable& Instance(); 40 | 41 | /// 42 | /// Specify a file name for a results output file. 43 | /// 44 | /// \param x The name of the output file in which to store Celero's results. 45 | /// 46 | void setFileName(const std::string& x); 47 | 48 | /// 49 | /// Add a new result to the result table. 50 | /// 51 | /// This should re-save on every new result so that the output can be monitored externally. 52 | /// 53 | void add(std::shared_ptr x); 54 | 55 | /// 56 | /// 57 | /// 58 | void save(); 59 | 60 | private: 61 | /// 62 | /// Default Constructor 63 | /// 64 | ResultTable(); 65 | 66 | /// 67 | /// Default Destructor 68 | /// 69 | ~ResultTable(); 70 | 71 | /// 72 | /// \brief Pimpl Idiom 73 | /// 74 | class Impl; 75 | 76 | /// 77 | /// \brief Pimpl Idiom 78 | /// 79 | Pimpl pimpl; 80 | }; 81 | } 82 | 83 | #endif 84 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/include/celero/Statistics.h: -------------------------------------------------------------------------------- 1 | #ifndef H_CELERO_STATISTICS_H 2 | #define H_CELERO_STATISTICS_H 3 | 4 | /// 5 | /// \author John Farrier 6 | /// 7 | /// \copyright Copyright 2015 John Farrier 8 | /// 9 | /// Licensed under the Apache License, Version 2.0 (the "License"); 10 | /// you may not use this file except in compliance with the License. 11 | /// You may obtain a copy of the License at 12 | /// 13 | /// http://www.apache.org/licenses/LICENSE-2.0 14 | /// 15 | /// Unless required by applicable law or agreed to in writing, software 16 | /// distributed under the License is distributed on an "AS IS" BASIS, 17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | /// See the License for the specific language governing permissions and 19 | /// limitations under the License. 20 | /// 21 | 22 | #include 23 | #include 24 | 25 | namespace celero 26 | { 27 | /// 28 | /// \class Statistics 29 | /// 30 | /// \author John Farrier 31 | /// 32 | /// Sources: 33 | /// http://www.johndcook.com/skewness_kurtosis.html 34 | /// http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance 35 | /// http://prod.sandia.gov/techlib/access-control.cgi/2008/086212.pdf 36 | /// http://en.wikipedia.org/wiki/Kurtosis 37 | /// 38 | class Statistics 39 | { 40 | public: 41 | /// 42 | /// \brief Default constructor 43 | /// 44 | Statistics(); 45 | 46 | Statistics(const Statistics& other); 47 | 48 | ~Statistics(); 49 | 50 | Statistics operator+(const Statistics& other); 51 | 52 | Statistics& operator+=(const Statistics& other); 53 | 54 | Statistics& operator=(const Statistics& other); 55 | 56 | /// 57 | /// Resets all accumulated statistics. 58 | /// 59 | void reset(); 60 | 61 | /// 62 | /// Adds a statistical sample. 63 | /// 64 | void addSample(uint64_t x); 65 | 66 | size_t getSize() const; 67 | 68 | double getMean() const; 69 | 70 | double getVariance() const; 71 | 72 | double getStandardDeviation() const; 73 | 74 | double getSkewness() const; 75 | 76 | double getKurtosis() const; 77 | 78 | /// 79 | /// Computed as (mean - hypothesis)/standard_deviation 80 | /// 81 | /// Here, the hypothesis is our minimum value. 82 | /// 83 | double getZScore() const; 84 | 85 | uint64_t getMin() const; 86 | 87 | uint64_t getMax() const; 88 | 89 | private: 90 | class Impl; 91 | Pimpl pimpl; 92 | }; 93 | } 94 | 95 | #endif 96 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/include/celero/TestVector.h: -------------------------------------------------------------------------------- 1 | #ifndef H_CELERO_TESTVECTOR_H 2 | #define H_CELERO_TESTVECTOR_H 3 | 4 | /// 5 | /// \author John Farrier 6 | /// 7 | /// \copyright Copyright 2015 John Farrier 8 | /// 9 | /// Licensed under the Apache License, Version 2.0 (the "License"); 10 | /// you may not use this file except in compliance with the License. 11 | /// You may obtain a copy of the License at 12 | /// 13 | /// http://www.apache.org/licenses/LICENSE-2.0 14 | /// 15 | /// Unless required by applicable law or agreed to in writing, software 16 | /// distributed under the License is distributed on an "AS IS" BASIS, 17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | /// See the License for the specific language governing permissions and 19 | /// limitations under the License. 20 | /// 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | namespace celero 28 | { 29 | /// 30 | /// \class TestVector 31 | /// 32 | /// \author John Farrier 33 | /// 34 | class TestVector 35 | { 36 | public: 37 | static TestVector& Instance(); 38 | 39 | void push_back(std::shared_ptr x); 40 | 41 | size_t size() const; 42 | 43 | std::shared_ptr operator[](size_t x); 44 | std::shared_ptr operator[](const std::string& x); 45 | 46 | private: 47 | /// 48 | /// Default Constructor 49 | /// 50 | TestVector(); 51 | 52 | /// 53 | /// \brief Pimpl Idiom 54 | /// 55 | class Impl; 56 | 57 | /// 58 | /// \brief Pimpl Idiom 59 | /// 60 | Pimpl pimpl; 61 | }; 62 | } 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/include/celero/ThreadLocal.h: -------------------------------------------------------------------------------- 1 | #ifndef H_CELERO_THREADLOCAL_H 2 | #define H_CELERO_THREADLOCAL_H 3 | 4 | /// 5 | /// \author Ivan Shynkarenka 6 | /// 7 | /// \copyright Copyright 2015 John Farrier 8 | /// 9 | /// Licensed under the Apache License, Version 2.0 (the "License"); 10 | /// you may not use this file except in compliance with the License. 11 | /// You may obtain a copy of the License at 12 | /// 13 | /// http://www.apache.org/licenses/LICENSE-2.0 14 | /// 15 | /// Unless required by applicable law or agreed to in writing, software 16 | /// distributed under the License is distributed on an "AS IS" BASIS, 17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | /// See the License for the specific language governing permissions and 19 | /// limitations under the License. 20 | /// 21 | 22 | #ifndef thread_local 23 | 24 | # if __STDC_VERSION__ >= 201112 && !defined __STDC_NO_THREADS__ 25 | # define thread_local _Thread_local 26 | # elif defined _WIN32 && ( \ 27 | defined _MSC_VER || \ 28 | defined __ICL || \ 29 | defined __DMC__ || \ 30 | defined __BORLANDC__ ) 31 | # define thread_local __declspec(thread) 32 | /* note that ICC (linux) and Clang are covered by __GNUC__ */ 33 | # elif defined __GNUC__ || \ 34 | defined __SUNPRO_C || \ 35 | defined __xlC__ 36 | # define thread_local __thread 37 | # else 38 | # error "Cannot define thread_local" 39 | # endif 40 | #endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/include/celero/ThreadTestFixture.h: -------------------------------------------------------------------------------- 1 | #ifndef H_CELERO_THREADTESTFIXTURE_H 2 | #define H_CELERO_THREADTESTFIXTURE_H 3 | 4 | /// 5 | /// \author Ivan Shynkarenka 6 | /// 7 | /// \copyright Copyright 2015 John Farrier 8 | /// 9 | /// Licensed under the Apache License, Version 2.0 (the "License"); 10 | /// you may not use this file except in compliance with the License. 11 | /// You may obtain a copy of the License at 12 | /// 13 | /// http://www.apache.org/licenses/LICENSE-2.0 14 | /// 15 | /// Unless required by applicable law or agreed to in writing, software 16 | /// distributed under the License is distributed on an "AS IS" BASIS, 17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | /// See the License for the specific language governing permissions and 19 | /// limitations under the License. 20 | /// 21 | 22 | #include 23 | #include 24 | 25 | namespace celero 26 | { 27 | class Benchmark; 28 | 29 | /// 30 | /// \class ThreadTestFixture 31 | /// 32 | /// \author Ivan Shynkarenka 33 | /// 34 | class CELERO_EXPORT ThreadTestFixture : public TestFixture 35 | { 36 | public: 37 | /// 38 | /// Default Constructor. 39 | /// 40 | ThreadTestFixture(); 41 | 42 | /// 43 | /// Virtual destructor for inheritance. 44 | /// 45 | virtual ~ThreadTestFixture(); 46 | 47 | /// 48 | /// Start threads before benchmark execution. 49 | /// 50 | /// \param threads Count of working threads to start. 51 | /// \param calls The total number of times to loop over the UserBenchmark function. 52 | /// 53 | virtual void startThreads(uint64_t threads, uint64_t calls); 54 | 55 | /// 56 | /// Called after test completion to stop threads. 57 | /// 58 | virtual void stopThreads(); 59 | 60 | /// 61 | /// \param threads The number of working threads. 62 | /// \param calls The total number of times to loop over the UserBenchmark function. 63 | /// \param experimentValue The experiment value to pass in setUp function. 64 | /// 65 | /// \return Returns a pair of the number of microseconds the run took. 66 | /// 67 | uint64_t run(uint64_t threads, uint64_t calls, int64_t experimentValue) override; 68 | 69 | /// 70 | /// Get the current call number starting from 1. 71 | /// 72 | uint64_t getCallId() const; 73 | 74 | /// 75 | /// Get the current thread Id starting from 1. 76 | /// 77 | uint64_t getThreadId() const; 78 | 79 | private: 80 | class Impl; 81 | Pimpl pimpl; 82 | }; 83 | } 84 | 85 | #endif 86 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/include/celero/Timer.h: -------------------------------------------------------------------------------- 1 | #ifndef H_CELERO_TIMER_H 2 | #define H_CELERO_TIMER_H 3 | 4 | /// 5 | /// \author John Farrier 6 | /// 7 | /// \copyright Copyright 2015 John Farrier 8 | /// 9 | /// Licensed under the Apache License, Version 2.0 (the "License"); 10 | /// you may not use this file except in compliance with the License. 11 | /// You may obtain a copy of the License at 12 | /// 13 | /// http://www.apache.org/licenses/LICENSE-2.0 14 | /// 15 | /// Unless required by applicable law or agreed to in writing, software 16 | /// distributed under the License is distributed on an "AS IS" BASIS, 17 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | /// See the License for the specific language governing permissions and 19 | /// limitations under the License. 20 | /// 21 | 22 | #include 23 | 24 | namespace celero 25 | { 26 | /// 27 | /// \namespace timer 28 | /// 29 | /// \author John Farrier 30 | /// 31 | /// \brief Provide basic cross-platform timing functions to measure code performance speed. 32 | /// 33 | namespace timer 34 | { 35 | /// 36 | /// \brief Retrieves the current time. 37 | /// 38 | /// \author John Farrier 39 | /// 40 | /// \return The time, in ticks. 41 | /// 42 | uint64_t GetSystemTime(); 43 | 44 | /// 45 | /// \brief Converts the gathered system time into seconds. 46 | /// 47 | /// This assumes "x" is a delta and relatively small (easily fits inside of a double). 48 | /// 49 | /// \author John Farrier 50 | /// 51 | /// \param x The time, in ticks. 52 | /// 53 | /// \return The time, in seconds. 54 | /// 55 | double ConvertSystemTime(const uint64_t x); 56 | 57 | /// 58 | /// On Windows, this caches the frequency of the high performance clock. 59 | /// 60 | void CachePerformanceFrequency(); 61 | } 62 | } 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/src/Callbacks.cpp: -------------------------------------------------------------------------------- 1 | /// 2 | /// \author John Farrier 3 | /// 4 | /// \copyright Copyright 2015 John Farrier 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 | 19 | #include 20 | 21 | #include 22 | #include 23 | 24 | using namespace celero; 25 | 26 | std::vector)>> ExperimentFunctions; 27 | std::vector)>> ExperimentResultFunctions; 28 | 29 | void celero::impl::ExperimentComplete(std::shared_ptr x) 30 | { 31 | for(auto& i : ExperimentFunctions) 32 | { 33 | i(x); 34 | } 35 | } 36 | 37 | void celero::impl::ExperimentResultComplete(std::shared_ptr x) 38 | { 39 | for(auto& i : ExperimentResultFunctions) 40 | { 41 | i(x); 42 | } 43 | } 44 | 45 | void celero::AddExperimentCompleteFunction(std::function)> x) 46 | { 47 | ExperimentFunctions.push_back(x); 48 | } 49 | 50 | void celero::AddExperimentResultCompleteFunction(std::function)> x) 51 | { 52 | ExperimentResultFunctions.push_back(x); 53 | } 54 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/src/TestFixture.cpp: -------------------------------------------------------------------------------- 1 | /// 2 | /// \author John Farrier 3 | /// 4 | /// \copyright Copyright 2015 John Farrier 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 | 19 | #include 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | using namespace celero; 27 | 28 | TestFixture::TestFixture() 29 | { 30 | } 31 | 32 | TestFixture::~TestFixture() 33 | { 34 | } 35 | 36 | void TestFixture::onExperimentStart(int64_t) 37 | { 38 | } 39 | 40 | void TestFixture::onExperimentEnd() 41 | { 42 | } 43 | 44 | void TestFixture::setUp(int64_t) 45 | { 46 | } 47 | 48 | void TestFixture::tearDown() 49 | { 50 | } 51 | 52 | uint64_t TestFixture::run(const uint64_t, const uint64_t iterations, int64_t experimentValue) 53 | { 54 | if(this->HardCodedMeasurement() == 0) 55 | { 56 | // Set up the testing fixture. 57 | this->setUp(experimentValue); 58 | 59 | // Run the test body for each iterations. 60 | auto iterationCounter = iterations; 61 | 62 | // Get the starting time. 63 | const auto startTime = celero::timer::GetSystemTime(); 64 | 65 | this->onExperimentStart(experimentValue); 66 | 67 | // Count down to zero 68 | while(iterationCounter--) 69 | { 70 | this->UserBenchmark(); 71 | } 72 | 73 | this->onExperimentEnd(); 74 | 75 | const auto endTime = celero::timer::GetSystemTime(); 76 | 77 | // Tear down the testing fixture. 78 | this->tearDown(); 79 | 80 | // Return the duration in microseconds for the given problem size. 81 | return (endTime - startTime); 82 | } 83 | 84 | return this->HardCodedMeasurement(); 85 | } 86 | 87 | void TestFixture::UserBenchmark() 88 | { 89 | } 90 | 91 | uint64_t TestFixture::HardCodedMeasurement() const 92 | { 93 | return uint64_t(0); 94 | } 95 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/src/TestVector.cpp: -------------------------------------------------------------------------------- 1 | /// 2 | /// \author John Farrier 3 | /// 4 | /// \copyright Copyright 2015 John Farrier 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 | 19 | #include 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | using namespace celero; 28 | 29 | /// 30 | /// \class Impl 31 | /// 32 | class celero::TestVector::Impl 33 | { 34 | public: 35 | Impl() : 36 | testVectorMutex(), 37 | testVector() 38 | { 39 | } 40 | 41 | mutable std::mutex testVectorMutex; 42 | std::vector> testVector; 43 | }; 44 | 45 | TestVector::TestVector() : pimpl() 46 | { 47 | } 48 | 49 | TestVector& TestVector::Instance() 50 | { 51 | static TestVector singleton; 52 | return singleton; 53 | } 54 | 55 | void TestVector::push_back(std::shared_ptr x) 56 | { 57 | std::lock_guard mutexLock(this->pimpl->testVectorMutex); 58 | this->pimpl->testVector.push_back(x); 59 | } 60 | 61 | size_t TestVector::size() const 62 | { 63 | std::lock_guard mutexLock(this->pimpl->testVectorMutex); 64 | return this->pimpl->testVector.size(); 65 | } 66 | 67 | std::shared_ptr TestVector::operator[](size_t x) 68 | { 69 | std::lock_guard mutexLock(this->pimpl->testVectorMutex); 70 | return this->pimpl->testVector[x]; 71 | } 72 | 73 | std::shared_ptr TestVector::operator[](const std::string& x) 74 | { 75 | std::lock_guard mutexLock(this->pimpl->testVectorMutex); 76 | 77 | const auto found = std::find_if(std::begin(this->pimpl->testVector), std::end(this->pimpl->testVector), 78 | [x](std::shared_ptr const& bmark)->bool 79 | { 80 | return (bmark->getName() == x); 81 | }); 82 | 83 | if(found != std::end(this->pimpl->testVector)) 84 | { 85 | return *found; 86 | } 87 | 88 | return nullptr; 89 | } 90 | -------------------------------------------------------------------------------- /celeroTest/Celero-master/src/Timer.cpp: -------------------------------------------------------------------------------- 1 | /// 2 | /// \author John Farrier 3 | /// 4 | /// \copyright Copyright 2015 John Farrier 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 | 19 | #include 20 | #include 21 | 22 | #ifdef WIN32 23 | #include 24 | LARGE_INTEGER QPCFrequency; 25 | #else 26 | #include 27 | #endif 28 | 29 | #include 30 | 31 | uint64_t celero::timer::GetSystemTime() 32 | { 33 | #ifdef WIN32 34 | LARGE_INTEGER timeStorage; 35 | QueryPerformanceCounter(&timeStorage); 36 | return static_cast(timeStorage.QuadPart * 1000000)/static_cast(QPCFrequency.QuadPart); 37 | #else 38 | auto timePoint = std::chrono::high_resolution_clock::now(); 39 | return std::chrono::duration_cast(timePoint.time_since_epoch()).count(); 40 | #endif 41 | } 42 | 43 | double celero::timer::ConvertSystemTime(uint64_t x) 44 | { 45 | return x * 1.0e-6; 46 | } 47 | 48 | void celero::timer::CachePerformanceFrequency() 49 | { 50 | std::cout << "Timer resolution: "; 51 | 52 | #ifdef WIN32 53 | QueryPerformanceFrequency(&QPCFrequency); 54 | auto precision = ((1.0/static_cast(QPCFrequency.QuadPart)) * 1000000.0); 55 | #else 56 | auto precision = (static_cast(std::chrono::high_resolution_clock::period::num) / 57 | static_cast(std::chrono::high_resolution_clock::period::den)) * 1000000.0; 58 | #endif 59 | 60 | std::cout << std::to_string(precision) << " us\n"; 61 | } 62 | -------------------------------------------------------------------------------- /celeroTest/Release/celeroTest.log: -------------------------------------------------------------------------------- 1 | C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(392,5): warning MSB8028: The intermediate directory (Release\) contains files shared from another project (celeroCompressBools.vcxproj, celeroParticles.vcxproj). This can lead to incorrect clean and rebuild behavior. 2 | celeroTest.cpp 3 | celeroTest.cpp : fatal error C1041: cannot open program database 'D:\github\benchmarkLibsTest\celeroTest\Release\vc140.pdb'; if multiple CL.EXE write to the same .PDB file, please use /FS 4 | -------------------------------------------------------------------------------- /celeroTest/celeroParticles.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /celeroTest/celeroTest.cpp: -------------------------------------------------------------------------------- 1 | #include "celero\Celero.h" 2 | #include "../commonTest.h" 3 | 4 | CELERO_MAIN; 5 | 6 | // Run an automatic baseline. 7 | // Celero will help make sure enough samples are taken to get a reasonable measurement 8 | BASELINE(IntToStringTest, Baseline10, 0, 100) 9 | { 10 | celero::DoNotOptimizeAway(IntToStringConversionTest(TEST_NUM_COUNT10)); 11 | } 12 | 13 | BENCHMARK(IntToStringTest, Baseline1000, 0, 100) 14 | { 15 | celero::DoNotOptimizeAway(IntToStringConversionTest(TEST_NUM_COUNT1000)); 16 | } 17 | 18 | BASELINE(DoubleToStringTest, Baseline10, 10, 100) 19 | { 20 | celero::DoNotOptimizeAway(DoubleToStringConversionTest(TEST_NUM_COUNT10)); 21 | } 22 | 23 | BENCHMARK(DoubleToStringTest, Baseline1000, 10, 100) 24 | { 25 | celero::DoNotOptimizeAway(DoubleToStringConversionTest(TEST_NUM_COUNT1000)); 26 | } 27 | -------------------------------------------------------------------------------- /celeroTest/celeroTest.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /celeroTest/celeroTest.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /commonTest.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #define TEST_NUM_COUNT10 10 8 | #define TEST_NUM_COUNT100 100 9 | #define TEST_NUM_COUNT1000 1000 10 | 11 | auto IntToStringConversionTest(int count) 12 | { 13 | std::vector inputNumbers(count); 14 | std::vector outNumbers; 15 | 16 | std::iota(std::begin(inputNumbers), std::end(inputNumbers), 0); 17 | for (auto &num : inputNumbers) 18 | outNumbers.push_back(std::to_string(num)); 19 | 20 | return outNumbers; 21 | } 22 | 23 | auto DoubleToStringConversionTest(int count) 24 | { 25 | std::vector inputNumbers(count); 26 | std::vector outNumbers; 27 | 28 | std::iota(std::begin(inputNumbers), std::end(inputNumbers), 0.12345); 29 | for (auto &num : inputNumbers) 30 | outNumbers.push_back(std::to_string(num)); 31 | 32 | return outNumbers; 33 | } -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/.gitignore: -------------------------------------------------------------------------------- 1 | *.a 2 | *.so 3 | *.so.?* 4 | *.dll 5 | *.exe 6 | *.dylib 7 | *.cmake 8 | !/cmake/*.cmake 9 | *~ 10 | *.pyc 11 | __pycache__ 12 | 13 | # lcov 14 | *.lcov 15 | /lcov 16 | 17 | # cmake files. 18 | /Testing 19 | CMakeCache.txt 20 | CMakeFiles/ 21 | cmake_install.cmake 22 | 23 | # makefiles. 24 | Makefile 25 | 26 | # in-source build. 27 | bin/ 28 | lib/ 29 | /test/*_test 30 | 31 | # exuberant ctags. 32 | tags 33 | 34 | # YouCompleteMe configuration. 35 | .ycm_extra_conf.pyc 36 | 37 | # ninja generated files. 38 | .ninja_deps 39 | .ninja_log 40 | build.ninja 41 | install_manifest.txt 42 | rules.ninja 43 | 44 | # out-of-source build top-level folders. 45 | build/ 46 | _build/ 47 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/.travis-setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Before install 4 | 5 | sudo add-apt-repository -y ppa:kalakris/cmake 6 | if [ "$STD" = "c++11" ]; then 7 | sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test 8 | if [ "$CXX" = "clang++" ]; then 9 | wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add - 10 | sudo add-apt-repository -y "deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.6 main" 11 | fi 12 | fi 13 | sudo apt-get update -qq 14 | 15 | # Install 16 | sudo apt-get install -qq cmake 17 | if [ "$STD" = "c++11" ] && [ "$CXX" = "g++" ]; then 18 | sudo apt-get install -qq gcc-4.8 g++-4.8 19 | sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 90 20 | sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90 21 | elif [ "$CXX" = "clang++" ]; then 22 | sudo apt-get install -qq clang-3.6 23 | sudo update-alternatives --install /usr/local/bin/clang clang /usr/bin/clang-3.6 90 24 | sudo update-alternatives --install /usr/local/bin/clang++ clang++ /usr/bin/clang++-3.6 90 25 | export PATH=/usr/local/bin:$PATH 26 | fi 27 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | 3 | # NOTE: The COMPILER variable is unused. It simply makes the display on 4 | # travis-ci.org more readable. 5 | matrix: 6 | include: 7 | - compiler: gcc 8 | env: COMPILER=g++-4.6 STD=c++0x BUILD_TYPE=Coverage 9 | - compiler: gcc 10 | env: COMPILER=g++-4.6 STD=c++0x BUILD_TYPE=Debug 11 | - compiler: gcc 12 | env: COMPILER=g++-4.6 STD=c++0x BUILD_TYPE=Release 13 | - compiler: gcc 14 | env: COMPILER=g++-4.8 STD=c++11 BUILD_TYPE=Debug 15 | - compiler: gcc 16 | env: COMPILER=g++-4.8 STD=c++11 BUILD_TYPE=Release 17 | - compiler: clang 18 | env: COMPILER=clang++-3.6 STD=c++11 BUILD_TYPE=Debug 19 | - compiler: clang 20 | env: COMPILER=clang++-3.6 STD=c++11 BUILD_TYPE=Release 21 | 22 | before_script: 23 | - source .travis-setup.sh 24 | - mkdir build && cd build 25 | 26 | install: 27 | - if [ "${BUILD_TYPE}" == "Coverage" -a "${TRAVIS_OS_NAME}" == "linux" ]; then 28 | PATH=~/.local/bin:${PATH}; 29 | pip install --user --upgrade pip; 30 | pip install --user cpp-coveralls; 31 | fi 32 | 33 | script: 34 | - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_CXX_FLAGS="-std=${STD}" 35 | - make 36 | - make CTEST_OUTPUT_ON_FAILURE=1 test 37 | 38 | after_success: 39 | - if [ "${BUILD_TYPE}" == "Coverage" -a "${TRAVIS_OS_NAME}" == "linux" ]; then 40 | coveralls --include src --include include --gcov-options '\-lp' --root .. --build-root .; 41 | fi 42 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/ALL_BUILD.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/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 | Arne Beer 12 | Christopher Seymour 13 | David Coeurjolly 14 | Dominic Hamon 15 | Eugene Zhuk 16 | Evgeny Safronov 17 | Felix Homann 18 | Google Inc. 19 | JianXiong Zhou 20 | Jussi Knuuttila 21 | Kaito Udagawa 22 | Lei Xu 23 | Matt Clarkson 24 | Oleksandr Sochka 25 | Paul Redmond 26 | Radoslav Yovchev 27 | Shuo Chen 28 | Yusuke Suzuki 29 | Dirac Research 30 | Zbigniew Skowron 31 | Dominik Czarnota 32 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # People who have agreed to one of the CLAs and can contribute patches. 2 | # The AUTHORS file lists the copyright holders; this file 3 | # lists people. For example, Google employees are listed here 4 | # but not in AUTHORS, because Google holds the copyright. 5 | # 6 | # Names should be added to this file only after verifying that 7 | # the individual or the individual's organization has agreed to 8 | # the appropriate Contributor License Agreement, found here: 9 | # 10 | # https://developers.google.com/open-source/cla/individual 11 | # https://developers.google.com/open-source/cla/corporate 12 | # 13 | # The agreement for individuals can be filled out on the web. 14 | # 15 | # When adding J Random Contributor's name to this file, 16 | # either J's name or J's organization's name should be 17 | # added to the AUTHORS file, depending on whether the 18 | # individual or corporate CLA was used. 19 | # 20 | # Names should be added to this file as: 21 | # Name 22 | # 23 | # Please keep the list sorted. 24 | 25 | Arne Beer 26 | Chris Kennelly 27 | Christopher Seymour 28 | David Coeurjolly 29 | Dominic Hamon 30 | Eugene Zhuk 31 | Evgeny Safronov 32 | Felix Homann 33 | JianXiong Zhou 34 | Jussi Knuuttila 35 | Kaito Udagawa 36 | Kai Wolf 37 | Lei Xu 38 | Matt Clarkson 39 | Oleksandr Sochka 40 | Pascal Leroy 41 | Paul Redmond 42 | Pierre Phaneuf 43 | Radoslav Yovchev 44 | Shuo Chen 45 | Yusuke Suzuki 46 | Tobias Ulvgård 47 | Zbigniew Skowron 48 | Dominik Czarnota 49 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/INSTALL.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | CMake Rules 6 | 7 | 8 | 9 | 10 | {204202EE-7A2D-3C35-88CF-0AE2C34270F4} 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/RUN_TESTS.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | CMake Rules 6 | 7 | 8 | 9 | 10 | {204202EE-7A2D-3C35-88CF-0AE2C34270F4} 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/Win32/MinSizeRel/ZERO_CHECK/ZERO_CHECK.tlog/ZERO_CHECK.lastbuildstate: -------------------------------------------------------------------------------- 1 | #TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.10586.0 2 | MinSizeRel|Win32|C:\Users\fen\Downloads\benchmark-master(1)\benchmark-master\| 3 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/Win32/MinSizeRel/ZERO_CHECK/ZERO_CHECK.tlog/custombuild.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenbf/benchmarkLibsTest/35cc3c702a929dd9156e10a62e4a15682a1b5c97/googleBenchmarkTest/benchmark-master32/Win32/MinSizeRel/ZERO_CHECK/ZERO_CHECK.tlog/custombuild.command.1.tlog -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/Win32/MinSizeRel/ZERO_CHECK/ZERO_CHECK.tlog/custombuild.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenbf/benchmarkLibsTest/35cc3c702a929dd9156e10a62e4a15682a1b5c97/googleBenchmarkTest/benchmark-master32/Win32/MinSizeRel/ZERO_CHECK/ZERO_CHECK.tlog/custombuild.read.1.tlog -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/Win32/MinSizeRel/ZERO_CHECK/ZERO_CHECK.tlog/custombuild.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenbf/benchmarkLibsTest/35cc3c702a929dd9156e10a62e4a15682a1b5c97/googleBenchmarkTest/benchmark-master32/Win32/MinSizeRel/ZERO_CHECK/ZERO_CHECK.tlog/custombuild.write.1.tlog -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/ZERO_CHECK.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | CMake Rules 6 | 7 | 8 | 9 | 10 | {204202EE-7A2D-3C35-88CF-0AE2C34270F4} 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/cmake/AddCXXCompilerFlag.cmake: -------------------------------------------------------------------------------- 1 | # - Adds a compiler flag if it is supported by the compiler 2 | # 3 | # This function checks that the supplied compiler flag is supported and then 4 | # adds it to the corresponding compiler flags 5 | # 6 | # add_cxx_compiler_flag( []) 7 | # 8 | # - Example 9 | # 10 | # include(AddCXXCompilerFlag) 11 | # add_cxx_compiler_flag(-Wall) 12 | # add_cxx_compiler_flag(-no-strict-aliasing RELEASE) 13 | # Requires CMake 2.6+ 14 | 15 | if(__add_cxx_compiler_flag) 16 | return() 17 | endif() 18 | set(__add_cxx_compiler_flag INCLUDED) 19 | 20 | include(CheckCXXCompilerFlag) 21 | 22 | function(add_cxx_compiler_flag FLAG) 23 | string(TOUPPER "HAVE_CXX_FLAG_${FLAG}" SANITIZED_FLAG) 24 | string(REPLACE "+" "X" SANITIZED_FLAG ${SANITIZED_FLAG}) 25 | string(REGEX REPLACE "[^A-Za-z_0-9]" "_" SANITIZED_FLAG ${SANITIZED_FLAG}) 26 | string(REGEX REPLACE "_+" "_" SANITIZED_FLAG ${SANITIZED_FLAG}) 27 | set(CMAKE_REQUIRED_FLAGS "${FLAG}") 28 | check_cxx_compiler_flag("" ${SANITIZED_FLAG}) 29 | if(${SANITIZED_FLAG}) 30 | set(VARIANT ${ARGV1}) 31 | if(ARGV1) 32 | string(TOUPPER "_${VARIANT}" VARIANT) 33 | endif() 34 | set(CMAKE_CXX_FLAGS${VARIANT} "${CMAKE_CXX_FLAGS${VARIANT}} ${FLAG}" PARENT_SCOPE) 35 | endif() 36 | endfunction() 37 | 38 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/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.6+ 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 | message("-- Performing Test ${FEATURE}") 25 | try_run(RUN_${FEATURE} COMPILE_${FEATURE} 26 | ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${FILE}.cpp) 27 | if(RUN_${FEATURE} EQUAL 0) 28 | message("-- Performing Test ${FEATURE} -- success") 29 | set(HAVE_${VAR} 1 PARENT_SCOPE) 30 | add_definitions(-DHAVE_${VAR}) 31 | else() 32 | if(NOT COMPILE_${FEATURE}) 33 | message("-- Performing Test ${FEATURE} -- failed to compile") 34 | else() 35 | message("-- Performing Test ${FEATURE} -- compiled but failed to run") 36 | endif() 37 | endif() 38 | endfunction() 39 | 40 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/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 | RESULT_VARIABLE status 25 | OUTPUT_VARIABLE GIT_VERSION 26 | ERROR_QUIET) 27 | if(${status}) 28 | set(GIT_VERSION "v0.0.0") 29 | else() 30 | string(STRIP ${GIT_VERSION} GIT_VERSION) 31 | string(REGEX REPLACE "-[0-9]+-g" "-" GIT_VERSION ${GIT_VERSION}) 32 | endif() 33 | 34 | # Work out if the repository is dirty 35 | execute_process(COMMAND ${GIT_EXECUTABLE} update-index -q --refresh 36 | OUTPUT_QUIET 37 | ERROR_QUIET) 38 | execute_process(COMMAND ${GIT_EXECUTABLE} diff-index --name-only HEAD -- 39 | OUTPUT_VARIABLE GIT_DIFF_INDEX 40 | ERROR_QUIET) 41 | string(COMPARE NOTEQUAL "${GIT_DIFF_INDEX}" "" GIT_DIRTY) 42 | if (${GIT_DIRTY}) 43 | set(GIT_VERSION "${GIT_VERSION}-dirty") 44 | endif() 45 | else() 46 | set(GIT_VERSION "v0.0.0") 47 | endif() 48 | 49 | message("-- git Version: ${GIT_VERSION}") 50 | set(${var} ${GIT_VERSION} PARENT_SCOPE) 51 | endfunction() 52 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/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 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/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 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/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 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/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 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/cmake/thread_safety_attributes.cpp: -------------------------------------------------------------------------------- 1 | #define HAVE_THREAD_SAFETY_ATTRIBUTES 2 | #include "../src/mutex.h" 3 | 4 | int main() {} 5 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/include/benchmark/benchmark.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 | #ifndef BENCHMARK_BENCHMARK_H_ 15 | #define BENCHMARK_BENCHMARK_H_ 16 | 17 | #include "macros.h" 18 | #include "benchmark_api.h" 19 | #include "reporter.h" 20 | 21 | #endif // BENCHMARK_BENCHMARK_H_ 22 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/include/benchmark/macros.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 | #ifndef BENCHMARK_MACROS_H_ 15 | #define BENCHMARK_MACROS_H_ 16 | 17 | #if __cplusplus < 201103L 18 | # define BENCHMARK_DISALLOW_COPY_AND_ASSIGN(TypeName) \ 19 | TypeName(const TypeName&); \ 20 | TypeName& operator=(const TypeName&) 21 | #else 22 | # define BENCHMARK_DISALLOW_COPY_AND_ASSIGN(TypeName) \ 23 | TypeName(const TypeName&) = delete; \ 24 | TypeName& operator=(const TypeName&) = delete 25 | #endif 26 | 27 | #if defined(__GNUC__) 28 | # define BENCHMARK_UNUSED __attribute__((unused)) 29 | # define BENCHMARK_ALWAYS_INLINE __attribute__((always_inline)) 30 | # define BENCHMARK_NOEXCEPT noexcept 31 | #elif defined(_MSC_VER) && !defined(__clang__) 32 | # define BENCHMARK_UNUSED 33 | # define BENCHMARK_ALWAYS_INLINE __forceinline 34 | # define BENCHMARK_NOEXCEPT 35 | # define __func__ __FUNCTION__ 36 | #else 37 | # define BENCHMARK_UNUSED 38 | # define BENCHMARK_ALWAYS_INLINE 39 | # define BENCHMARK_NOEXCEPT 40 | #endif 41 | 42 | #if defined(__GNUC__) 43 | # define BENCHMARK_BUILTIN_EXPECT(x, y) __builtin_expect(x, y) 44 | #else 45 | # define BENCHMARK_BUILTIN_EXPECT(x, y) x 46 | #endif 47 | 48 | #endif // BENCHMARK_MACROS_H_ 49 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Allow the source files to find headers in src/ 2 | include_directories(${PROJECT_SOURCE_DIR}/src) 3 | 4 | # Define the source files 5 | set(SOURCE_FILES "benchmark.cc" "colorprint.cc" "commandlineflags.cc" 6 | "console_reporter.cc" "csv_reporter.cc" "json_reporter.cc" 7 | "log.cc" "reporter.cc" "sleep.cc" "string_util.cc" 8 | "sysinfo.cc" "walltime.cc") 9 | # Determine the correct regular expression engine to use 10 | if(HAVE_STD_REGEX) 11 | set(RE_FILES "re_std.cc") 12 | elseif(HAVE_GNU_POSIX_REGEX) 13 | set(RE_FILES "re_posix.cc") 14 | elseif(HAVE_POSIX_REGEX) 15 | set(RE_FILES "re_posix.cc") 16 | else() 17 | message(FATAL_ERROR "Failed to determine the source files for the regular expression backend") 18 | endif() 19 | 20 | add_library(benchmark ${SOURCE_FILES} ${RE_FILES}) 21 | 22 | 23 | set_target_properties(benchmark PROPERTIES 24 | OUTPUT_NAME "benchmark" 25 | VERSION ${GENERIC_LIB_VERSION} 26 | SOVERSION ${GENERIC_LIB_SOVERSION} 27 | ) 28 | 29 | # Link threads. 30 | target_link_libraries(benchmark ${CMAKE_THREAD_LIBS_INIT}) 31 | 32 | # We need extra libraries on Windows 33 | if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") 34 | target_link_libraries(benchmark Shlwapi) 35 | endif() 36 | 37 | # Expose public API 38 | target_include_directories(benchmark PUBLIC ${PROJECT_SOURCE_DIR}/include) 39 | 40 | # Install target (will install the library to specified CMAKE_INSTALL_PREFIX variable) 41 | install( 42 | TARGETS benchmark 43 | ARCHIVE DESTINATION lib 44 | LIBRARY DESTINATION lib 45 | RUNTIME DESTINATION bin 46 | COMPONENT library) 47 | 48 | install( 49 | DIRECTORY "${PROJECT_SOURCE_DIR}/include/benchmark" 50 | DESTINATION include 51 | FILES_MATCHING PATTERN "*.*h") 52 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/src/INSTALL.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | CMake Rules 6 | 7 | 8 | 9 | 10 | {204202EE-7A2D-3C35-88CF-0AE2C34270F4} 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/src/MinSizeRel/benchmark.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenbf/benchmarkLibsTest/35cc3c702a929dd9156e10a62e4a15682a1b5c97/googleBenchmarkTest/benchmark-master32/src/MinSizeRel/benchmark.lib -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/src/RUN_TESTS.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | CMake Rules 6 | 7 | 8 | 9 | 10 | {204202EE-7A2D-3C35-88CF-0AE2C34270F4} 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/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 | 15 | // This template function declaration is used in defining arraysize. 16 | // Note that the function doesn't need an implementation, as we only 17 | // use its type. 18 | template 19 | char (&ArraySizeHelper(T (&array)[N]))[N]; 20 | 21 | // That gcc wants both of these prototypes seems mysterious. VC, for 22 | // its part, can't decide which to use (another mystery). Matching of 23 | // template overloads: the final frontier. 24 | #ifndef COMPILER_MSVC 25 | template 26 | char (&ArraySizeHelper(const T (&array)[N]))[N]; 27 | #endif 28 | 29 | #define arraysize(array) (sizeof(::benchmark::internal::ArraySizeHelper(array))) 30 | 31 | } // end namespace internal 32 | } // end namespace benchmark 33 | 34 | #endif // BENCHMARK_ARRAYSIZE_H_ 35 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/src/check.h: -------------------------------------------------------------------------------- 1 | #ifndef CHECK_H_ 2 | #define CHECK_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include "internal_macros.h" 8 | #include "log.h" 9 | 10 | namespace benchmark { 11 | namespace internal { 12 | 13 | // CheckHandler is the class constructed by failing CHECK macros. CheckHandler 14 | // will log information about the failures and abort when it is destructed. 15 | class CheckHandler { 16 | public: 17 | CheckHandler(const char* check, const char* file, const char* func, int line) 18 | : log_(GetErrorLogInstance()) 19 | { 20 | log_ << file << ":" << line << ": " << func << ": Check `" 21 | << check << "' failed. "; 22 | } 23 | 24 | std::ostream& GetLog() { 25 | return log_; 26 | } 27 | 28 | BENCHMARK_NORETURN ~CheckHandler() { 29 | log_ << std::endl; 30 | std::abort(); 31 | } 32 | 33 | CheckHandler & operator=(const CheckHandler&) = delete; 34 | CheckHandler(const CheckHandler&) = delete; 35 | CheckHandler() = delete; 36 | private: 37 | std::ostream& log_; 38 | }; 39 | 40 | } // end namespace internal 41 | } // end namespace benchmark 42 | 43 | // The CHECK macro returns a std::ostream object that can have extra information 44 | // written to it. 45 | #ifndef NDEBUG 46 | # define CHECK(b) (b ? ::benchmark::internal::GetNullLogInstance() \ 47 | : ::benchmark::internal::CheckHandler( \ 48 | #b, __FILE__, __func__, __LINE__).GetLog()) 49 | #else 50 | # define CHECK(b) ::benchmark::internal::GetNullLogInstance() 51 | #endif 52 | 53 | #define CHECK_EQ(a, b) CHECK((a) == (b)) 54 | #define CHECK_NE(a, b) CHECK((a) != (b)) 55 | #define CHECK_GE(a, b) CHECK((a) >= (b)) 56 | #define CHECK_LE(a, b) CHECK((a) <= (b)) 57 | #define CHECK_GT(a, b) CHECK((a) > (b)) 58 | #define CHECK_LT(a, b) CHECK((a) < (b)) 59 | 60 | #endif // CHECK_H_ 61 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/src/colorprint.h: -------------------------------------------------------------------------------- 1 | #ifndef BENCHMARK_COLORPRINT_H_ 2 | #define BENCHMARK_COLORPRINT_H_ 3 | 4 | namespace benchmark { 5 | enum LogColor { 6 | COLOR_DEFAULT, 7 | COLOR_RED, 8 | COLOR_GREEN, 9 | COLOR_YELLOW, 10 | COLOR_BLUE, 11 | COLOR_MAGENTA, 12 | COLOR_CYAN, 13 | COLOR_WHITE 14 | }; 15 | 16 | void ColorPrintf(LogColor color, const char* fmt, ...); 17 | } // end namespace benchmark 18 | 19 | #endif // BENCHMARK_COLORPRINT_H_ 20 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/src/internal_macros.h: -------------------------------------------------------------------------------- 1 | #ifndef BENCHMARK_INTERNAL_MACROS_H_ 2 | #define BENCHMARK_INTERNAL_MACROS_H_ 3 | 4 | #include "benchmark/macros.h" 5 | 6 | #ifndef __has_feature 7 | # define __has_feature(x) 0 8 | #endif 9 | 10 | #if __has_feature(cxx_attributes) 11 | # define BENCHMARK_NORETURN [[noreturn]] 12 | #elif defined(__GNUC__) 13 | # define BENCHMARK_NORETURN __attribute__((noreturn)) 14 | #else 15 | # define BENCHMARK_NORETURN 16 | #endif 17 | 18 | #if defined(__CYGWIN__) 19 | # define BENCHMARK_OS_CYGWIN 1 20 | #elif defined(_WIN32) 21 | # define BENCHMARK_OS_WINDOWS 1 22 | #elif defined(__APPLE__) 23 | // TODO(ericwf) This doesn't actually check that it is a Mac OSX system. Just 24 | // that it is an apple system. 25 | # define BENCHMARK_OS_MACOSX 1 26 | #elif defined(__FreeBSD__) 27 | # define BENCHMARK_OS_FREEBSD 1 28 | #elif defined(__linux__) 29 | # define BENCHMARK_OS_LINUX 1 30 | #endif 31 | 32 | #if defined(__clang__) 33 | # define COMPILER_CLANG 34 | #elif defined(_MSC_VER) 35 | # define COMPILER_MSVC 36 | #elif defined(__GNUC__) 37 | # define COMPILER_GCC 38 | #endif 39 | 40 | #endif // BENCHMARK_INTERNAL_MACROS_H_ 41 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/src/log.cc: -------------------------------------------------------------------------------- 1 | #include "log.h" 2 | 3 | #include 4 | 5 | namespace benchmark { 6 | namespace internal { 7 | 8 | int& LoggingLevelImp() { 9 | static int level = 0; 10 | return level; 11 | } 12 | 13 | void SetLogLevel(int value) { 14 | LoggingLevelImp() = value; 15 | } 16 | 17 | int GetLogLevel() { 18 | return LoggingLevelImp(); 19 | } 20 | 21 | class NullLogBuffer : public std::streambuf 22 | { 23 | public: 24 | int overflow(int c) { 25 | return c; 26 | } 27 | }; 28 | 29 | std::ostream& GetNullLogInstance() { 30 | static NullLogBuffer log_buff; 31 | static std::ostream null_log(&log_buff); 32 | return null_log; 33 | } 34 | 35 | std::ostream& GetErrorLogInstance() { 36 | return std::clog; 37 | } 38 | 39 | } // end namespace internal 40 | } // end namespace benchmark -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/src/log.h: -------------------------------------------------------------------------------- 1 | #ifndef BENCHMARK_LOG_H_ 2 | #define BENCHMARK_LOG_H_ 3 | 4 | #include 5 | 6 | namespace benchmark { 7 | namespace internal { 8 | 9 | int GetLogLevel(); 10 | void SetLogLevel(int level); 11 | 12 | std::ostream& GetNullLogInstance(); 13 | std::ostream& GetErrorLogInstance(); 14 | 15 | inline std::ostream& GetLogInstanceForLevel(int level) { 16 | if (level <= GetLogLevel()) { 17 | return GetErrorLogInstance(); 18 | } 19 | return GetNullLogInstance(); 20 | } 21 | 22 | } // end namespace internal 23 | } // end namespace benchmark 24 | 25 | #define VLOG(x) (::benchmark::internal::GetLogInstanceForLevel(x) \ 26 | << "-- LOG(" << x << "): ") 27 | 28 | #endif -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/src/re.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 | #ifndef BENCHMARK_RE_H_ 16 | #define BENCHMARK_RE_H_ 17 | 18 | #if defined(HAVE_STD_REGEX) 19 | #include 20 | #elif defined(HAVE_GNU_POSIX_REGEX) 21 | #include 22 | #elif defined(HAVE_POSIX_REGEX) 23 | #include 24 | #else 25 | #error No regular expression backend was found! 26 | #endif 27 | #include 28 | 29 | namespace benchmark { 30 | 31 | // A wrapper around the POSIX regular expression API that provides automatic 32 | // cleanup 33 | class Regex { 34 | public: 35 | Regex(); 36 | ~Regex(); 37 | 38 | // Compile a regular expression matcher from spec. Returns true on success. 39 | // 40 | // On failure (and if error is not nullptr), error is populated with a human 41 | // readable error message if an error occurs. 42 | bool Init(const std::string& spec, std::string* error); 43 | 44 | // Returns whether str matches the compiled regular expression. 45 | bool Match(const std::string& str); 46 | private: 47 | bool init_; 48 | // Underlying regular expression object 49 | #if defined(HAVE_STD_REGEX) 50 | std::regex re_; 51 | #elif defined(HAVE_POSIX_REGEX) || defined(HAVE_GNU_POSIX_REGEX) 52 | regex_t re_; 53 | #else 54 | # error No regular expression backend implementation available 55 | #endif 56 | }; 57 | 58 | } // end namespace benchmark 59 | 60 | #endif // BENCHMARK_RE_H_ 61 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/src/re_posix.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 "check.h" 16 | #include "re.h" 17 | 18 | namespace benchmark { 19 | 20 | Regex::Regex() : init_(false) { } 21 | 22 | bool Regex::Init(const std::string& spec, std::string* error) { 23 | int ec = regcomp(&re_, spec.c_str(), REG_EXTENDED | REG_NOSUB); 24 | if (ec != 0) { 25 | if (error) { 26 | size_t needed = regerror(ec, &re_, nullptr, 0); 27 | char* errbuf = new char[needed]; 28 | regerror(ec, &re_, errbuf, needed); 29 | 30 | // regerror returns the number of bytes necessary to null terminate 31 | // the string, so we move that when assigning to error. 32 | CHECK_NE(needed, 0); 33 | error->assign(errbuf, needed - 1); 34 | 35 | delete[] errbuf; 36 | } 37 | 38 | return false; 39 | } 40 | 41 | init_ = true; 42 | return true; 43 | } 44 | 45 | Regex::~Regex() { 46 | if (init_) { 47 | regfree(&re_); 48 | } 49 | } 50 | 51 | bool Regex::Match(const std::string& str) { 52 | if (!init_) { 53 | return false; 54 | } 55 | 56 | return regexec(&re_, str.c_str(), 0, nullptr, 0) == 0; 57 | } 58 | 59 | } // end namespace benchmark 60 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/src/re_std.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 "re.h" 16 | 17 | namespace benchmark { 18 | 19 | Regex::Regex() : init_(false) { } 20 | 21 | bool Regex::Init(const std::string& spec, std::string* error) { 22 | try { 23 | re_ = std::regex(spec, std::regex_constants::extended); 24 | 25 | init_ = true; 26 | } catch (const std::regex_error& e) { 27 | if (error) { 28 | *error = e.what(); 29 | } 30 | } 31 | return init_; 32 | } 33 | 34 | Regex::~Regex() { } 35 | 36 | bool Regex::Match(const std::string& str) { 37 | if (!init_) { 38 | return false; 39 | } 40 | 41 | return std::regex_search(str, re_); 42 | } 43 | 44 | } // end namespace benchmark 45 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/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 | 20 | #include "internal_macros.h" 21 | 22 | #ifdef BENCHMARK_OS_WINDOWS 23 | #include 24 | #endif 25 | 26 | namespace benchmark { 27 | #ifdef BENCHMARK_OS_WINDOWS 28 | // Window's Sleep takes milliseconds argument. 29 | void SleepForMilliseconds(int milliseconds) { Sleep(milliseconds); } 30 | void SleepForSeconds(double seconds) { 31 | SleepForMilliseconds(static_cast(kNumMillisPerSecond * seconds)); 32 | } 33 | #else // BENCHMARK_OS_WINDOWS 34 | void SleepForMicroseconds(int microseconds) { 35 | struct timespec sleep_time; 36 | sleep_time.tv_sec = microseconds / kNumMicrosPerSecond; 37 | sleep_time.tv_nsec = (microseconds % kNumMicrosPerSecond) * kNumNanosPerMicro; 38 | while (nanosleep(&sleep_time, &sleep_time) != 0 && errno == EINTR) 39 | ; // Ignore signals and wait for the full interval to elapse. 40 | } 41 | 42 | void SleepForMilliseconds(int milliseconds) { 43 | SleepForMicroseconds(static_cast(milliseconds) * kNumMicrosPerMilli); 44 | } 45 | 46 | void SleepForSeconds(double seconds) { 47 | SleepForMicroseconds(static_cast(seconds * kNumMicrosPerSecond)); 48 | } 49 | #endif // BENCHMARK_OS_WINDOWS 50 | } // end namespace benchmark 51 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/src/sleep.h: -------------------------------------------------------------------------------- 1 | #ifndef BENCHMARK_SLEEP_H_ 2 | #define BENCHMARK_SLEEP_H_ 3 | 4 | #include 5 | 6 | namespace benchmark { 7 | const int64_t kNumMillisPerSecond = 1000LL; 8 | const int64_t kNumMicrosPerMilli = 1000LL; 9 | const int64_t kNumMicrosPerSecond = kNumMillisPerSecond * 1000LL; 10 | const int64_t kNumNanosPerMicro = 1000LL; 11 | const int64_t kNumNanosPerSecond = kNumNanosPerMicro * kNumMicrosPerSecond; 12 | 13 | void SleepForMilliseconds(int milliseconds); 14 | void SleepForSeconds(double seconds); 15 | } // end namespace benchmark 16 | 17 | #endif // BENCHMARK_SLEEP_H_ 18 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/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); 14 | 15 | std::string StringPrintF(const char* format, ...); 16 | 17 | inline std::ostream& 18 | StringCatImp(std::ostream& out) BENCHMARK_NOEXCEPT 19 | { 20 | return out; 21 | } 22 | 23 | template 24 | inline std::ostream& 25 | StringCatImp(std::ostream& out, First&& f, Rest&&... rest) 26 | { 27 | out << std::forward(f); 28 | return StringCatImp(out, std::forward(rest)...); 29 | } 30 | 31 | template 32 | inline std::string StrCat(Args&&... args) 33 | { 34 | std::ostringstream ss; 35 | StringCatImp(ss, std::forward(args)...); 36 | return ss.str(); 37 | } 38 | 39 | void ReplaceAll(std::string* str, const std::string& from, 40 | const std::string& to); 41 | 42 | } // end namespace benchmark 43 | 44 | #endif // BENCHMARK_STRING_UTIL_H_ 45 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/src/sysinfo.h: -------------------------------------------------------------------------------- 1 | #ifndef BENCHMARK_SYSINFO_H_ 2 | #define BENCHMARK_SYSINFO_H_ 3 | 4 | namespace benchmark { 5 | double MyCPUUsage(); 6 | double ChildrenCPUUsage(); 7 | int NumCPUs(); 8 | double CyclesPerSecond(); 9 | bool CpuScalingEnabled(); 10 | } // end namespace benchmark 11 | 12 | #endif // BENCHMARK_SYSINFO_H_ 13 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/src/walltime.h: -------------------------------------------------------------------------------- 1 | #ifndef BENCHMARK_WALLTIME_H_ 2 | #define BENCHMARK_WALLTIME_H_ 3 | 4 | #include 5 | 6 | namespace benchmark { 7 | typedef double WallTime; 8 | 9 | namespace walltime { 10 | WallTime Now(); 11 | } // end namespace walltime 12 | 13 | std::string LocalDateTimeString(); 14 | 15 | } // end namespace benchmark 16 | 17 | #endif // BENCHMARK_WALLTIME_H_ 18 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/test/INSTALL.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | CMake Rules 6 | 7 | 8 | 9 | 10 | {204202EE-7A2D-3C35-88CF-0AE2C34270F4} 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/test/RUN_TESTS.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | CMake Rules 6 | 7 | 8 | 9 | 10 | {204202EE-7A2D-3C35-88CF-0AE2C34270F4} 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/test/basic_test.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Source Files 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | {560B3582-209D-3984-868A-924C6C165895} 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/test/benchmark_test.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Source Files 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | {560B3582-209D-3984-868A-924C6C165895} 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/test/cxx03_test.cc: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include "benchmark/benchmark.h" 5 | 6 | #if __cplusplus >= 201103L 7 | #error C++11 or greater detected. Should be C++03. 8 | #endif 9 | 10 | void BM_empty(benchmark::State& state) { 11 | while (state.KeepRunning()) { 12 | volatile std::size_t x = state.iterations(); 13 | ((void)x); 14 | } 15 | } 16 | BENCHMARK(BM_empty); 17 | 18 | template 19 | void BM_template2(benchmark::State& state) { 20 | BM_empty(state); 21 | } 22 | BENCHMARK_TEMPLATE2(BM_template2, int, long); 23 | 24 | template 25 | void BM_template1(benchmark::State& state) { 26 | BM_empty(state); 27 | } 28 | BENCHMARK_TEMPLATE(BM_template1, long); 29 | BENCHMARK_TEMPLATE1(BM_template1, int); 30 | 31 | BENCHMARK_MAIN() 32 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/test/cxx03_test.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Source Files 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | {560B3582-209D-3984-868A-924C6C165895} 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/test/filter_test.cc: -------------------------------------------------------------------------------- 1 | #include "benchmark/benchmark.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | namespace { 14 | 15 | class TestReporter : public benchmark::ConsoleReporter { 16 | public: 17 | virtual bool ReportContext(const Context& context) { 18 | return ConsoleReporter::ReportContext(context); 19 | }; 20 | 21 | virtual void ReportRuns(const std::vector& report) { 22 | ++count_; 23 | ConsoleReporter::ReportRuns(report); 24 | }; 25 | 26 | TestReporter() : count_(0) {} 27 | 28 | virtual ~TestReporter() {} 29 | 30 | size_t GetCount() const { 31 | return count_; 32 | } 33 | 34 | private: 35 | mutable size_t count_; 36 | }; 37 | 38 | } // end namespace 39 | 40 | 41 | static void NoPrefix(benchmark::State& state) { 42 | while (state.KeepRunning()) {} 43 | } 44 | BENCHMARK(NoPrefix); 45 | 46 | static void BM_Foo(benchmark::State& state) { 47 | while (state.KeepRunning()) {} 48 | } 49 | BENCHMARK(BM_Foo); 50 | 51 | 52 | static void BM_Bar(benchmark::State& state) { 53 | while (state.KeepRunning()) {} 54 | } 55 | BENCHMARK(BM_Bar); 56 | 57 | 58 | static void BM_FooBar(benchmark::State& state) { 59 | while (state.KeepRunning()) {} 60 | } 61 | BENCHMARK(BM_FooBar); 62 | 63 | 64 | static void BM_FooBa(benchmark::State& state) { 65 | while (state.KeepRunning()) {} 66 | } 67 | BENCHMARK(BM_FooBa); 68 | 69 | 70 | 71 | int main(int argc, char* argv[]) { 72 | benchmark::Initialize(&argc, argv); 73 | 74 | TestReporter test_reporter; 75 | benchmark::RunSpecifiedBenchmarks(&test_reporter); 76 | 77 | if (argc == 2) { 78 | // Make sure we ran all of the tests 79 | std::stringstream ss(argv[1]); 80 | size_t expected; 81 | ss >> expected; 82 | 83 | const size_t count = test_reporter.GetCount(); 84 | if (count != expected) { 85 | std::cerr << "ERROR: Expected " << expected << " tests to be ran but only " 86 | << count << " completed" << std::endl; 87 | return -1; 88 | } 89 | } 90 | return 0; 91 | } 92 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/test/filter_test.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Source Files 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | {560B3582-209D-3984-868A-924C6C165895} 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/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() { 24 | assert(data == nullptr); 25 | } 26 | 27 | std::unique_ptr data; 28 | }; 29 | 30 | 31 | BENCHMARK_F(MyFixture, Foo)(benchmark::State& st) { 32 | assert(data.get() != nullptr); 33 | assert(*data == 42); 34 | while (st.KeepRunning()) { 35 | } 36 | } 37 | 38 | BENCHMARK_DEFINE_F(MyFixture, Bar)(benchmark::State& st) { 39 | if (st.thread_index == 0) { 40 | assert(data.get() != nullptr); 41 | assert(*data == 42); 42 | } 43 | while (st.KeepRunning()) { 44 | assert(data.get() != nullptr); 45 | assert(*data == 42); 46 | } 47 | st.SetItemsProcessed(st.range_x()); 48 | } 49 | BENCHMARK_REGISTER_F(MyFixture, Bar)->Arg(42); 50 | BENCHMARK_REGISTER_F(MyFixture, Bar)->Arg(42)->ThreadPerCpu(); 51 | 52 | BENCHMARK_MAIN() 53 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/test/fixture_test.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Source Files 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | {560B3582-209D-3984-868A-924C6C165895} 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/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(rand() % size, 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 = state.range_x(); 21 | while (state.KeepRunning()) { 22 | state.PauseTiming(); 23 | std::map m = ConstructRandomMap(size); 24 | state.ResumeTiming(); 25 | for (int i = 0; i < size; ++i) { 26 | benchmark::DoNotOptimize(m.find(rand() % size)); 27 | } 28 | } 29 | state.SetItemsProcessed(state.iterations() * size); 30 | } 31 | BENCHMARK(BM_MapLookup)->Range(1 << 3, 1 << 12); 32 | 33 | // Using fixtures. 34 | class MapFixture : public ::benchmark::Fixture { 35 | public: 36 | void SetUp(const ::benchmark::State& st) { 37 | m = ConstructRandomMap(st.range_x()); 38 | } 39 | 40 | void TearDown(const ::benchmark::State&) { 41 | m.clear(); 42 | } 43 | 44 | std::map m; 45 | }; 46 | 47 | BENCHMARK_DEFINE_F(MapFixture, Lookup)(benchmark::State& state) { 48 | const int size = state.range_x(); 49 | while (state.KeepRunning()) { 50 | for (int i = 0; i < size; ++i) { 51 | benchmark::DoNotOptimize(m.find(rand() % size)); 52 | } 53 | } 54 | state.SetItemsProcessed(state.iterations() * size); 55 | } 56 | BENCHMARK_REGISTER_F(MapFixture, Lookup)->Range(1<<3, 1<<12); 57 | 58 | BENCHMARK_MAIN() 59 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/test/map_test.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Source Files 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | {560B3582-209D-3984-868A-924C6C165895} 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/test/options_test.cc: -------------------------------------------------------------------------------- 1 | #include "benchmark/benchmark_api.h" 2 | 3 | #include 4 | #include 5 | 6 | void BM_basic(benchmark::State& state) { 7 | while (state.KeepRunning()) { 8 | } 9 | } 10 | 11 | void BM_basic_slow(benchmark::State& state) { 12 | 13 | int milliseconds = state.range_x(); 14 | std::chrono::duration sleep_duration { 15 | static_cast(milliseconds) 16 | }; 17 | 18 | while (state.KeepRunning()) { 19 | std::this_thread::sleep_for(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)->DenseRange(10, 15); 30 | BENCHMARK(BM_basic)->ArgPair(42, 42); 31 | BENCHMARK(BM_basic)->RangePair(64, 512, 64, 512); 32 | BENCHMARK(BM_basic)->MinTime(0.7); 33 | BENCHMARK(BM_basic)->UseRealTime(); 34 | BENCHMARK(BM_basic)->ThreadRange(2, 4); 35 | BENCHMARK(BM_basic)->ThreadPerCpu(); 36 | 37 | void CustomArgs(benchmark::internal::Benchmark* b) { 38 | for (int i = 0; i < 10; ++i) { 39 | b->Arg(i); 40 | } 41 | } 42 | 43 | BENCHMARK(BM_basic)->Apply(CustomArgs); 44 | 45 | BENCHMARK_MAIN() 46 | -------------------------------------------------------------------------------- /googleBenchmarkTest/benchmark-master32/test/options_test.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Source Files 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | {560B3582-209D-3984-868A-924C6C165895} 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /googleBenchmarkTest/googleBenchmarkTest.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "benchmark/benchmark_api.h" 3 | #include "../commonTest.h" 4 | 5 | void IntToString(benchmark::State& state) { 6 | while (state.KeepRunning()) { 7 | benchmark::DoNotOptimize(IntToStringConversionTest(state.range_x())); 8 | } 9 | state.SetLabel("Hello World"); 10 | state.SetBytesProcessed(1024*1024); 11 | state.SetItemsProcessed(1000); 12 | } 13 | BENCHMARK(IntToString)->Arg(TEST_NUM_COUNT1000*10)->Unit(benchmark::kMillisecond); 14 | //BENCHMARK(BasicTest)->ThreadPerCpu(); 15 | 16 | void DoubleToString(benchmark::State& state) { 17 | while (state.KeepRunning()) { 18 | benchmark::DoNotOptimize(DoubleToStringConversionTest(state.range_x())); 19 | } 20 | state.SetLabel("Foo Bar"); 21 | state.SetBytesProcessed(1024); 22 | state.SetItemsProcessed(500); 23 | } 24 | BENCHMARK(DoubleToString)->Arg(TEST_NUM_COUNT1000*10)->Unit(benchmark::kMillisecond); 25 | 26 | BENCHMARK_MAIN() 27 | 28 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore temporary files from OS' and editors. 2 | *~ 3 | .DS_Store 4 | 5 | # Ignore build output. 6 | CMakeCache.txt 7 | CMakeFiles 8 | Makefile 9 | cmake_install.cmake 10 | CTestTestfile.cmake 11 | *.a 12 | sample/sample 13 | tests/tests 14 | 15 | /build 16 | /hayai-config.cmake 17 | /hayai-targets.cmake 18 | /install_manifest.txt 19 | /Testing 20 | /debian/changelog 21 | /debian/copyright 22 | /dist 23 | /.vagrant 24 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | notifications: 3 | email: false 4 | compiler: 5 | - clang 6 | - gcc 7 | before_install: 8 | - sudo apt-get update -qq 9 | - sudo apt-get -y install valgrind 10 | before_script: 11 | - mkdir install_tmp 12 | script: 13 | - ./script/travis-cmake . 14 | - make 15 | - DESTDIR=install_tmp make install 16 | - valgrind --leak-check=full --error-exitcode=1 ./sample/sample 17 | - ./script/travis-cmake -DTEST=true . 18 | - make 19 | - make test 20 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/AUTHORS.md: -------------------------------------------------------------------------------- 1 | Hayai was originally created in 2011 by Nick Bruun . 2 | 3 | The following people have contributed to Hayai: 4 | 5 | * Nick Bruun 6 | * Alexander "nevkontakte" 7 | * Bruno Nery 8 | * Vlad Lazarenko 9 | * Mateusz Łoskot 10 | * Philipp Fischbeck 11 | * Sławomir Zborowski 12 | 13 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 - Nick Bruun. 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any damages 5 | arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it 9 | freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. If you meet (any of) the author(s), you're encouraged to buy them a beer, 18 | a drink or whatever is suited to the situation, given that you like the 19 | software. 20 | 4. This notice may not be removed or altered from any source 21 | distribution. 22 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/README.md: -------------------------------------------------------------------------------- 1 | # hayai - the C++ benchmarking framework. 2 | 3 | [![Build Status](https://travis-ci.org/nickbruun/hayai.svg?branch=master)](https://travis-ci.org/nickbruun/hayai) 4 | 5 | _hayai_ is a C++ framework for writing benchmarks for pieces of code along the lines of the normal approach for unit testing using frameworks such as [googletest](http://code.google.com/p/googletest/). For information on the origin of and how to use _hayai_, please read the [introductory blog post](https://bruun.co/2012/02/07/easy-cpp-benchmarking) until I have the time to write a proper README. 6 | 7 | 8 | ## Installing hayai 9 | 10 | hayai releases are made available for Mac OS X in [Homebrew](http://brew.sh/) and for Ubuntu LTS releases in an [Ubuntu PPA](https://launchpad.net/~bruun/+archive/ubuntu/hayai). 11 | 12 | To install from Homebrew on Mac OS X: 13 | 14 | $ brew install hayai 15 | 16 | To install from the Ubuntu PPA: 17 | 18 | $ apt-add-repository ppa:bruun/hayai 19 | $ apt-get update 20 | $ apt-get install libhayai-dev 21 | 22 | 23 | ## Building hayai 24 | 25 | _hayai_ is fully header based, but to use the simple `main` function as described in the introducty blog post, the source code must be compiled to provide `libhayai_main`. Compiling the source code requires `CMake` to be present on the system: 26 | 27 | $ cd hayai 28 | $ cmake . 29 | $ make 30 | 31 | This will also build the sample available in the `sample/` directory of the repository. 32 | 33 | 34 | ## Developing hayai 35 | 36 | _hayai_ includes a (currently not at all very comprehensive) test suite for development. To use the test suite, pass a boolean true value as the `TEST` CMake variable: 37 | 38 | $ cd hayai 39 | $ cmake -DTEST=true . 40 | $ make 41 | $ make test 42 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | # Vagrant box for building Ubuntu PPA packages. 5 | VAGRANTFILE_API_VERSION = "2" 6 | 7 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 8 | config.vm.box = "puppetlabs/ubuntu-14.04-64-nocm" 9 | config.ssh.forward_agent = true 10 | config.vm.provision "shell", 11 | inline: "apt-get update -y && apt-get upgrade -y && apt-get install -y build-essential devscripts dput debhelper" 12 | end 13 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/debian/compat: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/debian/control: -------------------------------------------------------------------------------- 1 | Source: hayai 2 | Priority: extra 3 | Maintainer: Nick Bruun 4 | Build-Depends: debhelper (>= 7), dpkg-dev (>= 1.16.1~), pkg-config, cmake 5 | Standards-Version: 3.9.3 6 | Section: libs 7 | Homepage: https://github.com/nickbruun/hayai 8 | 9 | Package: libhayai-dev 10 | Section: libdevel 11 | Architecture: any 12 | Depends: ${misc:Depends} 13 | Description: hayai C++ benchmarking framework (development files) 14 | Google Test-inspired C++ benchmarking framework. 15 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/debian/dirs: -------------------------------------------------------------------------------- 1 | usr/lib 2 | usr/include 3 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/debian/libhayai-dev.dirs: -------------------------------------------------------------------------------- 1 | usr/lib 2 | usr/include 3 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/debian/libhayai-dev.install: -------------------------------------------------------------------------------- 1 | usr/include/* 2 | usr/lib/lib*.a 3 | usr/lib/CMake/hayai/hayai-* 4 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | # Uncomment this to turn on verbose mode. 4 | export DH_VERBOSE=1 5 | 6 | # Use standard biuld flags, but with assertions disabled (for performance). 7 | DPKG_EXPORT_BUILDFLAGS = 1 8 | include /usr/share/dpkg/buildflags.mk 9 | 10 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) 11 | DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) 12 | ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) 13 | CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) 14 | else 15 | CROSS= --build $(DEB_BUILD_GNU_TYPE) 16 | endif 17 | INSTALL_ROOT=$(CURDIR)/debian/tmp 18 | 19 | build-arch: build 20 | build-indep: build 21 | build: 22 | dh_testdir 23 | dh_prep 24 | cmake -DCMAKE_INSTALL_PREFIX:PATH=$(INSTALL_ROOT)/usr . 25 | $(MAKE) 26 | 27 | clean: 28 | dh_testdir 29 | dh_testroot 30 | rm -f build-stamp 31 | [ ! -f Makefile ] || $(MAKE) clean 32 | dh_clean 33 | 34 | binary: binary-arch 35 | binary-indep: 36 | binary-arch: 37 | dh_testdir 38 | dh_testroot 39 | dh_installdirs 40 | make install 41 | dh_install 42 | dh_installdocs 43 | dh_link 44 | dh_strip 45 | dh_compress 46 | dh_fixperms 47 | dh_makeshlibs 48 | dh_installdeb 49 | dh_shlibdeps 50 | dh_gencontrol 51 | dh_md5sums 52 | dh_builddeb 53 | 54 | .PHONY: build clean binary binary-indep binary-arch 55 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/hayai-config.cmake.in: -------------------------------------------------------------------------------- 1 | # - Config file for the hayai package 2 | # 3 | # HAYAI_INCLUDE_DIRS - include directories for hayai 4 | # HAYAI_LIBRARIES - libraries to link against 5 | 6 | # Compute paths. 7 | get_filename_component(HAYAI_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) 8 | set(HAYAI_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@") 9 | 10 | # Library dependencies (contains definitions for IMPORTED targets.) 11 | include("${HAYAI_CMAKE_DIR}/hayai-targets.cmake") 12 | 13 | # These are IMPORTED targets created by hayai-targets.cmake. 14 | set(HAYAI_LIBRARIES hayai_main @LIB_TIMING@) 15 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/sample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Quench warnings about CMP0003 with CMake 2.4. 2 | if(COMMAND cmake_policy) 3 | cmake_policy(SET CMP0003 NEW) 4 | endif(COMMAND cmake_policy) 5 | 6 | include_directories( 7 | ${PROJECT_SOURCE_DIR}/src 8 | ) 9 | 10 | add_executable(sample 11 | delivery_man_benchmark.cpp 12 | delivery_man_benchmark_with_fixture.cpp 13 | delivery_man_benchmark_parameterized.cpp 14 | delivery_man_benchmark_parameterized_with_fixture.cpp 15 | delivery_man_sleep.cpp 16 | ) 17 | 18 | target_link_libraries(sample 19 | hayai_main 20 | ${LIB_TIMING} 21 | ) 22 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/sample/delivery_man.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifndef __DELIVERY_MAN 5 | #define __DELIVERY_MAN 6 | /// Delivery man. 7 | class DeliveryMan 8 | { 9 | public: 10 | /// Deliver a package. 11 | 12 | /// @param distance Distance the package has to travel. 13 | void DeliverPackage(std::size_t distance) 14 | { 15 | // Waste some clock cycles here. 16 | std::size_t largeNumber = 10000u * distance / _speed; 17 | volatile std::size_t targetNumber; 18 | while (largeNumber--) 19 | targetNumber = largeNumber; 20 | } 21 | 22 | 23 | /// Initialize a delivery man instance. 24 | 25 | /// @param speed Delivery man speed from 1 to 10. 26 | DeliveryMan(std::size_t speed) 27 | : _speed(speed) 28 | { 29 | 30 | } 31 | private: 32 | std::size_t _speed; ///< Delivery man speed from 1 to 10. 33 | }; 34 | #endif 35 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/sample/delivery_man_benchmark.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "delivery_man.hpp" 3 | 4 | BENCHMARK(DeliveryMan, DeliverPackage, 10, 100) 5 | { 6 | DeliveryMan(1).DeliverPackage(100); 7 | } 8 | 9 | BENCHMARK(DeliveryMan, DISABLED_DeliverPackage, 10, 10000) 10 | { 11 | DeliveryMan(1).DeliverPackage(10000); 12 | } 13 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/sample/delivery_man_benchmark_parameterized.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "delivery_man.hpp" 4 | 5 | /* 6 | * Benchmarks can be parameterized. Here is example for 7 | * simple test without dedicated fixture. 8 | * 9 | * Last macro argument is just method parameters declaration. 10 | * Number of arguments is not limited, just make sure that 11 | * brackets around them are present. 12 | */ 13 | BENCHMARK_P(DeliveryMan, DeliverPackage, 10, 100, 14 | (std::size_t speed, std::size_t distance)) 15 | { 16 | DeliveryMan(speed).DeliverPackage(distance); 17 | } 18 | 19 | BENCHMARK_P_INSTANCE(DeliveryMan, DeliverPackage, (1, 10)); 20 | BENCHMARK_P_INSTANCE(DeliveryMan, DeliverPackage, (5, 10)); 21 | BENCHMARK_P_INSTANCE(DeliveryMan, DeliverPackage, (10, 10)); 22 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/sample/delivery_man_benchmark_parameterized_with_fixture.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include "delivery_man.hpp" 7 | 8 | class FastDeliveryManFixture 9 | : public ::hayai::Fixture 10 | { 11 | public: 12 | virtual void SetUp() 13 | { 14 | this->FastDeliveryMan = new DeliveryMan(10); 15 | } 16 | 17 | virtual void TearDown() 18 | { 19 | delete this->FastDeliveryMan; 20 | } 21 | 22 | DeliveryMan* FastDeliveryMan; 23 | }; 24 | 25 | /* 26 | * Note _F suffix in macro name. 27 | */ 28 | BENCHMARK_P_F(FastDeliveryManFixture, DeliverPackage, 10, 100, 29 | (std::size_t distance)) 30 | { 31 | FastDeliveryMan->DeliverPackage(distance); 32 | } 33 | 34 | BENCHMARK_P_INSTANCE(FastDeliveryManFixture, DeliverPackage, (1)); 35 | BENCHMARK_P_INSTANCE(FastDeliveryManFixture, DeliverPackage, (10)); 36 | BENCHMARK_P_INSTANCE(FastDeliveryManFixture, DeliverPackage, (100)); 37 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/sample/delivery_man_benchmark_with_fixture.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "delivery_man.hpp" 4 | 5 | class SlowDeliveryManFixture 6 | : public ::hayai::Fixture 7 | { 8 | public: 9 | virtual void SetUp() 10 | { 11 | this->SlowDeliveryMan = new DeliveryMan(1); 12 | } 13 | 14 | virtual void TearDown() 15 | { 16 | delete this->SlowDeliveryMan; 17 | } 18 | 19 | DeliveryMan* SlowDeliveryMan; 20 | }; 21 | 22 | BENCHMARK_F(SlowDeliveryManFixture, DeliverPackage, 10, 100) 23 | { 24 | SlowDeliveryMan->DeliverPackage(10); 25 | } 26 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/sample/delivery_man_sleep.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef _WIN32 4 | #ifndef NOMINMAX 5 | #define NOMINMAX 6 | #endif 7 | #include 8 | 9 | inline void msleep(unsigned int duration) 10 | { 11 | Sleep(duration); 12 | } 13 | 14 | #else 15 | #include 16 | 17 | inline void msleep(unsigned int duration) 18 | { 19 | usleep(duration * 1000); 20 | } 21 | #endif 22 | 23 | // The delivery man need some sleep sometimes. 24 | // 25 | // Sleep for 1 ms 10 times. 26 | BENCHMARK(SomeSleep, Sleep1ms, 5, 10) 27 | { 28 | msleep(1); 29 | } 30 | 31 | // The delivery man need some sleep sometimes. 32 | // 33 | // Sleep for 5 ms 10 times. 34 | BENCHMARK(SomeSleep, Sleep10ms, 5, 10) 35 | { 36 | msleep(10); 37 | } 38 | 39 | // The delivery man need some sleep sometimes. 40 | // 41 | // Sleep for 20 ms 10 times. 42 | BENCHMARK(SomeSleep, Sleep20ms, 5, 10) 43 | { 44 | msleep(20); 45 | } 46 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/script/clean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 5 | BASE_DIR=$(dirname "${SCRIPT_DIR}") 6 | 7 | pushd "${BASE_DIR}" > /dev/null 8 | 9 | FILES=`find src tests -name '*.cpp' -o -name '*.hpp'` 10 | 11 | for FILE in $FILES ; do 12 | echo "Cleaning whitespace in $FILE" >&2 13 | # Replace tabs with four spaces 14 | sed -i "" $'s/\t/ /g' "$FILE" 15 | # Strip trailing whitespace 16 | sed -i '' -E 's/[[:space:]]*$//' "$FILE" 17 | done 18 | 19 | popd > /dev/null 20 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/script/travis-cmake: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -ex 3 | 4 | if [ "$CXX" = "clang++" ] 5 | then 6 | export CXXFLAGS="-Weverything -Wno-weak-vtables -Wno-global-constructors -Wno-exit-time-destructors -Wno-padded" 7 | else 8 | export CXXFLAGS="-Wall -pedantic" 9 | fi 10 | 11 | cmake $@ 12 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB hayai_headers 2 | hayai.hpp 3 | hayai_benchmarker.hpp 4 | hayai_clock.hpp 5 | hayai_compatibility.hpp 6 | hayai_console.hpp 7 | hayai_console_outputter.hpp 8 | hayai_default_test_factory.hpp 9 | hayai_fixture.hpp 10 | hayai_json_outputter.hpp 11 | hayai_junit_xml_outputter.hpp 12 | hayai_outputter.hpp 13 | hayai_test.hpp 14 | hayai_test_descriptor.hpp 15 | hayai_test_factory.hpp 16 | hayai_test_result.hpp 17 | hayai_main.hpp 18 | ) 19 | 20 | add_library(hayai_main 21 | hayai_posix_main.cpp 22 | ) 23 | 24 | set_target_properties(hayai_main PROPERTIES 25 | PUBLIC_HEADER "${hayai_headers}" 26 | ) 27 | 28 | install( 29 | TARGETS hayai_main 30 | EXPORT hayai-targets 31 | RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin 32 | ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" COMPONENT bin 33 | LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT shlib 34 | PUBLIC_HEADER DESTINATION "${INSTALL_INCLUDE_DIR}/hayai" 35 | COMPONENT dev 36 | ) 37 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/src/hayai_compatibility.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __HAYAI_COMPATIBILITY 2 | #define __HAYAI_COMPATIBILITY 3 | 4 | # if __cplusplus > 201100L 5 | # define __hayai_noexcept noexcept 6 | # else 7 | # define __hayai_noexcept 8 | # endif 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/src/hayai_default_test_factory.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __HAYAI_DEFAULTTESTFACTORY 2 | #define __HAYAI_DEFAULTTESTFACTORY 3 | #include "hayai_test_factory.hpp" 4 | 5 | namespace hayai 6 | { 7 | /// Default test factory implementation. 8 | 9 | /// Simply constructs an instance of a the test of class @ref T with no 10 | /// constructor parameters. 11 | /// 12 | /// @tparam T Test class. 13 | template 14 | class TestFactoryDefault 15 | : public TestFactory 16 | { 17 | public: 18 | /// Create a test instance with no constructor parameters. 19 | 20 | /// @returns a pointer to an initialized test. 21 | virtual Test* CreateTest() 22 | { 23 | return new T(); 24 | } 25 | }; 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/src/hayai_fixture.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __HAYAI_FIXTURE 2 | #define __HAYAI_FIXTURE 3 | #include "hayai_test.hpp" 4 | 5 | namespace hayai 6 | { 7 | typedef Test Fixture; 8 | } 9 | #endif 10 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/src/hayai_posix_main.cpp: -------------------------------------------------------------------------------- 1 | #include "hayai_main.hpp" 2 | 3 | 4 | int main(int argc, char** argv) 5 | { 6 | // Set up the main runner. 7 | ::hayai::MainRunner runner; 8 | 9 | // Parse the arguments. 10 | int result = runner.ParseArgs(argc, argv); 11 | if (result) 12 | { 13 | return result; 14 | } 15 | 16 | // Execute based on the selected mode. 17 | return runner.Run(); 18 | } 19 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/src/hayai_test.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __HAYAI_TEST 2 | #define __HAYAI_TEST 3 | #include 4 | 5 | #include "hayai_clock.hpp" 6 | #include "hayai_test_result.hpp" 7 | 8 | 9 | namespace hayai 10 | { 11 | /// Base test class. 12 | 13 | /// @ref SetUp is invoked before each run, and @ref TearDown is invoked 14 | /// once the run is finished. Iterations rely on the same fixture 15 | /// for every run. 16 | /// 17 | /// The default test class does not contain any actual code in the 18 | /// SetUp and TearDown methods, which means that tests can inherit 19 | /// this class directly for non-fixture based benchmarking tests. 20 | class Test 21 | { 22 | public: 23 | /// Set up the testing fixture for execution of a run. 24 | virtual void SetUp() 25 | { 26 | 27 | } 28 | 29 | 30 | /// Tear down the previously set up testing fixture after the 31 | /// execution run. 32 | virtual void TearDown() 33 | { 34 | 35 | } 36 | 37 | 38 | /// Run the test. 39 | 40 | /// @param iterations Number of iterations to gather data for. 41 | /// @returns the number of nanoseconds the run took. 42 | uint64_t Run(std::size_t iterations) 43 | { 44 | std::size_t iteration = iterations; 45 | 46 | // Set up the testing fixture. 47 | SetUp(); 48 | 49 | // Get the starting time. 50 | Clock::TimePoint startTime, endTime; 51 | 52 | startTime = Clock::Now(); 53 | 54 | // Run the test body for each iteration. 55 | while (iteration--) 56 | TestBody(); 57 | 58 | // Get the ending time. 59 | endTime = Clock::Now(); 60 | 61 | // Tear down the testing fixture. 62 | TearDown(); 63 | 64 | // Return the duration in nanoseconds. 65 | return Clock::Duration(startTime, endTime); 66 | } 67 | 68 | 69 | virtual ~Test() 70 | { 71 | 72 | } 73 | protected: 74 | /// Test body. 75 | 76 | /// Executed for each iteration the benchmarking test is run. 77 | virtual void TestBody() 78 | { 79 | 80 | } 81 | }; 82 | } 83 | #endif 84 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/src/hayai_test_factory.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __HAYAI_TESTFACTORY 2 | #define __HAYAI_TESTFACTORY 3 | #include "hayai_test.hpp" 4 | 5 | namespace hayai 6 | { 7 | /// Base class for test factory implementations. 8 | class TestFactory 9 | { 10 | public: 11 | /// Virtual destructor 12 | 13 | /// Has no function in the base class. 14 | virtual ~TestFactory() 15 | { 16 | 17 | } 18 | 19 | 20 | /// Creates a test instance to run. 21 | 22 | /// @returns a pointer to an initialized test. 23 | virtual Test* CreateTest() = 0; 24 | }; 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Quench warnings about CMP0003 with CMake 2.4. 2 | if(COMMAND cmake_policy) 3 | cmake_policy(SET CMP0003 NEW) 4 | endif(COMMAND cmake_policy) 5 | 6 | include_directories( 7 | ${PROJECT_SOURCE_DIR}/src 8 | ) 9 | 10 | include_directories( 11 | ${PROJECT_SOURCE_DIR}/src 12 | ${PROJECT_SOURCE_DIR}/vendor/gtest/include 13 | ) 14 | 15 | add_executable(tests 16 | hayai_test_parameter_descriptor.cpp 17 | ) 18 | 19 | target_link_libraries(tests 20 | gtest_main 21 | ${LIB_TIMING} 22 | ) 23 | 24 | add_test(HayaiTests tests) 25 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/tests/base.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "gtest/gtest.h" 5 | #include "hayai.hpp" 6 | 7 | using namespace hayai; 8 | 9 | 10 | #define ADD_FAILURE_STREAM(__msg) \ 11 | { \ 12 | std::stringstream _msg; \ 13 | _msg << __msg; \ 14 | ADD_FAILURE() << _msg.str(); \ 15 | } 16 | 17 | 18 | std::ostream& operator <<(std::ostream& s, 19 | const TestParameterDescriptor& desc) 20 | { 21 | return s << "::hayai::TestParameterDescriptor(Declaration=" 22 | << desc.Declaration << ", Value=" << desc.Value << ")"; 23 | } 24 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/build-aux/config.h.in: -------------------------------------------------------------------------------- 1 | /* build-aux/config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define to 1 if you have the header file. */ 4 | #undef HAVE_DLFCN_H 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #undef HAVE_INTTYPES_H 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #undef HAVE_MEMORY_H 11 | 12 | /* Define if you have POSIX threads libraries and header files. */ 13 | #undef HAVE_PTHREAD 14 | 15 | /* Define to 1 if you have the header file. */ 16 | #undef HAVE_STDINT_H 17 | 18 | /* Define to 1 if you have the header file. */ 19 | #undef HAVE_STDLIB_H 20 | 21 | /* Define to 1 if you have the header file. */ 22 | #undef HAVE_STRINGS_H 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_STRING_H 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_SYS_STAT_H 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #undef HAVE_SYS_TYPES_H 32 | 33 | /* Define to 1 if you have the header file. */ 34 | #undef HAVE_UNISTD_H 35 | 36 | /* Define to the sub-directory in which libtool stores uninstalled libraries. 37 | */ 38 | #undef LT_OBJDIR 39 | 40 | /* Name of package */ 41 | #undef PACKAGE 42 | 43 | /* Define to the address where bug reports for this package should be sent. */ 44 | #undef PACKAGE_BUGREPORT 45 | 46 | /* Define to the full name of this package. */ 47 | #undef PACKAGE_NAME 48 | 49 | /* Define to the full name and version of this package. */ 50 | #undef PACKAGE_STRING 51 | 52 | /* Define to the one symbol short name of this package. */ 53 | #undef PACKAGE_TARNAME 54 | 55 | /* Define to the home page for this package. */ 56 | #undef PACKAGE_URL 57 | 58 | /* Define to the version of this package. */ 59 | #undef PACKAGE_VERSION 60 | 61 | /* Define to necessary symbol if this constant uses a non-standard name on 62 | your system. */ 63 | #undef PTHREAD_CREATE_JOINABLE 64 | 65 | /* Define to 1 if you have the ANSI C header files. */ 66 | #undef STDC_HEADERS 67 | 68 | /* Version number of package */ 69 | #undef VERSION 70 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/fused-src/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # @configure_input@ 11 | 12 | # serial 3337 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.4.2]) 16 | m4_define([LT_PACKAGE_REVISION], [1.3337]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.4.2' 20 | macro_revision='1.3337' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/msvc/gtest.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest", "gtest.vcproj", "{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | EndProjectSection 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_main", "gtest_main.vcproj", "{3AF54C8A-10BF-4332-9147-F68ED9862032}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | EndProjectSection 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_unittest", "gtest_unittest.vcproj", "{4D9FDFB5-986A-4139-823C-F4EE0ED481A1}" 11 | ProjectSection(ProjectDependencies) = postProject 12 | EndProjectSection 13 | EndProject 14 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_prod_test", "gtest_prod_test.vcproj", "{24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}" 15 | ProjectSection(ProjectDependencies) = postProject 16 | EndProjectSection 17 | EndProject 18 | Global 19 | GlobalSection(SolutionConfiguration) = preSolution 20 | Debug = Debug 21 | Release = Release 22 | EndGlobalSection 23 | GlobalSection(ProjectConfiguration) = postSolution 24 | {C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}.Debug.ActiveCfg = Debug|Win32 25 | {C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}.Debug.Build.0 = Debug|Win32 26 | {C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}.Release.ActiveCfg = Release|Win32 27 | {C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}.Release.Build.0 = Release|Win32 28 | {3AF54C8A-10BF-4332-9147-F68ED9862032}.Debug.ActiveCfg = Debug|Win32 29 | {3AF54C8A-10BF-4332-9147-F68ED9862032}.Debug.Build.0 = Debug|Win32 30 | {3AF54C8A-10BF-4332-9147-F68ED9862032}.Release.ActiveCfg = Release|Win32 31 | {3AF54C8A-10BF-4332-9147-F68ED9862032}.Release.Build.0 = Release|Win32 32 | {4D9FDFB5-986A-4139-823C-F4EE0ED481A1}.Debug.ActiveCfg = Debug|Win32 33 | {4D9FDFB5-986A-4139-823C-F4EE0ED481A1}.Debug.Build.0 = Debug|Win32 34 | {4D9FDFB5-986A-4139-823C-F4EE0ED481A1}.Release.ActiveCfg = Release|Win32 35 | {4D9FDFB5-986A-4139-823C-F4EE0ED481A1}.Release.Build.0 = Release|Win32 36 | {24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}.Debug.ActiveCfg = Debug|Win32 37 | {24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}.Debug.Build.0 = Debug|Win32 38 | {24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}.Release.ActiveCfg = Release|Win32 39 | {24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}.Release.Build.0 = Release|Win32 40 | EndGlobalSection 41 | GlobalSection(ExtensibilityGlobals) = postSolution 42 | EndGlobalSection 43 | GlobalSection(ExtensibilityAddIns) = postSolution 44 | EndGlobalSection 45 | EndGlobal 46 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayai-master/vendor/gtest/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 | -------------------------------------------------------------------------------- /hayaiTest/hayaiTest.cpp: -------------------------------------------------------------------------------- 1 | #include "hayai-master\src\hayai.hpp" 2 | #include "hayai-master\src\hayai_main.hpp" 3 | #include "../commonTest.h" 4 | 5 | 6 | BENCHMARK(ToString, IntConversion1000, 10, 100) 7 | { 8 | IntToStringConversionTest(TEST_NUM_COUNT1000); 9 | } 10 | 11 | BENCHMARK(ToString, DoubleConversion1000, 10, 100) 12 | { 13 | DoubleToStringConversionTest(TEST_NUM_COUNT1000); 14 | } 15 | 16 | //int main() 17 | //{ 18 | // hayai::ConsoleOutputter consoleOutputter; 19 | // 20 | // hayai::Benchmarker::AddOutputter(consoleOutputter); 21 | // hayai::Benchmarker::RunAllTests(); 22 | // return 0; 23 | //} 24 | 25 | int main(int argc, char** argv) 26 | { 27 | // Set up the main runner. 28 | ::hayai::MainRunner runner; 29 | 30 | // Parse the arguments. 31 | int result = runner.ParseArgs(argc, argv); 32 | if (result) 33 | { 34 | return result; 35 | } 36 | 37 | // Execute based on the selected mode. 38 | return runner.Run(); 39 | } -------------------------------------------------------------------------------- /hayaiTest/hayaiTest.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /noniusTest/nonius-1.1.2/nonius/doc/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenbf/benchmarkLibsTest/35cc3c702a929dd9156e10a62e4a15682a1b5c97/noniusTest/nonius-1.1.2/nonius/doc/favicon.png -------------------------------------------------------------------------------- /noniusTest/nonius-1.1.2/nonius/doc/images/body-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenbf/benchmarkLibsTest/35cc3c702a929dd9156e10a62e4a15682a1b5c97/noniusTest/nonius-1.1.2/nonius/doc/images/body-bg.png -------------------------------------------------------------------------------- /noniusTest/nonius-1.1.2/nonius/doc/images/highlight-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenbf/benchmarkLibsTest/35cc3c702a929dd9156e10a62e4a15682a1b5c97/noniusTest/nonius-1.1.2/nonius/doc/images/highlight-bg.jpg -------------------------------------------------------------------------------- /noniusTest/nonius-1.1.2/nonius/doc/images/hr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fenbf/benchmarkLibsTest/35cc3c702a929dd9156e10a62e4a15682a1b5c97/noniusTest/nonius-1.1.2/nonius/doc/images/hr.png -------------------------------------------------------------------------------- /noniusTest/noniusParticles.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /noniusTest/noniusTest.cpp: -------------------------------------------------------------------------------- 1 | #define NONIUS_RUNNER 2 | //#define NONIUS_USE_BOOST_CHRONO 3 | #include "nonius-1.1.2\nonius\nonius.h++" 4 | #include "../commonTest.h" 5 | 6 | 7 | NONIUS_BENCHMARK("IntToStringTest1000", [] { 8 | return IntToStringConversionTest(TEST_NUM_COUNT1000); 9 | }) 10 | 11 | NONIUS_BENCHMARK("DoubleToStringTest1000", [] { 12 | return DoubleToStringConversionTest(TEST_NUM_COUNT1000); 13 | }) 14 | -------------------------------------------------------------------------------- /noniusTest/noniusTest.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /particles.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | static int randSeed = 10; 4 | inline float randF() { return 0.01f*(float)((randSeed++) % 100); }// (float)rand() / (float)RAND_MAX; } 5 | 6 | static const size_t UPDATES = 1000; 7 | static const float DELTA_TIME = 1.0f / 60.0f; 8 | 9 | template 10 | class TParticle 11 | { 12 | private: 13 | float pos[4]; 14 | float acc[4]; 15 | float vel[4]; 16 | float col[4]; 17 | float rot; 18 | float time; 19 | float buf[BufSize]; 20 | public: 21 | 22 | void generate() 23 | { 24 | acc[0] = randF(); 25 | acc[1] = randF(); 26 | acc[2] = randF(); 27 | acc[3] = randF(); 28 | pos[0] = pos[1] = pos[2] = pos[3] = 0.0f; 29 | vel[0] = randF(); 30 | vel[1] = randF(); 31 | vel[2] = randF(); 32 | vel[3] = vel[1] + vel[2]; 33 | rot = 0.0f; 34 | time = 2.0f+randF(); 35 | } 36 | 37 | void update(float dt) 38 | { 39 | vel[0] += acc[0] * dt; 40 | vel[1] += acc[1] * dt; 41 | vel[2] += acc[2] * dt; 42 | vel[3] += acc[3] * dt; 43 | pos[0] += vel[0] * dt; 44 | pos[1] += vel[1] * dt; 45 | pos[2] += vel[2] * dt; 46 | pos[3] += vel[3] * dt; 47 | col[0] = pos[0] * 0.001f; 48 | col[1] = pos[1] * 0.001f; 49 | col[2] = pos[2] * 0.001f; 50 | col[3] = pos[3] * 0.001f; 51 | rot += vel[3] * dt; 52 | time -= dt; 53 | 54 | for (int i = 0; i < BufSize; ++i) 55 | buf[i] = vel[i%4] + vel[i%4] + vel[2] + pos[0] + pos[1] + pos[i%4]; 56 | 57 | if (time < 0.0f) 58 | generate(); 59 | } 60 | }; 61 | 62 | using Particle = TParticle<1>; // sizeof 19*float = 76bytes 63 | using Particle160 = TParticle<22>; // sizeof (18 + 22)*float = 160 bytes 64 | --------------------------------------------------------------------------------