Skip to content

Commit f666b5b

Browse files
tulinkryVladimir Kotal
authored andcommitted
documentation and copyrights
1 parent 8f3a5b1 commit f666b5b

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

opengrok-tools/src/test/python/conftest.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,41 @@
1+
#!/usr/bin/env python3
2+
3+
#
4+
# CDDL HEADER START
5+
#
6+
# The contents of this file are subject to the terms of the
7+
# Common Development and Distribution License (the "License").
8+
# You may not use this file except in compliance with the License.
9+
#
10+
# See LICENSE.txt included in this distribution for the specific
11+
# language governing permissions and limitations under the License.
12+
#
13+
# When distributing Covered Code, include this CDDL HEADER in each
14+
# file and include the License file at LICENSE.txt.
15+
# If applicable, add the following below this CDDL HEADER, with the
16+
# fields enclosed by brackets "[]" replaced with your own identifying
17+
# information: Portions Copyright [yyyy] [name of copyright owner]
18+
#
19+
# CDDL HEADER END
20+
#
21+
22+
#
23+
# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
24+
# Portions Copyright (c) 2020, Krystof Tulinger <[email protected]>
25+
#
126
import os
227

328
import pytest
429

530

631
def system_binary(name):
32+
"""
33+
Creates an argument of {name}_binary which automatically
34+
skips the test execution when the binary is not available on the system.
35+
36+
:param name: the binary name (the command)
37+
"""
38+
739
def decorator(fn):
840
return pytest.mark.parametrize(
941
('{}_binary'.format(name)), [
@@ -15,4 +47,7 @@ def decorator(fn):
1547

1648

1749
def posix_only(fn):
50+
"""
51+
Automatically skips the test execution when the current system is not in posix family.
52+
"""
1853
return pytest.mark.skipif(not os.name.startswith("posix"), reason="requires posix")(fn)

opengrok-tools/src/test/python/test_command.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
#
2323
# Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
24+
# Portions Copyright (c) 2020, Krystof Tulinger <[email protected]>
2425
#
2526

2627
import os

0 commit comments

Comments
 (0)