File: runtests.py

package info (click to toggle)
pylogsparser 0.4-1
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch, wheezy
  • size: 948 kB
  • ctags: 194
  • sloc: xml: 9,693; python: 5,771; makefile: 13
file content (29 lines) | stat: -rw-r--r-- 921 bytes parent folder | download
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
import sys
import os
import unittest
from os.path import join
from distutils.sysconfig import get_python_lib
from site import addsitedir

root = sys.argv.pop(1)
site_packages = get_python_lib()
_path = sys.path[:]
sys.path[:] = []
addsitedir(join(root, site_packages[1:]))
addsitedir(join(root, site_packages[1:].replace('dist-packages', 'site-packages')))
sys.path.extend(_path)

os.environ['NORMALIZERS_PATH'] = os.path.join(root,
					'usr/share/logsparser/normalizers')
from logsparser.tests import test_normalizer
from logsparser.tests import test_lognormalizer
from logsparser.tests import test_log_samples
from logsparser.tests import test_commonElements
tests = (test_commonElements,
         test_normalizer,
         test_lognormalizer,
         test_log_samples,
         )
load = unittest.defaultTestLoader.loadTestsFromModule
suite = unittest.TestSuite(map(load, tests))
unittest.TextTestRunner().run(suite)