From 3a73939df7e83e82097d9e024c58bff6c03c324c Mon Sep 17 00:00:00 2001 From: Peizhao Ou Date: Mon, 29 Jan 2018 13:51:51 -0800 Subject: [PATCH 1/1] Adds a fake test case --- test/stress/sequential/CMakeLists.txt | 3 ++ test/stress/sequential/test.cpp | 52 +++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 test/stress/sequential/test.cpp diff --git a/test/stress/sequential/CMakeLists.txt b/test/stress/sequential/CMakeLists.txt index 39ca90f7..7ef8dadd 100644 --- a/test/stress/sequential/CMakeLists.txt +++ b/test/stress/sequential/CMakeLists.txt @@ -19,6 +19,9 @@ include_directories( add_executable(${PACKAGE_NAME} ${CDSSTRESS_STACK_SOURCES}) target_link_libraries(${PACKAGE_NAME} ${CDS_TEST_LIBRARIES} ${CDSSTRESS_FRAMEWORK_LIBRARY}) +add_executable(mytest test.cpp ../main.cpp) +target_link_libraries(mytest ${CDS_TEST_LIBRARIES} ${CDSSTRESS_FRAMEWORK_LIBRARY}) + add_test(NAME ${PACKAGE_NAME} COMMAND ${PACKAGE_NAME} WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) add_custom_target( stress-sequential-all diff --git a/test/stress/sequential/test.cpp b/test/stress/sequential/test.cpp new file mode 100644 index 00000000..f999c9ed --- /dev/null +++ b/test/stress/sequential/test.cpp @@ -0,0 +1,52 @@ +/* + This file is a part of libcds - Concurrent Data Structures library + + (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017 + + Source code repo: http://github.com/khizmax/libcds/ + Download: http://sourceforge.net/projects/libcds/files/ + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "../misc/common.h" +#include + +namespace { + +class sequential_test : public cds_test::stress_fixture { + +}; + +TEST_F(sequential_test, TEST) { + typedef cds::sync::spin SpinLock; + SpinLock l; + l.lock(); + std::cout << "TEST\n"; + l.unlock(); +} + +} // namespace -- 2.34.1