[Libreoffice-commits] core.git: sd/qa
Jan Holesovsky
kendy at suse.cz
Fri Jun 21 04:14:34 PDT 2013
sd/qa/unit/import-tests.cxx | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
New commits:
commit e2ba9b895b262dd16d452e8b461790beebb2dab3
Author: Jan Holesovsky <kendy at suse.cz>
Date: Fri Jun 21 13:13:26 2013 +0200
Better description of the sd unit tests creation.
Change-Id: I7d3ac7997f54f4cb3fc826601d89248ea42549f4
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index bebda14..c9dfd60 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -48,10 +48,28 @@ public:
/** Test document against a reference XML dump of shapes.
-If you want to update one of these tests, set the nUpdateMe to the index of
-the test, the dump XML's will be created (or rewritten) instead of checking.
-Use with care - when the test is failing, first find out why, instead of just
-updating .xml's blindly.
+If you want to update one of these tests, or add a new one, set the nUpdateMe
+to the index of the test, and the dump XML's will be created (or rewritten)
+instead of checking. Use with care - when the test is failing, first find out
+why, instead of just updating .xml's blindly.
+
+Example: Let's say you are adding a test called fdoABCD.pptx. You'll place it
+to the data/ subdirectory, and will add an entry to aFilesToCompare below,
+like:
+
+ { "fdoABCD.pptx", "xml/fdoABCD_" },
+
+and will count the index in the aFilesToCompare structure (1st is 0, 2nd is 1,
+etc.) Temporarily you'll set nUpdateMe to this index (instead of -1), and run
+
+make sd
+
+This will generate the sd/qa/unit/data/xml/fdoABCD_*.xml for you. Now you
+will change nUpdateMe back to -1, and commit your fdoABCD.pptx test, the
+xml/fdoABCD_*.xml dumps, and the aFilesToCompare addition in one commit.
+
+As the last step, you will revert your fix and do 'make sd' again, to check
+that without your fix, the unit test breaks. Then clean up, and push :-)
NOTE: This approach is suitable only for tests of fixes that actually change
the layout - best to check by reverting your fix locally after having added
More information about the Libreoffice-commits
mailing list