Mailinglist Archive: zypp-commit (149 mails)

< Previous Next >
[zypp-commit] r5432 - in /trunk/libzypp/tests/parser: CMakeLists.txt inifile/ inifile/CMakeLists.txt inifile/data/ inifile/data/1.ini inifile/iniparser_test.cc
  • From: dmacvicar@xxxxxxxxxxxxxxxx
  • Date: Mon, 23 Apr 2007 11:14:37 -0000
  • Message-id: <20070423111437.5FA1B473E9@xxxxxxxxxxxxxxxx>
Author: dmacvicar
Date: Mon Apr 23 13:14:36 2007
New Revision: 5432

URL: http://svn.opensuse.org/viewcvs/zypp?rev=5432&view=rev
Log:
skeleton test for inifile

Added:
    trunk/libzypp/tests/parser/inifile/
    trunk/libzypp/tests/parser/inifile/CMakeLists.txt
    trunk/libzypp/tests/parser/inifile/data/
    trunk/libzypp/tests/parser/inifile/data/1.ini
    trunk/libzypp/tests/parser/inifile/iniparser_test.cc
Modified:
    trunk/libzypp/tests/parser/CMakeLists.txt

Modified: trunk/libzypp/tests/parser/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/parser/CMakeLists.txt?rev=5432&r1=5431&r2=5432&view=diff
==============================================================================
--- trunk/libzypp/tests/parser/CMakeLists.txt (original)
+++ trunk/libzypp/tests/parser/CMakeLists.txt Mon Apr 23 13:14:36 2007
@@ -1 +1,2 @@
-ADD_SUBDIRECTORY( yum )
\ No newline at end of file
+ADD_SUBDIRECTORY( yum )
+ADD_SUBDIRECTORY( inifile )
\ No newline at end of file

Added: trunk/libzypp/tests/parser/inifile/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/parser/inifile/CMakeLists.txt?rev=5432&view=auto
==============================================================================
--- trunk/libzypp/tests/parser/inifile/CMakeLists.txt (added)
+++ trunk/libzypp/tests/parser/inifile/CMakeLists.txt Mon Apr 23 13:14:36 2007
@@ -0,0 +1,4 @@
+ADD_EXECUTABLE( inifile iniparser_test.cc )
+TARGET_LINK_LIBRARIES( inifile zypp boost_unit_test_framework )
+
+ADD_TEST(inifile ${CMAKE_CURRENT_BINARY_DIR}/inifile ${CMAKE_CURRENT_SOURCE_DIR}/data )

Added: trunk/libzypp/tests/parser/inifile/data/1.ini
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/parser/inifile/data/1.ini?rev=5432&view=auto
==============================================================================
--- trunk/libzypp/tests/parser/inifile/data/1.ini (added)
+++ trunk/libzypp/tests/parser/inifile/data/1.ini Mon Apr 23 13:14:36 2007
@@ -0,0 +1,54 @@
+[base]
+name=CentOS-$releasever - Base
+mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
+#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
+gpgcheck=1
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
+protect=1
+
+#released updates 
+[update]
+name=CentOS-$releasever - Updates
+mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
+#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
+gpgcheck=1
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
+protect=1 
+
+#packages used/produced in the build but not released
+[addons]
+name=CentOS-$releasever - Addons
+mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
+#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
+gpgcheck=1
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
+protect=0 
+
+#additional packages that may be useful
+[extras]
+name=CentOS-$releasever - Extras
+mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
+#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
+gpgcheck=1
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
+protect=0 
+
+#additional packages that extend functionality of existing packages
+[centosplus]
+name=CentOS-$releasever - Plus
+mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
+#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
+gpgcheck=1
+enabled=0
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
+protect=0 
+
+#contrib - packages by Centos Users
+[contrib]
+name=CentOS-$releasever - Contrib
+mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
+#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
+gpgcheck=1
+enabled=0
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
+protect=0
\ No newline at end of file

Added: trunk/libzypp/tests/parser/inifile/iniparser_test.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/parser/inifile/iniparser_test.cc?rev=5432&view=auto
==============================================================================
--- trunk/libzypp/tests/parser/inifile/iniparser_test.cc (added)
+++ trunk/libzypp/tests/parser/inifile/iniparser_test.cc Mon Apr 23 13:14:36 2007
@@ -0,0 +1,52 @@
+#include <stdio.h>
+#include <iostream>
+#include <fstream>
+#include <vector>
+#include <list>
+#include <boost/test/unit_test.hpp>
+#include <boost/test/parameterized_test.hpp>
+#include <boost/test/unit_test_log.hpp>
+
+#include "zypp/parser/inifile/ini_file.hpp"
+#include "zypp/Url.h"
+#include "zypp/PathInfo.h"
+
+using std::cout;
+using std::endl;
+using std::string;
+using namespace zypp;
+using namespace boost::unit_test;
+
+
+void ini_read_test(const string &dir)
+{
+  
+}
+
+test_suite*
+init_unit_test_suite( int argc, char *argv[] )
+{
+  string datadir;
+  if (argc < 2)
+  {
+    datadir = TESTS_SRC_DIR;
+    datadir = (Pathname(datadir) + "/parser/inifile/data").asString();
+    cout << "inifile_test:"
+      " path to directory with test data required as parameter. Using " << datadir  << endl;
+    //return (test_suite *)0;
+    
+  }
+  else
+  {
+    datadir = argv[1];
+  }
+  
+  test_suite* test= BOOST_TEST_SUITE("ini_file");
+  
+  std::string const params[] = { datadir };
+  test->add(BOOST_PARAM_TEST_CASE(&ini_read_test,
+                                 (std::string const*)params, params+1));
+  return test;
+}
+
+// vim: set ts=2 sts=2 sw=2 ai et:

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages