diff options
| author | Eugene Triguba <hello@eugenetriguba.com> | 2025-10-11 14:31:11 -0400 |
|---|---|---|
| committer | Eugene Triguba <hello@eugenetriguba.com> | 2025-10-11 14:31:37 -0400 |
| commit | bb9133a79389f8ff7c79cad18884b5f5c7eade5c (patch) | |
| tree | e905a9a12c63875e37a87e9cc9da2a1e27000af8 /scripts | |
| parent | Add unicode support to justify (diff) | |
| download | cli-bb9133a79389f8ff7c79cad18884b5f5c7eade5c.zip | |
Migrate to sourcehut build system and remove gha workflows
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/build.sh | 12 | ||||
| -rwxr-xr-x | scripts/test.sh | 18 |
2 files changed, 30 insertions, 0 deletions
diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 0000000..9458002 --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -euo pipefail + +BUILD_DIR="build" +SRC_DIR="." + +main() { + cmake -B "$BUILD_DIR" -S "$SRC_DIR" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON + cmake --build "$BUILD_DIR" +} + +main "$@" diff --git a/scripts/test.sh b/scripts/test.sh new file mode 100755 index 0000000..ea35ef7 --- /dev/null +++ b/scripts/test.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +set -euo pipefail + +main() { + echo "Running tests..." + local ctest_result=0 + local bats_result=0 + + if ! (cd build && ctest --output-on-failure); then + ctest_result=1 + fi + if ! ./tests/vendor/bats-core/bin/bats ./tests/justify.bats; then + bats_result=1 + fi + exit $((ctest_result || bats_result)) +} + +main "$@" |