Add test for directories containing testcase or testsetup.
authorMichael Andres <ma@suse.de>
Thu, 18 Jun 2009 12:08:01 +0000 (14:08 +0200)
committerMichael Andres <ma@suse.de>
Thu, 18 Jun 2009 12:08:01 +0000 (14:08 +0200)
tests/lib/TestSetup.h

index 2839db4..b371712 100644 (file)
@@ -93,6 +93,19 @@ class TestSetup
     { USR << (_tmprootdir.path() == _rootdir ? "DELETE" : "KEEP") << " TESTSETUP below " << _rootdir << endl; }
 
   public:
+    /** Whether directory \a path_r contains a solver testcase. */
+    static bool isTestcase( const Pathname & path_r )
+    {
+      return filesystem::PathInfo( path_r / "solver-test.xml" ).isFile();
+    }
+
+    /** Whether directory \a path_r contains a testsetup. */
+    static bool isTestSetup( const Pathname & path_r )
+    {
+      return filesystem::PathInfo( path_r / "repos.d" ).isDir() && filesystem::PathInfo( path_r / "raw" ).isDir();
+    }
+
+  public:
     const Pathname & root() const { return _rootdir; }
 
     Target &     target()      { if ( ! getZYpp()->getTarget() ) getZYpp()->initializeTarget( _rootdir ); return *getZYpp()->getTarget(); }