Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions licomp_toolkit/data/reply_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,11 @@
"description" : "The compatbility between the Outbound and Inbound license expressions"
},
"explanation" : {
"type" : [ "string", "null" ],
"description" : "A text describing the compatiblity, e.g. how the compatibility was determined"
"type" : "array" ,
"items": {
"type" : "string"
},
"description" : "A list of texts describing the compatiblity, e.g. how the compatibility was determined"
},
"api_version" : {
"type" : "string",
Expand Down
4 changes: 3 additions & 1 deletion licomp_toolkit/toolkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
from licomp_dwheeler.dwheeler import LicompDw
from licomp_hermione.hermione import LicompHermione
from licomp_gnuguide.gnuguide import GnuQuickGuideLicense
from licomp_oslc_handbook.oslc_handbook import LicompOslcHandbook
from licomp_doubleopen.doubleopen import LicompDoubleOpen

from licomp_toolkit.config import disclaimer
from licomp_toolkit.config import licomp_toolkit_version
Expand Down Expand Up @@ -47,7 +49,7 @@ def __init__(self):
self._licomp_resources[licomp_instance.name()] = licomp_instance

self._licomp_resources_optional = {}
for licomp in [LicompHermione, LicompProprietary, LicompDw, GnuQuickGuideLicense]:
for licomp in [LicompHermione, LicompProprietary, LicompDw, GnuQuickGuideLicense, LicompOslcHandbook, LicompDoubleOpen]:
licomp_instance = licomp()
self._licomp_resources_optional[licomp_instance.name()] = licomp_instance

Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ licomp-dwheeler == 0.5.*
licomp-proprietary == 0.5.*
licomp-hermione == 0.5.*
licomp-gnuguide == 0.5.*
licomp-doubleopen == 0.1.*
licomp-oslc-handbook == 0.1.*
foss-flame
PyYaml
6 changes: 6 additions & 0 deletions tests/python/test_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def test_supported_resources():
assert "licomp_hermione" in resource_names
assert "licomp_dwheeler" in resource_names
assert "licomp_gnuguide" in resource_names
assert "licomp_oslc_handbook" in resource_names
assert "licomp_doubleopen" in resource_names

def test_supported_resources_standard():
assert "licomp_reclicense" in standard_resource_names
Expand All @@ -35,6 +37,8 @@ def test_supported_resources_standard():
assert "licomp_hermione" not in standard_resource_names
assert "licomp_dwheeler" not in standard_resource_names
assert "licomp_gnuguide" not in standard_resource_names
assert "licomp_oslc_handbook" in standard_resource_names
assert "licomp_doubleopen" in standard_resource_names

def test_supported_resources_standard():
assert "licomp_reclicense" not in optional_resource_names
Expand All @@ -43,3 +47,5 @@ def test_supported_resources_standard():
assert "licomp_hermione" in optional_resource_names
assert "licomp_dwheeler" in optional_resource_names
assert "licomp_gnuguide" in optional_resource_names
assert "licomp_oslc_handbook" in optional_resource_names
assert "licomp_doubleopen" in optional_resource_names
11 changes: 5 additions & 6 deletions tests/python/test_toolkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,18 @@ def test_provisioning_is_not_supported():
def test_compat():
ret = lt.outbound_inbound_compatibility("GPL-2.0-only", "BSD-3-Clause", UseCase.LIBRARY, Provisioning.BIN_DIST)
logging.debug("ret: " + str(ret['summary']['results']))
print("... hesa: " + str(ret['summary']['results']['yes']))
assert ret['summary']['results']['yes']['count'] == 4
assert ret['summary']['results']['yes']['count'] == 5

def test_incompat():
def test_incompat_1():
ret = lt.outbound_inbound_compatibility("BSD-3-Clause", "GPL-2.0-only", UseCase.LIBRARY, Provisioning.BIN_DIST)
logging.debug("ret: " + str(ret['summary']['results']))
assert ret['summary']['results']['no']['count'] == 2
assert ret['summary']['results']['no']['count'] == 5

def test_incompat():
def test_incompat_2():
ret = lt.outbound_inbound_compatibility("BSD-3-Clause", "GPL-2.0-only", UseCase.LIBRARY, Provisioning.WEBUI)
logging.debug("ret: " + str(ret['summary']['statuses']))
# all five resources fail on webui
assert len(ret['summary']['statuses']['failure']) == 6
assert len(ret['summary']['statuses']['failure']) == 8

def test_disclaimer():
logging.debug(f'check disclaimer')
Expand Down
15 changes: 7 additions & 8 deletions tests/shell/test-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ test_version()
test_licomp_tk_text "--version" "" "$LT_VERSION"
test_licomp_tk_text "--name" "" licomp-toolkit
test_licomp_tk_text " -of text versions" "| head -1" "licomp-toolkit: $LT_VERSION"
test_licomp_tk_text " -of text versions" "| wc -l" "7"
test_licomp_tk_text " -of text versions" "| wc -l" "9"
}

test_supp_unsupp()
Expand Down Expand Up @@ -101,23 +101,23 @@ test_snippet_bindist()
test_supports_license()
{
echo "# supports license"
test_licomp_tk_text " -of text supports-license MIT" " | wc -l" 6
test_licomp_tk_text " -of json supports-license MIT" " | jq .[].name | wc -l" 6
test_licomp_tk_text " supports-license MIT" " | jq .[].name | wc -l" 6
test_licomp_tk_text " -of text supports-license MIT" " | wc -l" 8
test_licomp_tk_text " -of json supports-license MIT" " | jq .[].name | wc -l" 8
test_licomp_tk_text " supports-license MIT" " | jq .[].name | wc -l" 8
}

test_supports_provisioning()
{
echo "# supports provisioning"
test_licomp_tk_text " -of text supports-provisioning binary-distribution" " | wc -l" 6
test_licomp_tk_text " -of text supports-provisioning binary-distribution" " | wc -l" 8
test_licomp_tk_text " -of text supports-provisioning provide-webui" " | grep -v \"^$\" | wc -l " 0
}

test_supports_usecase()
{
echo "# supports usecase"
test_licomp_tk_text " -of text supports-usecase snippet" " | wc -l" 1
test_licomp_tk_text " -of text supports-usecase library" " | wc -l " 5
test_licomp_tk_text " -of text supports-usecase snippet" " | wc -l" 2
test_licomp_tk_text " -of text supports-usecase library" " | wc -l " 6
}


Expand All @@ -128,4 +128,3 @@ test_snippet_bindist
test_supports_license
test_supports_provisioning
test_supports_usecase

3 changes: 2 additions & 1 deletion tests/shell/test_validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,12 @@ incompatibles()
validate_reply "GPL-2.0-only" "BSD-2-Clause AND Apache-2.0" 2 0
validate_reply "BSD-2-Clause AND Apache-2.0" "GPL-2.0-only" 2 0
validate_reply "Apache-2.0" "GPL-2.0-only" 2 0
echo ---------------------------------------------
validate_reply "Apache-2.0" "GPL-3.0-only" 9 0 " -r all"
}

echo "Compatibles"
compatibles
#compatibles
echo "Incompatibles"
incompatibles
rm $REPLY_FILE