Skip to content

Commit

Permalink
werror option on all cpp build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Aug 10, 2023
1 parent bc68943 commit c251103
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/reusable_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -340,12 +340,12 @@ jobs:

- name: Build and run C++ minimal example
shell: bash
run: ./examples/cpp/minimal/build_and_run.sh
run: ./examples/cpp/minimal/build_and_run.sh --werror

- name: Build and run rerun_cpp tests
shell: bash
run: ./rerun_cpp/build_and_run_tests.sh
run: ./rerun_cpp/build_and_run_tests.sh --werror

- name: Build code examples
shell: bash
run: ./tests/cpp/build_all_doc_examples.sh
run: ./tests/cpp/build_all_doc_examples.sh --werror
22 changes: 21 additions & 1 deletion examples/cpp/minimal/build_and_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,31 @@ script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "$script_path/../../.."
set -x

WERROR=false

while test $# -gt 0; do
case "$1" in
--werror)
shift
WERROR=true
;;

*)
break
;;
esac
done


num_threads=$(getconf _NPROCESSORS_ONLN)

mkdir -p build
pushd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
if [ ${WERROR} = true ]; then
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_BUILD_WARNINGS_AS_ERRORS=On ..
else
cmake -DCMAKE_BUILD_TYPE=Debug ..
fi
cmake --build . --config Debug --target rerun_example -j ${num_threads}
popd

Expand Down
22 changes: 21 additions & 1 deletion rerun_cpp/build_and_run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,31 @@ script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "$script_path/.."
set -x

WERROR=false

while test $# -gt 0; do
case "$1" in
--werror)
shift
WERROR=true
;;

*)
break
;;
esac
done


num_threads=$(getconf _NPROCESSORS_ONLN)

mkdir -p build
pushd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
if [ ${WERROR} = true ]; then
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_BUILD_WARNINGS_AS_ERRORS=On ..
else
cmake -DCMAKE_BUILD_TYPE=Debug ..
fi
cmake --build . --config Debug --target rerun_sdk_tests -j ${num_threads}
popd

Expand Down
23 changes: 22 additions & 1 deletion tests/cpp/build_all_doc_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,31 @@ script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "$script_path/../.."
set -x


WERROR=false

while test $# -gt 0; do
case "$1" in
--werror)
shift
WERROR=true
;;

*)
break
;;
esac
done


num_threads=$(getconf _NPROCESSORS_ONLN)

mkdir -p build
pushd build
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_BUILD_WARNINGS_AS_ERRORS=On ..
if [ ${WERROR} = true ]; then
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_BUILD_WARNINGS_AS_ERRORS=On ..
else
cmake -DCMAKE_BUILD_TYPE=Debug ..
fi
cmake --build . --config Debug --target doc_examples -j ${num_threads}
popd
6 changes: 3 additions & 3 deletions tests/cpp/run_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "$script_path/../.."

echo "------------ Building all C++ Examples ------------"
/bin/bash ./tests/cpp/build_all_doc_examples.sh
/bin/bash ./tests/cpp/build_all_doc_examples.sh $@

echo "------------ Building & running SDK tests ------------"
/bin/bash ./rerun_cpp/build_and_run_tests.sh
/bin/bash ./rerun_cpp/build_and_run_tests.sh $@

echo "------------ Building & running minimal example ------------"
/bin/bash ./examples/cpp/minimal/build_and_run.sh
/bin/bash ./examples/cpp/minimal/build_and_run.sh $@

echo "------------ Running roundtrip tests ------------"
python ./scripts/ci/run_e2e_roundtrip_tests.py

0 comments on commit c251103

Please sign in to comment.