Unit tests verifying the behaviour of the check-news script are added.
This required adding a new make target, "autotools-check" directly called from
"commit-check", because the usual tests are executed in the build directory,
whereas these, being relative to the autotools, cannot be executed there because
the files of the autotools/ directory are not copied do not belong in the build
directory.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
test/data/htools \
test/data/htools/rapi \
test/hs/shelltests \
+ test/autotools \
lib \
lib/build \
lib/client \
$(mangen)
TEST_FILES = \
+ test/autotools/autotools-check-news.test \
test/data/htools/clean-nonzero-score.data \
test/data/htools/common-suffix.data \
test/data/htools/empty-cluster.data \
test/data/kvm_0.9.1_help_boot_test.txt \
test/data/kvm_1.0_help.txt \
test/data/kvm_1.1.2_help.txt \
+ test/data/NEWS_OK.txt \
+ test/data/NEWS_previous_unreleased.txt \
test/data/ovfdata/compr_disk.vmdk.gz \
test/data/ovfdata/config.ini \
test/data/ovfdata/corrupted_resources.ovf \
test/py/gnt-cli.test \
test/py/import-export_unittest-helper
+
python_tests = \
doc/examples/rapi_testutils.py \
test/py/cfgupgrade_unittest.py \
--srcdir=.. $(HPCEXCL) ; \
hpc report --srcdir=.. live-test $(HPCEXCL)
-commit-check: distcheck lint apidoc
+commit-check: autotools-check distcheck lint apidoc
+
+autotools-check:
+ TESTDATA_DIR=./test/data shelltest $(SHELLTESTARGS) \
+ $(abs_top_srcdir)/test/autotools/*-*.test \
+ -- --hide-successes
.PHONY: gitignore-check
gitignore-check:
--- /dev/null
+# Test a correct NEWS file against a stable release
+RELEASE=2.6.2 ./autotools/check-news < $TESTDATA_DIR/NEWS_OK.txt
+>>>= 0
+
+# Test a correct NEWS file against an alpha release
+RELEASE=2.8.0~alpha ./autotools/check-news < $TESTDATA_DIR/NEWS_OK.txt
+>>>= 0
+
+# Test a NEWS file with previous unreleased versions against a stable release
+RELEASE=2.6.2 ./autotools/check-news < $TESTDATA_DIR/NEWS_previous_unreleased.txt
+>>>2/Unreleased version after current release 2.6.2/
+>>>= !0
+
+# Test a NEWS file with previous unreleased versions against an alpha release
+RELEASE=2.8.0~alpha ./autotools/check-news < $TESTDATA_DIR/NEWS_previous_unreleased.txt
+>>>= 0
--- /dev/null
+News
+====
+
+
+Version 2.8.0 beta1
+-------------------
+
+*(unreleased)*
+
+Incompatible/important changes
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+- Stuff
+
+New features
+~~~~~~~~~~~~
+
+- More stuff
+
+
+Version 2.7.0 rc2
+-----------------
+
+*(Released Fri, 24 May 2013)*
+
+Incompatible/important changes
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+- Other stuff
+
+Since rc1:
+
+- Many bugfixes
+
+
+Version 2.7.0 rc1
+-----------------
+
+*(Released Fri, 3 May 2013)*
+
+- Things
+
+
+Version 2.7.0 beta1
+-------------------
+
+*(Released Wed, 6 Feb 2013)*
+
+This was the first beta release of the 2.7 series. All important changes
+are listed in the latest 2.7 entry.
+
+
+Version 2.6.2
+-------------
+
+*(Released Fri, 21 Dec 2012)*
+
+Hic sunt pink bunnies.
+
+
+Version 2.6.1
+-------------
+
+*(Released Fri, 12 Oct 2012)*
+
+Team members come, team members go.
+
+
+Version 2.6.0
+-------------
+
+*(Released Fri, 27 Jul 2012)*
+
+Many things happened before this point.
+
+.. vim: set textwidth=72 syntax=rst :
+.. Local Variables:
+.. mode: rst
+.. fill-column: 72
+.. End:
--- /dev/null
+News
+====
+
+
+Version 2.8.0 beta1
+-------------------
+
+*(unreleased)*
+
+Incompatible/important changes
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+- Stuff
+
+New features
+~~~~~~~~~~~~
+
+- More stuff
+
+
+Version 2.7.0 rc2
+-----------------
+
+*(Released Fri, 24 May 2013)*
+
+Incompatible/important changes
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+- Other stuff
+
+Since rc1:
+
+- Many bugfixes
+
+
+Version 2.7.0 rc1
+-----------------
+
+*(Released Fri, 3 May 2013)*
+
+- Things
+
+
+Version 2.7.0 beta1
+-------------------
+
+*(Released Wed, 6 Feb 2013)*
+
+This was the first beta release of the 2.7 series. All important changes
+are listed in the latest 2.7 entry.
+
+
+Version 2.6.2
+-------------
+
+*(Released Fri, 21 Dec 2012)*
+
+Hic sunt pink bunnies.
+
+
+Version 2.6.1
+-------------
+
+*(unreleased)*
+
+Team members come, team members go.
+
+
+Version 2.6.0
+-------------
+
+*(Released Fri, 27 Jul 2012)*
+
+Many things happened before this point.
+
+.. vim: set textwidth=72 syntax=rst :
+.. Local Variables:
+.. mode: rst
+.. fill-column: 72
+.. End: