[Telepathy-commits] [telepathy-qt4/master] Put saved contact lists in a subdirectory, and reset after each run

Simon McVittie simon.mcvittie at collabora.co.uk
Fri Nov 28 07:03:16 PST 2008


---
 tests/pinocchio/Makefile.am |    4 ++--
 tests/pinocchio/lib.cpp     |   10 ++++++++++
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/tests/pinocchio/Makefile.am b/tests/pinocchio/Makefile.am
index 93cd128..61279a6 100644
--- a/tests/pinocchio/Makefile.am
+++ b/tests/pinocchio/Makefile.am
@@ -55,7 +55,7 @@ TESTS_ENV = \
     PINOCCHIO=@PINOCCHIO@ \
     PINOCCHIO_CTL=@PINOCCHIO_CTL@ \
     PINOCCHIO_DATA_DIR=@abs_srcdir@ \
-    PINOCCHIO_SAVE_DIR=@abs_builddir@
+    PINOCCHIO_SAVE_DIR=@abs_builddir@/_tmp
 
 TESTS_ENVIRONMENT = \
     $(TESTS_ENV) \
@@ -65,6 +65,6 @@ CLEANFILES = \
     $(BUILT_SOURCES)
 
 distclean-local:
-	rm -rf _gen
+	rm -rf _gen _tmp
 
 endif
diff --git a/tests/pinocchio/lib.cpp b/tests/pinocchio/lib.cpp
index d2873f6..7f69dfd 100644
--- a/tests/pinocchio/lib.cpp
+++ b/tests/pinocchio/lib.cpp
@@ -23,10 +23,20 @@ void PinocchioTest::initTestCaseImpl()
 
     mPinocchioPath = QString::fromLocal8Bit(::getenv("PINOCCHIO"));
     mPinocchioCtlPath = QString::fromLocal8Bit(::getenv("PINOCCHIO_CTL"));
+    QString pinocchioSavePath = QString::fromLocal8Bit(
+        ::getenv("PINOCCHIO_SAVE_DIR"));
 
     QVERIFY2(!mPinocchioPath.isEmpty(), "Put $PINOCCHIO in your environment");
     QVERIFY2(!mPinocchioCtlPath.isEmpty(),
         "Put $PINOCCHIO_CTL in your environment");
+    QVERIFY2(!pinocchioSavePath.isEmpty(),
+        "Put $PINOCCHIO_SAVE_DIR in your environment");
+
+    QDir dir;
+    dir.mkpath(pinocchioSavePath);
+    dir.cd(pinocchioSavePath);
+    dir.remove(QLatin1String("empty/contacts.xml"));
+
     QVERIFY(QDBusConnection::sessionBus().isConnected());
 
     mPinocchio.setProcessChannelMode(QProcess::ForwardedChannels);
-- 
1.5.6.5




More information about the Telepathy-commits mailing list