libept
test.h
Go to the documentation of this file.
00001 //#include <ept/core/apt.h>
00002 #include <ept/config.h>
00003 #include <ept/debtags/maint/path.h>
00004 
00005 #include <wibble/test.h>
00006 
00007 #include <apt-pkg/pkgcache.h>
00008 #include <apt-pkg/sourcelist.h>
00009 #include <apt-pkg/error.h>
00010 #include <apt-pkg/policy.h>
00011 #include <apt-pkg/cachefile.h>
00012 #include <apt-pkg/progress.h>
00013 #include <apt-pkg/pkgcachegen.h>
00014 #include <apt-pkg/init.h>
00015 
00016 
00017 #ifndef EPT_TEST_H
00018 #define EPT_TEST_H
00019 
00020 struct AptTestEnvironment {
00021     //ept::core::AptDatabase db;
00022     AptTestEnvironment() {
00023         pkgInitConfig (*_config);
00024         _config->Set("Initialized", 1);
00025         _config->Set("Dir", TEST_ENV_DIR);
00026         _config->Set("Dir::Cache", "cache");
00027         _config->Set("Dir::State", "state");
00028         _config->Set("Dir::Etc", "etc");
00029         _config->Set("Dir::Etc::sourcelist", "sources.list");
00030         _config->Set("Dir::State::status", TEST_ENV_DIR "dpkg-status");
00031         pkgInitSystem (*_config, _system);
00032     }
00033 };
00034 
00035 struct DebtagsTestEnvironment : AptTestEnvironment {
00036     ept::debtags::Path::OverrideDebtagsSourceDir odsd;
00037     ept::debtags::Path::OverrideDebtagsIndexDir odid;
00038     ept::debtags::Path::OverrideDebtagsUserSourceDir odusd;
00039     ept::debtags::Path::OverrideDebtagsUserIndexDir oduid;
00040 
00041     DebtagsTestEnvironment()
00042         : odsd( TEST_ENV_DIR "debtags/"),
00043           odid( TEST_ENV_DIR "debtags/"),
00044           odusd( TEST_ENV_DIR "debtags/"),
00045           oduid( TEST_ENV_DIR "debtags/")
00046     {}
00047 };
00048 
00049 #endif