Tests as part of build process and unifying with vscode keybinding scheme

This commit is contained in:
Krzosa Karol
2026-03-21 13:01:58 +01:00
parent fadf4cd698
commit cab882de60
7 changed files with 272 additions and 25 deletions

View File

@@ -1,10 +1,11 @@
#!/usr/bin/bash
for arg in "$@"; do declare $arg='1'; done
if [ ! -v release ]; then debug=1; fi
if [ -v debug ]; then echo "[debug build]"; fi
if [ -v release ]; then echo "[release build]"; fi
if [ -v slow ]; then echo "[slow build]"; fi
if [ ! -v release ]; then debug=1; fi
if [ -v debug ]; then echo "[debug build]"; fi
if [ -v release ]; then echo "[release build]"; fi
if [ -v slow ]; then echo "[slow build]"; fi
if [ -v addr ]; then echo "[address sanitizer build]"; fi
mkdir -p build
@@ -28,8 +29,10 @@ flags="-Wall -Wextra -Werror -Wformat=2 -Wundef -Wshadow -Wno-missing-field-init
-g -fdiagnostics-absolute-paths \
-nostdlib++ -fno-exceptions"
if [ -v debug ]; then flags="$flags -fsanitize=address,undefined -fno-omit-frame-pointer -DDEBUG_BUILD=1"; fi
if [ -v release ]; then flags="$flags -DDEBUG_BUILD=0 -O2"; fi
if [ -v slow ]; then flags="$flags -DSLOW_BUILD=1"; fi
if [ -v debug ]; then flags="$flags -fsanitize=undefined -fno-omit-frame-pointer -DDEBUG_BUILD=1"; fi
if [ -v release ]; then flags="$flags -DDEBUG_BUILD=0 -O2"; fi
if [ -v slow ]; then flags="$flags -DSLOW_BUILD=1"; fi
if [ -v addr ]; then flags="$flags -fsanitize=address"; fi
time clang -o te $flags ../src/text_editor.cpp $I -lSDL3 -lm -lbacktrace
./te :RunTests