From ee8cc5a5bd8266008711f36e8d9737d992501654 Mon Sep 17 00:00:00 2001 From: binbincome <811404668@qq.com> Date: Mon, 11 Sep 2023 20:05:12 +0800 Subject: [PATCH] Added dockers installation method Fix the issue of missing FindODBC.cmake when generating makefile files --- README.md | 42 ++++++++++++++++++++++++++++++++++++++- src/dbtest/CMakeLists.txt | 3 ++- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4b5f3a0d..1be47d76 100644 --- a/README.md +++ b/README.md @@ -18,18 +18,58 @@ Check out some test cases (e.g., [Dirty Write](test_result/test_cases/wat_sda_di You can explore all results on [report webpage](https://axingguchen.github.io/3TS/). ## Usage -To generate Makefile (all commands are executed under '3TS/src/dbtest'): +Provide two installation methods for the project environment: **Docker** and **Compilation**, and you can freely choose the installation method. + +### Docker installation + +If you have not installed Docker, you can use the following command to install it with one click. + +```shell +curl -s https://get.docker.com/ | sh +``` + +Obtain Mirror + +```shell +docker pull registry.cn-hangzhou.aliyuncs.com/open_projects/3ts_coo:1.0 +``` + +Obtain Mirror to view the image ID and generate a container based on the image ID + +```shell +docker images +docker run -it [image_id] /bin/bash +``` + +View all containers and enter the generated container + +```shell +docker ps -a +docker exec -it [container_id] /bin/bash +``` + +### Compile Installation + + To generate Makefile (all commands are executed under '3TS/src/dbtest'): + ``` cmake -S ./ ``` To complie the code: + ``` make ``` ## Example +If using Docker installation, the container defaults to installing and configuring the database PostgreSQL,Start it using the following command (if you choose to compile the installation method, you need to install the database and configure it): + +```shell +/etc/init.d/postgresql start +``` + For test cases, it specify in "do_test_list.txt". Use "#" to exclude (comment) the test case. We provide three levels of test cases, i.e., the basic cases (33 anomalies in the paper), the predicate cases, and the MDA cases (with multiple transactions and objects). For specific test cases to evaluate, we specify it in do_test_list.txt. diff --git a/src/dbtest/CMakeLists.txt b/src/dbtest/CMakeLists.txt index 6a50c26f..81c8ee02 100644 --- a/src/dbtest/CMakeLists.txt +++ b/src/dbtest/CMakeLists.txt @@ -4,6 +4,7 @@ PROJECT(dbtest) set(CMAKE_BUILD_TYPE "Debug") set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb") set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall") +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) message("cmake moudle ${CMAKE_MODULE_PATH}") set(CMAKE_CXX_FLAGS "-std=c++17 ${CMAKE_CXX_FLAGS} -g -ftest-coverage -fprofile-arcs -Wno-deprecated -fopenmp -pthread -lpthread") @@ -49,7 +50,7 @@ list(APPEND SOURCE_FILES_SQL_v2 add_executable(3ts_dbtest_v2 ${SOURCE_FILES_SQL_v2}) # ld:odbc list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/Modules/") -find_package(odbc REQUIRED) +find_package(ODBC REQUIRED) list(APPEND ODBC_LD odbc) # link ld target_link_libraries(3ts_dbtest_v2 ${THIRD_PARTIES})