From e0f2e24140aa67d09742e4d9b164a226b1520a0b Mon Sep 17 00:00:00 2001 From: colinlyguo Date: Thu, 2 May 2024 21:11:09 +0800 Subject: [PATCH] fix unit test --- Makefile | 2 +- run_test.sh | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100755 run_test.sh diff --git a/Makefile b/Makefile index 2962a12..fc798d5 100644 --- a/Makefile +++ b/Makefile @@ -15,4 +15,4 @@ run: build docker run -it --rm -v "$(PWD):/workspace" -w /workspace my-dev-container test: - go test -v -race -gcflags="-l" -ldflags="-s=false" -coverprofile=coverage.txt -covermode=atomic ./... + ./run_test.sh diff --git a/run_test.sh b/run_test.sh new file mode 100755 index 0000000..79b7633 --- /dev/null +++ b/run_test.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Save the root directory of the project +ROOT_DIR=$(pwd) + +# Set the environment variable +export LD_LIBRARY_PATH=$ROOT_DIR/rs:$LD_LIBRARY_PATH + +# Compile libzstd +cd $ROOT_DIR/rs +make libzstd + +# Run unit tests +cd $ROOT_DIR +go test -v -race -gcflags="-l" -ldflags="-s=false" -coverprofile=coverage.txt -covermode=atomic ./...