summaryrefslogtreecommitdiff
path: root/sw/qa/extras/inc
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-12-21 22:07:47 +0100
committerMiklos Vajna <vmiklos@suse.cz>2012-12-21 22:12:06 +0100
commit60c01fe42f90876f9a636780aa3b23ccf6a1398b (patch)
tree48b6d698016dd52fb34a7784c110cb94d178398c /sw/qa/extras/inc
parentaa36bcc1ae4871ef41afe8e581342c2a8d35816d (diff)
sw: add csv output for extra filter tests
Like the minimal filter tests, these tests are invoked from a single cppunit method since commit 0a30cb22a141c26b4eab43a478d32df0769596ec, so some info about exactly what file failed is necessary. If we are at it, also print the (re)loading time as well.
Diffstat (limited to 'sw/qa/extras/inc')
-rw-r--r--sw/qa/extras/inc/swmodeltestbase.hxx35
1 files changed, 35 insertions, 0 deletions
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index 378dc15dd787..7b4ad3d83731 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -35,6 +35,7 @@
#include <unotest/macros_test.hxx>
#include <rtl/ustrbuf.hxx>
#include <comphelper/processfactory.hxx>
+#include <unotools/tempfile.hxx>
#include <unotxdoc.hxx>
#include <docsh.hxx>
@@ -227,6 +228,39 @@ protected:
return getProperty<OUString>(getProperty< uno::Reference<beans::XPropertySet> >(xFormula, "Model"), "Formula");
}
+ void header()
+ {
+ fprintf(stderr, "File tested,Execution Time (ms)\n");
+ }
+
+ void load(const char* pDir, const char* pName)
+ {
+ // Output name early, so in the case of a hang, the name of the hanging input file is visible.
+ fprintf(stderr, "%s,", pName);
+ m_nStartTime = osl_getGlobalTimer();
+ mxComponent = loadFromDesktop(getURLFromSrc(pDir) + OUString::createFromAscii(pName));
+ }
+
+ void reload(OUString aFilter)
+ {
+ uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aArgs(1);
+ aArgs[0].Name = "FilterName";
+ aArgs[0].Value <<= aFilter;
+ utl::TempFile aTempFile;
+ aTempFile.EnableKillingFile();
+ xStorable->storeToURL(aTempFile.GetURL(), aArgs);
+ uno::Reference<lang::XComponent> xComponent(xStorable, uno::UNO_QUERY);
+ xComponent->dispose();
+ mxComponent = loadFromDesktop(aTempFile.GetURL());
+ }
+
+ void finish()
+ {
+ sal_uInt32 nEndTime = osl_getGlobalTimer();
+ fprintf(stderr, "%" SAL_PRIuUINT32"\n", nEndTime - m_nStartTime);
+ }
+
uno::Reference<lang::XComponent> mxComponent;
xmlBufferPtr mpXmlBuffer;
@@ -236,6 +270,7 @@ protected:
const char* pName;
void (T::*pMethod)();
};
+ sal_uInt32 m_nStartTime;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */