From: Andrew Price Date: Fri, 11 Sep 2020 15:42:40 +0100 Subject: [Cluster-devel] [PATCH 0/3] gfs2-utils: Unit test framework improvements Message-ID: <20200911144243.667554-1-anprice@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To date we haven't accumulated many unit tests. That's partly because the older code was never written with testability in mind and partly because the unit test infrastructure is poorly organised in the project. This patch set aims to lower the effort needed to write new unit tests by stubbing out all of the infrastructure required and by moving the unit tests into the directories of the code they're testing. Doing that also means that the main testsuite script is no longer dependent on the unit tests and can more easily be used outside of the source directory, e.g. for CI. Andrew Price (3): Reorganise unit tests Stub out unit tests for the main gfs2-utils Describe the unit tests in README.tests .gitignore | 14 ++++-- doc/README.tests | 31 ++++++++++++- gfs2/convert/Makefile.am | 4 ++ gfs2/convert/check_convert.c | 27 +++++++++++ gfs2/convert/checks.am | 7 +++ gfs2/convert/gfs2_convert.c | 2 + gfs2/edit/Makefile.am | 3 ++ gfs2/edit/check_edit.c | 27 +++++++++++ gfs2/edit/checks.am | 7 +++ gfs2/edit/hexedit.c | 2 + gfs2/fsck/Makefile.am | 4 ++ gfs2/fsck/check_fsck.c | 27 +++++++++++ gfs2/fsck/checks.am | 7 +++ gfs2/fsck/main.c | 2 + gfs2/libgfs2/Makefile.am | 21 +++++---- gfs2/libgfs2/check_libgfs2.c | 21 +++++++++ gfs2/libgfs2/check_meta.c | 21 +++++++++ {tests => gfs2/libgfs2}/check_rgrp.c | 67 ++++++++++++---------------- gfs2/libgfs2/checks.am | 32 +++++++++++++ gfs2/mkfs/Makefile.am | 3 ++ gfs2/mkfs/check_grow.c | 27 +++++++++++ gfs2/mkfs/check_jadd.c | 27 +++++++++++ gfs2/mkfs/check_mkfs.c | 27 +++++++++++ gfs2/mkfs/checks.am | 17 +++++++ gfs2/mkfs/main_grow.c | 2 + gfs2/mkfs/main_jadd.c | 2 + gfs2/mkfs/main_mkfs.c | 2 + gfs2/tune/Makefile.am | 4 ++ gfs2/tune/check_tune.c | 27 +++++++++++ gfs2/tune/checks.am | 7 +++ gfs2/tune/main.c | 2 + tests/Makefile.am | 53 ++-------------------- tests/check_meta.c | 33 -------------- tests/libgfs2.at | 9 ---- tests/testsuite.at | 1 - 35 files changed, 421 insertions(+), 148 deletions(-) create mode 100644 gfs2/convert/check_convert.c create mode 100644 gfs2/convert/checks.am create mode 100644 gfs2/edit/check_edit.c create mode 100644 gfs2/edit/checks.am create mode 100644 gfs2/fsck/check_fsck.c create mode 100644 gfs2/fsck/checks.am create mode 100644 gfs2/libgfs2/check_libgfs2.c create mode 100644 gfs2/libgfs2/check_meta.c rename {tests => gfs2/libgfs2}/check_rgrp.c (62%) create mode 100644 gfs2/libgfs2/checks.am create mode 100644 gfs2/mkfs/check_grow.c create mode 100644 gfs2/mkfs/check_jadd.c create mode 100644 gfs2/mkfs/check_mkfs.c create mode 100644 gfs2/mkfs/checks.am create mode 100644 gfs2/tune/check_tune.c create mode 100644 gfs2/tune/checks.am delete mode 100644 tests/check_meta.c delete mode 100644 tests/libgfs2.at -- 2.26.2