Skip to content

Commit

Permalink
Merge pull request #3923 from micmn/feature/trained-model-test-gpl
Browse files Browse the repository at this point in the history
Disable trained model serialization test for gpl files when building with bsd license
  • Loading branch information
karlnapf committed Jul 11, 2017
2 parents 4950bfa + aaa9c76 commit f027fb3
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions tests/unit/base/trained_model_serialization_unittest.cc.py
Expand Up @@ -37,6 +37,10 @@ def is_pure_virtual(name, tags):
return any([name + '\timplementation:pure virtual' in tag for tag in tags])


def use_gpl(path, defined_guards):
return 'src/gpl/' not in path or 'use_gpl_shogun' in defined_guards


def is_shogun_class(c):
return c[0] == 'C' and c[1].isupper() and 'class' in c

Expand Down Expand Up @@ -80,9 +84,15 @@ def entry(templateFile, input_file, config_file):
# Get all linear machines
global IGNORE_LIST
base = 'CLinearMachine'
machines = {name: attrs for name, attrs in classes.items() if name not in IGNORE_LIST and
base in get_ancestors(classes, name) and not is_guarded(attrs['include'], guards)
and not is_pure_virtual(name, tags) and not ignore_in_class_list(attrs['include'])}
machines = {
name: attrs for name, attrs in classes.items() if
name not in IGNORE_LIST and
base in get_ancestors(classes, name) and
not is_guarded(attrs['include'], guards) and
not is_pure_virtual(name, tags) and
not ignore_in_class_list(attrs['include']) and
use_gpl(attrs['include'], guards)
}

templateVars = {"classes" : machines}

Expand Down

0 comments on commit f027fb3

Please sign in to comment.