Uses clean main file for misc benchmarks
authorPeizhao Ou <peizhaoo@uci.edu>
Fri, 26 Jan 2018 19:23:42 +0000 (11:23 -0800)
committerPeizhao Ou <peizhaoo@uci.edu>
Fri, 26 Jan 2018 19:23:42 +0000 (11:23 -0800)
test/stress/sequential/sequential-misc/CMakeLists.txt
test/stress/sequential/sequential-misc/main.cpp [new file with mode: 0644]

index c5d1c33..ae61a31 100644 (file)
@@ -1,7 +1,7 @@
 set(PACKAGE_NAME stress-sequential-misc)
 
 set(CDSSTRESS_STACK_SOURCES
-    ../../main.cpp
+    main.cpp
     rigtorp_mpmc_driver.cpp
     deque_driver.cpp
     spinlock_driver.cpp
diff --git a/test/stress/sequential/sequential-misc/main.cpp b/test/stress/sequential/sequential-misc/main.cpp
new file mode 100644 (file)
index 0000000..0a5f913
--- /dev/null
@@ -0,0 +1,62 @@
+/*\r
+    This file is a part of libcds - Concurrent Data Structures library\r
+\r
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017\r
+\r
+    Source code repo: http://github.com/khizmax/libcds/\r
+    Download: http://sourceforge.net/projects/libcds/files/\r
+\r
+    Redistribution and use in source and binary forms, with or without\r
+    modification, are permitted provided that the following conditions are met:\r
+\r
+    * Redistributions of source code must retain the above copyright notice, this\r
+      list of conditions and the following disclaimer.\r
+\r
+    * Redistributions in binary form must reproduce the above copyright notice,\r
+      this list of conditions and the following disclaimer in the documentation\r
+      and/or other materials provided with the distribution.\r
+\r
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
+    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r
+    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\r
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\r
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\r
+    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\r
+    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+*/\r
+\r
+#include <cds_test/stress_test.h>\r
+\r
+#include <cds/init.h>\r
+#include <cds/gc/hp.h>\r
+#include <cds/gc/dhp.h>\r
+#ifdef CDSUNIT_USE_URCU\r
+#   include <cds/urcu/general_instant.h>\r
+#   include <cds/urcu/general_buffered.h>\r
+#   include <cds/urcu/general_threaded.h>\r
+#   include <cds/urcu/signal_buffered.h>\r
+#endif\r
+\r
+#ifdef CDS_ENABLE_HPSTAT\r
+#   include <cds_test/stat_hp_out.h>\r
+#   include <cds_test/stat_dhp_out.h>\r
+#   include <iostream>\r
+#endif\r
+\r
+int main(int argc, char **argv) {\r
+  int result;\r
+  // Read test config file\r
+  cds_test::init_config(argc, argv);\r
+\r
+  std::cout << "Hardware concurrency: " << std::thread::hardware_concurrency()\r
+            << "\n";\r
+\r
+  // Init Google test\r
+  ::testing::InitGoogleTest(&argc, argv);\r
+\r
+  result = RUN_ALL_TESTS();\r
+  return result;\r
+}\r