From 00946ca3aa45f109c455871ce89c5872fd243624 Mon Sep 17 00:00:00 2001 From: Roderick Sheeter Date: Wed, 8 May 2019 09:42:35 -0700 Subject: [PATCH] [docs] add sample commands for test exec --- README.md | 4 ++++ TESTING.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 TESTING.md diff --git a/README.md b/README.md index fd93be84f..b2eab567b 100644 --- a/README.md +++ b/README.md @@ -15,4 +15,8 @@ For bug reports, mailing list, and other information please visit: For license information, see the file COPYING. +For build information, see the file BUILD.md. + +For test execution, see the file TESTING.md. + Documentation: https://harfbuzz.github.io diff --git a/TESTING.md b/TESTING.md new file mode 100644 index 000000000..91b6abd8b --- /dev/null +++ b/TESTING.md @@ -0,0 +1,47 @@ +## Build & Run + +Depending on what area you are working in change or add `HB_DEBUG_`. +Values defined in `hb-debug.hh`. + +```shell +# quick sanity check +time (make CPPFLAGS='-DHB_DEBUG_SUBSET=100' \ + && make -C test/api check || cat test/api/test-suite.log) + +# slower santiy check +time (make CPPFLAGS='-DHB_DEBUG_SUBSET=100' \ + && make -C src check \ + && make -C test/api check \ + && make -C test/subset check) + +# confirm you didn't break anything else +time (make CPPFLAGS='-DHB_DEBUG_SUBSET=100' \ + && make check) + +# often catches files you didn't add, e.g. test fonts to EXTRA_DIST +make distcheck +``` + +### Debug with GDB + +``` +cd ./util +../libtool --mode=execute gdb --args ./hb-subset ... +``` + +### Enable Debug Logging + +```shell +# make clean if you previously build w/o debug logging +make CPPFLAGS=-DHB_DEBUG_SUBSET=100 +``` + +## Build and Test via CMake + +Note: You'll need to first install ninja-build via apt-get. + +```shell +cd harfbuzz +mkdir buid +cmake -DHB_CHECK=ON -Bbuild -H. -GNinja && ninja -Cbuild && CTEST_OUTPUT_ON_FAILURE=1 ninja -Cbuild test +```