hgcacheproxymodel/tsrc/unit/test_hgcacheproxydatamodel.cpp
changeset 13 8bf920201dea
parent 8 15f034b8a3b5
child 20 a60f8b6b1d32
--- a/hgcacheproxymodel/tsrc/unit/test_hgcacheproxydatamodel.cpp	Tue Jul 06 15:29:26 2010 +0300
+++ b/hgcacheproxymodel/tsrc/unit/test_hgcacheproxydatamodel.cpp	Wed Aug 18 10:52:49 2010 +0300
@@ -13,7 +13,7 @@
 *
 * Description:
 *
-*  Version     : %version: 10 %
+*  Version     : %version: 11 %
 */
 #include <QtTest/QtTest>
 #include <hgwidgets/hgcacheproxymodel.h>
@@ -1425,5 +1425,23 @@
         return QTest::qExec(&tc, c, v);
     }
 #else
-    QTEST_MAIN(TestCacheProxy)
+    int main (int argc, char* argv[]) 
+    {
+        for ( int i=0;i<argc; i++){
+            if (strcmp(argv[i], "-o")==0 && i+1 <argc ){
+                //let's make sure that folder specified after -o exists
+                QDir file( QString::fromLatin1( argv[i+1] ));
+                QString s = file.absolutePath ();
+                s = s.left( s.lastIndexOf(file.dirName()) );
+                if ( !file.exists(s) ){
+                    file.mkpath(s);
+                }
+            }
+        }
+        
+        QApplication app(argc, argv);
+        QTEST_DISABLE_KEYPAD_NAVIGATION
+        TestCacheProxy tc;
+        return QTest::qExec(&tc, argc, argv);
+    }
 #endif