add test infrastructure, closing #11
parent
274f18e693
commit
e09fb6a61f
2
Makefile
2
Makefile
|
@ -9,3 +9,5 @@ mrproper:
|
|||
bash ./scripts/clean_dependencies.sh
|
||||
setup:
|
||||
bash ./scripts/setup_project.sh
|
||||
test:
|
||||
bash ./scripts/test.sh
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
if [ -z "$CXX" ]; then
|
||||
CXX="c++"
|
||||
fi
|
||||
if [ -z "$CXXFLAGS" ]; then
|
||||
CXXFLAGS="-std=c++20 -Wall"
|
||||
fi
|
||||
CXX_WITH_FLAGS="$CXX $CXXFLAGS"
|
||||
|
||||
echo -n "Using LD_LIBRARY_PATH "
|
||||
if [ -z "$LD_LIBRARY_PATH" ]; then
|
||||
export LD_LIBRARY_PATH=./bin/lib
|
||||
else
|
||||
export LD_LIBRARY_PATH=./bin/lib:"$LD_LIBRARY_PATH"
|
||||
fi
|
||||
echo "$LD_LIBRARY_PATH"
|
||||
|
||||
mkdir -pv bin/test
|
||||
|
||||
echo "Building and running tests one by one..."
|
||||
|
||||
set -v
|
||||
|
||||
"CXX_WITH_FLAGS" -Lbin/lib -l:nbt.so -o bin/test/nbt_helpers src/test/nbt_helpers.cpp
|
|
@ -20,6 +20,7 @@ PROJECT_BASE_DIR="$( cd -- "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 ; pw
|
|||
alias clean="pushd \"$PROJECT_BASE_DIR\" >/dev/null 2>&1; scripts/clean.sh; popd >/dev/null 2>&1"
|
||||
alias clean_dependencies="pushd \"$PROJECT_BASE_DIR\" >/dev/null 2>&1; scripts/clean_dependencies.sh; popd >/dev/null 2>&1"
|
||||
alias setup_project="pushd \"$PROJECT_BASE_DIR\" >/dev/null 2>&1; scripts/setup_project.sh; popd >/dev/null 2>&1"
|
||||
alias run_tests="pushd \"$PROJECT_BASE_DIR\" >/dev/null 2>&1; scripts/test.sh; popd >/dev/null 2>&1"
|
||||
|
||||
function build {
|
||||
pushd "$PROJECT_BASE_DIR" >/dev/null 2>&1
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
int main(){
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue