File: test.h

package info (click to toggle)
libept 1.0.12.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 14,292 kB
  • ctags: 787
  • sloc: cpp: 4,449; sh: 28; makefile: 17
file content (49 lines) | stat: -rw-r--r-- 1,414 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//#include <ept/core/apt.h>
#include <ept/config.h>
#include <ept/debtags/maint/path.h>

#include <wibble/test.h>

#include <apt-pkg/pkgcache.h>
#include <apt-pkg/sourcelist.h>
#include <apt-pkg/error.h>
#include <apt-pkg/policy.h>
#include <apt-pkg/cachefile.h>
#include <apt-pkg/progress.h>
#include <apt-pkg/pkgcachegen.h>
#include <apt-pkg/init.h>


#ifndef EPT_TEST_H
#define EPT_TEST_H

struct AptTestEnvironment {
    //ept::core::AptDatabase db;
    AptTestEnvironment() {
        pkgInitConfig (*_config);
        _config->Set("Initialized", 1);
        _config->Set("Dir", TEST_ENV_DIR);
        _config->Set("Dir::Cache", "cache");
        _config->Set("Dir::State", "state");
        _config->Set("Dir::Etc", "etc");
        _config->Set("Dir::Etc::sourcelist", "sources.list");
        _config->Set("Dir::State::status", TEST_ENV_DIR "dpkg-status");
        pkgInitSystem (*_config, _system);
    }
};

struct DebtagsTestEnvironment : AptTestEnvironment {
    ept::debtags::Path::OverrideDebtagsSourceDir odsd;
    ept::debtags::Path::OverrideDebtagsIndexDir odid;
    ept::debtags::Path::OverrideDebtagsUserSourceDir odusd;
    ept::debtags::Path::OverrideDebtagsUserIndexDir oduid;

    DebtagsTestEnvironment()
        : odsd( TEST_ENV_DIR "debtags/"),
          odid( TEST_ENV_DIR "debtags/"),
          odusd( TEST_ENV_DIR "debtags/"),
          oduid( TEST_ENV_DIR "debtags/")
    {}
};

#endif