提交 80a8e5ca 编写于 作者: L Lucas Meneghel Rodrigues 提交者: Lucas Meneghel Rodrigues

Merge pull request #204 from lmr/move-tests-examples

avocado: Move tests to example/tests
Summary: Avocado Test Framework
Name: avocado
Version: 0.12.0
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv2
Group: Development/Tools
URL: http://avocado-framework.readthedocs.org/
......@@ -35,17 +35,22 @@ these days a framework) to perform automated testing.
%{python_sitelib}/avocado*
%{_mandir}/man1/avocado.1.gz
%package tests
Summary: Avocado Test Framework Sample Tests
%package examples
Summary: Avocado Test Framework Example Tests
Requires: avocado
%description tests
The set of example tests that are part of the Avocado framework.
%description examples
The set of example tests present in the upstream tree of the Avocado framework.
Some of them are used as functional tests of the framework, others serve as
examples of how to write tests on your own.
%files tests
%files examples
%{_datadir}/avocado/tests
%changelog
* Tue Sep 11 2014 Lucas Meneghel Rodrigues <lmr@redhat.com> - 0.12.0-2
- Rename -tests package to -examples
* Tue Sep 9 2014 Lucas Meneghel Rodrigues <lmr@redhat.com> - 0.12.0-1
- New upstream release
......
......@@ -39,7 +39,7 @@ from avocado.settings import settings
_BASE_DIR = os.path.join(sys.modules[__name__].__file__, "..", "..", "..")
_BASE_DIR = os.path.abspath(_BASE_DIR)
_IN_TREE_TESTS_DIR = os.path.join(_BASE_DIR, 'tests')
_IN_TREE_TESTS_DIR = os.path.join(_BASE_DIR, 'examples', 'tests')
SETTINGS_BASE_DIR = os.path.expanduser(settings.get_value('runner', 'base_dir'))
SETTINGS_TEST_DIR = os.path.expanduser(settings.get_value('runner', 'test_dir'))
......
......@@ -77,12 +77,12 @@ class RunnerOperationTest(unittest.TestCase):
def test_datadir_noalias(self):
os.chdir(basedir)
cmd_line = './scripts/avocado run tests/datadir.py tests/datadir.py'
cmd_line = './scripts/avocado run examples/tests/datadir.py examples/tests/datadir.py'
process.run(cmd_line)
def test_runner_noalias(self):
os.chdir(basedir)
cmd_line = "./scripts/avocado run tests/sleeptest.py tests/sleeptest.py"
cmd_line = "./scripts/avocado run examples/tests/sleeptest.py examples/tests/sleeptest.py"
process.run(cmd_line)
def test_runner_tests_fail(self):
......
......@@ -57,7 +57,7 @@ class MultiplexTests(unittest.TestCase):
"%d:\n%s" % (cmd_line, expected_rc, result))
def test_mplex_plugin(self):
cmd_line = './scripts/avocado multiplex tests/sleeptest.py.data/sleeptest.yaml'
cmd_line = './scripts/avocado multiplex examples/tests/sleeptest.py.data/sleeptest.yaml'
expected_rc = 0
self.run_and_check(cmd_line, expected_rc)
......@@ -67,12 +67,12 @@ class MultiplexTests(unittest.TestCase):
self.run_and_check(cmd_line, expected_rc)
def test_run_mplex_noid(self):
cmd_line = './scripts/avocado run --multiplex tests/sleeptest.py.data/sleeptest.yaml'
expected_rc = 0
self.run_and_check(cmd_line, 2)
cmd_line = './scripts/avocado run --multiplex examples/tests/sleeptest.py.data/sleeptest.yaml'
expected_rc = 2
self.run_and_check(cmd_line, expected_rc)
def test_run_mplex_sleeptest(self):
cmd_line = './scripts/avocado run sleeptest --multiplex tests/sleeptest.py.data/sleeptest.yaml'
cmd_line = './scripts/avocado run sleeptest --multiplex examples/tests/sleeptest.py.data/sleeptest.yaml'
expected_rc = 0
# A typical sleeptest has about 14 lines of output,
# so we expect the full job log has at least 3 times
......@@ -81,7 +81,7 @@ class MultiplexTests(unittest.TestCase):
self.run_and_check(cmd_line, expected_rc, 14*3)
def test_run_mplex_noalias_sleeptest(self):
cmd_line = './scripts/avocado run tests/sleeptest.py --multiplex tests/sleeptest.py.data/sleeptest.yaml'
cmd_line = './scripts/avocado run examples/tests/sleeptest.py --multiplex examples/tests/sleeptest.py.data/sleeptest.yaml'
expected_rc = 0
# A typical sleeptest has about 14 lines of output,
# so we expect the full job log has at least 3 times
......@@ -90,12 +90,12 @@ class MultiplexTests(unittest.TestCase):
self.run_and_check(cmd_line, expected_rc, 14*3)
def test_run_mplex_doublesleep(self):
cmd_line = './scripts/avocado run sleeptest sleeptest --multiplex tests/sleeptest.py.data/sleeptest.yaml'
cmd_line = './scripts/avocado run sleeptest sleeptest --multiplex examples/tests/sleeptest.py.data/sleeptest.yaml'
expected_rc = 0
self.run_and_check(cmd_line, expected_rc)
def test_run_mplex_failtest(self):
cmd_line = './scripts/avocado run sleeptest failtest --multiplex tests/sleeptest.py.data/sleeptest.yaml'
cmd_line = './scripts/avocado run sleeptest failtest --multiplex examples/tests/sleeptest.py.data/sleeptest.yaml'
expected_rc = 1
self.run_and_check(cmd_line, expected_rc)
......
......@@ -44,27 +44,27 @@ class StandaloneTests(unittest.TestCase):
"%d:\n%s" % (tstname, expected_rc, result))
def test_sleeptest(self):
cmd_line = './tests/sleeptest.py'
cmd_line = './examples/tests/sleeptest.py'
expected_rc = 0
self.run_and_check(cmd_line, expected_rc, 'sleeptest')
def test_skiptest(self):
cmd_line = './tests/skiptest.py'
cmd_line = './examples/tests/skiptest.py'
expected_rc = 0
self.run_and_check(cmd_line, expected_rc, 'skiptest')
def test_failtest(self):
cmd_line = './tests/failtest.py'
cmd_line = './examples/tests/failtest.py'
expected_rc = 1
self.run_and_check(cmd_line, expected_rc, 'failtest')
def test_errortest(self):
cmd_line = './tests/errortest.py'
cmd_line = './examples/tests/errortest.py'
expected_rc = 1
self.run_and_check(cmd_line, expected_rc, 'errortest')
def test_warntest(self):
cmd_line = './tests/warntest.py'
cmd_line = './examples/tests/warntest.py'
expected_rc = 1
self.run_and_check(cmd_line, expected_rc, 'warntest')
......
......@@ -50,10 +50,11 @@ def get_docs_dir():
def get_data_files():
data_files = [(get_settings_dir(), ['etc/settings.ini'])]
data_files += [(get_tests_dir(), glob.glob('tests/*.py'))]
for data_dir in glob.glob('tests/*.data'):
data_files += [(get_tests_dir(), glob.glob('examples/tests/*.py'))]
for data_dir in glob.glob('examples/tests/*.data'):
fmt_str = '%s/*' % data_dir
data_files += [(os.path.join(get_tests_dir(), os.path.basename(data_dir)), [glob.glob(fmt_str)[0]])]
for f in glob.glob(fmt_str):
data_files += [(os.path.join(get_tests_dir(), os.path.basename(data_dir)), [f])]
data_files.append((get_docs_dir(), ['man/avocado.rst']))
return data_files
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册