Last active
April 4, 2022 23:15
-
-
Save Krellan/a835a635597eeed3ca4190e52b8d26b4 to your computer and use it in GitHub Desktop.
run-test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# bmcweb run-test convenience script, similar to run-ci | |
# https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/52444 | |
set -e | |
set -x | |
# Clean up after previous run | |
rm -rf builddir | |
# Combination of useful options | |
meson builddir -Dbuildtype=minsize -Db_lto=true -Db_coverage=true -Dtests=enabled -Dbmcweb-logging=enabled | |
# Compile | |
ninja -C builddir | |
# Help out CLion and other IDE editors without native meson/ninja support | |
mapfile -t RULES < <( grep '^rule ' < builddir/build.ninja | cut '-d ' -f2 ) | |
ninja -C builddir -t compdb "${RULES[@]}" > builddir/compile_commands.json | |
# Code coverage | |
ninja -C builddir test | |
ninja -C builddir coverage | |
# Unit test | |
./builddir/bmcweb_unit_test | |
rm -f ./builddir/bmcweb_persistent_data.json | |
rm -f ./bmcweb_persistent_data.json | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment