summaryrefslogtreecommitdiffstats
path: root/tests/unit/reporter
diff options
context:
space:
mode:
authorTaseer <taseer94@gmail.com>2017-03-23 14:26:49 +0500
committerYujun Zhang <zhang.yujunz@zte.com.cn>2017-03-24 09:29:04 +0000
commit6a4c4e2dba5c565871aa7259978a6ad547c34be2 (patch)
tree4d777f65e5bbaca237367d0e93a06caf29fb9b8e /tests/unit/reporter
parentf01644b80a940cf17300114db7593c66c6120b54 (diff)
Integrate cli, runner and reporter.
- Execute runner via a shell command - Change format of qtip result directory to qtip-timestamp - Add path option in reporter to match with runner JIRA: QTIP-229 Change-Id: I7d8562fd7100b1f40cdc8d53b0daa6a06a55b495 Signed-off-by: Taseer Ahmed <taseer94@gmail.com> (cherry picked from commit c2bb13c460566a18e61a3c840bf12f7f717940c2)
Diffstat (limited to 'tests/unit/reporter')
-rw-r--r--tests/unit/reporter/console_test.py32
1 files changed, 20 insertions, 12 deletions
diff --git a/tests/unit/reporter/console_test.py b/tests/unit/reporter/console_test.py
index aa7f848b..037ef2fb 100644
--- a/tests/unit/reporter/console_test.py
+++ b/tests/unit/reporter/console_test.py
@@ -8,6 +8,7 @@
##############################################################################
import pytest
+from os import path
from qtip.reporter.console import ConsoleReporter
@@ -17,14 +18,21 @@ def console_reporter():
return ConsoleReporter({})
+@pytest.fixture
+def result_path():
+ result = path.join(path.dirname(__file__), path.pardir, path.pardir,
+ 'data/reporter')
+ return result
+
+
def test_constructor(console_reporter):
assert isinstance(console_reporter, ConsoleReporter)
-def test_dhrystone(console_reporter):
+def test_dhrystone(console_reporter, result_path):
""" Test dhrystone report"""
- result = console_reporter.render('dhrystone')
+ result = console_reporter.render('dhrystone', result_path)
assert "Benchmark: dhrystone" in result
assert "Number: 40" in result
assert "Score: 63529.6" in result
@@ -32,10 +40,10 @@ def test_dhrystone(console_reporter):
assert "Total CPUs: 40" in result
-def test_whetstone(console_reporter):
+def test_whetstone(console_reporter, result_path):
""" Test whetstone output"""
- result = console_reporter.render('whetstone')
+ result = console_reporter.render('whetstone', result_path)
assert "Benchmark: whetstone" in result
assert "Results:" in result
assert "Multi CPU:" in result
@@ -44,10 +52,10 @@ def test_whetstone(console_reporter):
assert "Single CPU:" in result
-def test_dpi(console_reporter):
+def test_dpi(console_reporter, result_path):
""" Test dpi report"""
- result = console_reporter.render('dpi')
+ result = console_reporter.render('dpi', result_path)
assert "Benchmark: dpi" in result
assert "Bits per Second: 3.638" in result
assert "Packets per Second: 1.45" in result
@@ -55,10 +63,10 @@ def test_dpi(console_reporter):
assert "Packets per Second: 1.458" in result
-def test_ramspeed(console_reporter):
+def test_ramspeed(console_reporter, result_path):
""" Test ramspeed report """
- result = console_reporter.render('ramspeed')
+ result = console_reporter.render('ramspeed', result_path)
assert "Float Addition: 10217.62" in result
assert "Float Average: 9176.88" in result
assert "Float Copy: 8127.13" in result
@@ -68,10 +76,10 @@ def test_ramspeed(console_reporter):
assert "Integer Average: 11396.35" in result
-def test_ssl(console_reporter):
+def test_ssl(console_reporter, result_path):
""" Test ssl report"""
- result = console_reporter.render('ssl')
+ result = console_reporter.render('ssl', result_path)
assert "AES 128 CBC (bytes):" in result
assert "256: 584951.30k" in result
assert "RSA SIGN:" in result
@@ -80,10 +88,10 @@ def test_ssl(console_reporter):
assert "4096: 7688.5" in result
-def test_sys(console_reporter):
+def test_sys(console_reporter, result_path):
""" Test sys_info """
- result = console_reporter.render('ssl')
+ result = console_reporter.render('ssl', result_path)
assert "System Information:" in result
assert "Host Name: node-38.zte.com.cn" in result
assert "Memory: 4403.7/128524.1MB" in result