diff --git a/bin/build_coverage.sh b/bin/build_coverage.sh index 52055ad..85f5f43 100755 --- a/bin/build_coverage.sh +++ b/bin/build_coverage.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -euo pipefail + lcov --directory . --capture --output-file coverage.info # Remove external files and dependencies diff --git a/bin/build_deb_package.sh b/bin/build_deb_package.sh index d169680..a15ebed 100755 --- a/bin/build_deb_package.sh +++ b/bin/build_deb_package.sh @@ -1,7 +1,9 @@ #!/usr/bin/env bash +set -euo pipefail + rm -rf build_deb_package cmake -B build_deb_package -DCMAKE_BUILD_TYPE=Release -G Ninja -cmake --build build_deb_package || exit 1 -cd build_deb_package || exit 1 +cmake --build build_deb_package +cd build_deb_package cpack -G DEB diff --git a/bin/build_release.sh b/bin/build_release.sh index 9220aac..637e691 100755 --- a/bin/build_release.sh +++ b/bin/build_release.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash +set -euo pipefail + rm -rf build_release cmake -B build_release -DCMAKE_BUILD_TYPE=Release -G Ninja -cmake --build build_release || exit 1 +cmake --build build_release cp "$(cat build_release/filc.path)" . diff --git a/bin/build_rpm_package.sh b/bin/build_rpm_package.sh index 72345ea..0a0fdb3 100755 --- a/bin/build_rpm_package.sh +++ b/bin/build_rpm_package.sh @@ -1,9 +1,11 @@ #!/usr/bin/env bash +set -euo pipefail + rm -rf build_rpm_package cmake -B build_rpm_package -DCMAKE_BUILD_TYPE=Release -G Ninja -cmake --build build_rpm_package || exit 1 +cmake --build build_rpm_package echo "* $(date +"%a %b %d %Y") filc developers - $(cat VERSION) - Package from git sha $(git show-ref --head -s HEAD)" > build_rpm_package/changelog -cd build_rpm_package || exit 1 +cd build_rpm_package cpack -G RPM diff --git a/bin/check_no_changes.sh b/bin/check_no_changes.sh index 4cf92c5..1b11c48 100755 --- a/bin/check_no_changes.sh +++ b/bin/check_no_changes.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -euo pipefail + if [[ -z "$(git status --porcelain)" ]]; then exit 0 else diff --git a/bin/download_antlr.sh b/bin/download_antlr.sh index db5706a..318168d 100755 --- a/bin/download_antlr.sh +++ b/bin/download_antlr.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -euo pipefail + if (($# != 1)); then echo -e "\033[31mUsage : $0 \033[0m" exit 1 diff --git a/bin/generate_version.sh b/bin/generate_version.sh index 91b0507..90ba668 100755 --- a/bin/generate_version.sh +++ b/bin/generate_version.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -euo pipefail + # Get version in argument if (($# != 1)); then echo -e "\033[31mUsage : $0 \033[0m" diff --git a/bin/run_clang-format.sh b/bin/run_clang-format.sh index 719657f..474323b 100755 --- a/bin/run_clang-format.sh +++ b/bin/run_clang-format.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -euo pipefail + FORMAT="clang-format -style=file -i" $FORMAT main.cpp diff --git a/bin/run_e2e_tests.sh b/bin/run_e2e_tests.sh index b689a7e..52bd961 100755 --- a/bin/run_e2e_tests.sh +++ b/bin/run_e2e_tests.sh @@ -1,7 +1,9 @@ #!/usr/bin/env bash +set -euo pipefail + rm -rf build_e2e_tests cmake -B build_e2e_tests -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=On -G Ninja -cmake --build build_e2e_tests --target e2e-tests || exit 1 -cd build_e2e_tests || exit 1 +cmake --build build_e2e_tests --target e2e-tests +cd build_e2e_tests ctest -L e2e --output-on-failure diff --git a/bin/run_unit_tests.sh b/bin/run_unit_tests.sh index f234b7c..982b95f 100755 --- a/bin/run_unit_tests.sh +++ b/bin/run_unit_tests.sh @@ -1,7 +1,9 @@ #!/usr/bin/env bash +set -euo pipefail + rm -rf build_unit_tests cmake -B build_unit_tests -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=On -DCODE_COVERAGE=On -G Ninja -cmake --build build_unit_tests --target unit-tests || exit 1 -cd build_unit_tests || exit 1 +cmake --build build_unit_tests --target unit-tests +cd build_unit_tests ctest -L unit --output-on-failure