mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 09:32:37 +00:00
Purge old BIMTester files
This commit is contained in:
@@ -1,2 +0,0 @@
|
|||||||
[behave.userdata]
|
|
||||||
runner.continue_after_failed_step = true
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
import ifcopenshell
|
|
||||||
from behave import given, when, then, step
|
|
||||||
|
|
||||||
class IfcFile(object):
|
|
||||||
file = None
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def load(cls, path=None):
|
|
||||||
cls.file = ifcopenshell.open(path)
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def get(cls):
|
|
||||||
return cls.file
|
|
||||||
|
|
||||||
@given('the IFC file "{file}"')
|
|
||||||
def step_impl(context, file):
|
|
||||||
IfcFile.load(file)
|
|
||||||
|
|
||||||
@given('that an IFC file is loaded')
|
|
||||||
def step_impl(context):
|
|
||||||
assert IfcFile.get()
|
|
||||||
|
|
||||||
@then('the file should be an {schema} file')
|
|
||||||
def step_impl(context, schema):
|
|
||||||
assert IfcFile.get().schema == schema
|
|
||||||
|
|
||||||
@then('the element {id} is an {ifc_class}')
|
|
||||||
def step_impl(context, id, ifc_class):
|
|
||||||
assert IfcFile.get().by_id(id).is_a(ifc_class)
|
|
||||||
|
|
||||||
@then('the element {id} should not exist because {reason}')
|
|
||||||
def step_impl(context, id, reason):
|
|
||||||
assert not IfcFile.get().by_id(id)
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<meta name="description" content="foobaro">
|
|
||||||
<title>BlenderBIM</title>
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Comfortaa|Inconsolata|Open+Sans&display=swap" rel="stylesheet">
|
|
||||||
<style>
|
|
||||||
body { font-family: 'Arial', sans-serif; }
|
|
||||||
span.time { color: #999; font-style: italic; float: right; }
|
|
||||||
span.step-time { float: right; color: #555; font-size: 0.8em; font-style: italic; }
|
|
||||||
span.success { background-color: #97cc64; padding: 5px; border-radius: 5px; color: #FFF; font-weight: bold; }
|
|
||||||
span.failure { background-color: #fb5a3e; padding: 5px; border-radius: 5px; color: #FFF; font-weight: bold; }
|
|
||||||
li { padding: 10px; }
|
|
||||||
li.success { background-color: #b6cca1; color: #333; }
|
|
||||||
li.failure { background-color: #fbb4a8; color: #900; }
|
|
||||||
footer { color: #999; border-top: 1px solid #999; font-size: 0.8em; }
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<header>
|
|
||||||
<h1>IFC QA Report: {{report_name}}</h1>
|
|
||||||
</header>
|
|
||||||
{{#testcases}}
|
|
||||||
<section>
|
|
||||||
<h2>{{name}}</h2>
|
|
||||||
<p>
|
|
||||||
<span class="{{#is_success}}success{{/is_success}}{{^is_success}}failure{{/is_success}}">{{#is_success}}Success{{/is_success}}{{^is_success}}Failure{{/is_success}}</span>
|
|
||||||
Tests passed: <strong>{{total_passes}} / {{total_steps}}</strong>
|
|
||||||
<span class="time">
|
|
||||||
Time taken: {{time}} seconds
|
|
||||||
</span>
|
|
||||||
</p>
|
|
||||||
<ol>
|
|
||||||
{{#steps}}
|
|
||||||
<li class="{{#is_success}}success{{/is_success}}{{^is_success}}failure{{/is_success}}">
|
|
||||||
{{name}}
|
|
||||||
<span class="step-time">{{time}}</span>
|
|
||||||
</li>
|
|
||||||
{{/steps}}
|
|
||||||
</ol>
|
|
||||||
</section>
|
|
||||||
{{/testcases}}
|
|
||||||
<footer>
|
|
||||||
<p>
|
|
||||||
OpenBIM auditing is a feature of <a href="https://blenderbim.org/">BlenderBIM</a> and <a href="http://ifcopenshell.org/">IfcOpenShell</a>.
|
|
||||||
</p>
|
|
||||||
</footer>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
from behave.__main__ import main as behave_main
|
|
||||||
import xml.etree.ElementTree as ET
|
|
||||||
import pystache
|
|
||||||
|
|
||||||
behave_main(['features', '--junit', '--junit-directory', 'junit/'])
|
|
||||||
|
|
||||||
with open('junit/template.html') as template:
|
|
||||||
root = ET.parse('junit/TESTS-example.xml').getroot()
|
|
||||||
data = {
|
|
||||||
'report_name': root.get('name'),
|
|
||||||
'testcases': []
|
|
||||||
}
|
|
||||||
for testcase in root.findall('testcase'):
|
|
||||||
steps = []
|
|
||||||
system_out = testcase.findall('system-out')[0].text.splitlines()
|
|
||||||
for line in system_out:
|
|
||||||
if line.strip()[0:5] in ['Given', 'Then ', 'When ']:
|
|
||||||
is_success = True if ' ... passed in ' in line else False
|
|
||||||
steps.append({
|
|
||||||
'name': line.strip().split(' ... ')[0],
|
|
||||||
'time': line.strip().split(' ... ')[1],
|
|
||||||
'is_success': is_success
|
|
||||||
})
|
|
||||||
data['testcases'].append({
|
|
||||||
'name': testcase.get('name'),
|
|
||||||
'is_success': testcase.get('status') == 'passed',
|
|
||||||
'time': testcase.get('time'),
|
|
||||||
'steps': steps,
|
|
||||||
'total_passes': len([s for s in steps if s['is_success'] == True]),
|
|
||||||
'total_steps': len(steps)
|
|
||||||
})
|
|
||||||
with open('junit/results.html', 'w') as out:
|
|
||||||
out.write(pystache.render(template.read(), data))
|
|
||||||
Reference in New Issue
Block a user