2016-01-13 13:38:23 +02:00
|
|
|
#!/usr/bin/python
|
2019-07-30 20:11:01 -07:00
|
|
|
#
|
|
|
|
# Copyright (c) 2017-2019 Intel Corporation
|
|
|
|
#
|
|
|
|
# This program and the accompanying materials are made available under the
|
|
|
|
# terms of the The MIT License which is available at
|
|
|
|
# https://opensource.org/licenses/MIT.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
#
|
2016-01-13 13:38:23 +02:00
|
|
|
|
|
|
|
import unittest as u
|
|
|
|
import re, fnmatch, os
|
|
|
|
|
|
|
|
rootDir = '../src/'
|
|
|
|
javaBlacklistFile = '../src/javaswig_blacklist'
|
|
|
|
pythonBlacklistFile = '../src/pythonswig_blacklist'
|
|
|
|
nodeBlacklistFile = '../src/nodeswig_blacklist'
|
|
|
|
|
|
|
|
|
|
|
|
class BlacklistConsistency(u.TestCase):
|
|
|
|
|
2019-04-11 11:49:17 -07:00
|
|
|
@u.expectedFailure
|
2016-01-13 13:38:23 +02:00
|
|
|
def test_java_blacklist(self):
|
|
|
|
|
|
|
|
with open(javaBlacklistFile) as f:
|
2017-06-12 20:38:10 -07:00
|
|
|
blacklist = [line.rstrip('\r\n') for line in f]
|
2016-01-13 13:38:23 +02:00
|
|
|
|
|
|
|
for libraryName in blacklist:
|
|
|
|
files = os.listdir( os.path.join(rootDir, libraryName))
|
2018-01-26 11:52:34 -08:00
|
|
|
interfaceFileName = libraryName + ".i"
|
2016-01-13 13:38:23 +02:00
|
|
|
|
|
|
|
if interfaceFileName in files:
|
|
|
|
self.fail("\n" + libraryName + " is in javaswig blacklist.\n" + \
|
|
|
|
"Remove it from blacklist or remove " + \
|
|
|
|
interfaceFileName + " from sources.")
|
|
|
|
|
|
|
|
|
|
|
|
def test_python_blacklist(self):
|
|
|
|
|
|
|
|
with open(pythonBlacklistFile) as f:
|
2017-06-12 20:38:10 -07:00
|
|
|
blacklist = [line.rstrip('\r\n') for line in f]
|
2016-01-13 13:38:23 +02:00
|
|
|
|
|
|
|
for libraryName in blacklist:
|
|
|
|
files = os.listdir( os.path.join(rootDir, libraryName))
|
|
|
|
interfaceFileName = "pyupm_" + libraryName + ".i"
|
|
|
|
|
|
|
|
if interfaceFileName in files:
|
|
|
|
self.fail("\n" + libraryName + " is in pythonswig blacklist.\n" + \
|
|
|
|
"Remove it from blacklist or remove " + \
|
|
|
|
interfaceFileName + " from sources.")
|
|
|
|
|
|
|
|
|
|
|
|
def test_node_blacklist(self):
|
|
|
|
|
|
|
|
with open(nodeBlacklistFile) as f:
|
2017-06-12 20:38:10 -07:00
|
|
|
blacklist = [line.rstrip('\r\n') for line in f]
|
2016-01-13 13:38:23 +02:00
|
|
|
|
|
|
|
for libraryName in blacklist:
|
|
|
|
files = os.listdir( os.path.join(rootDir, libraryName))
|
|
|
|
interfaceFileName = "jsupm_" + libraryName + ".i"
|
|
|
|
|
|
|
|
if interfaceFileName in files:
|
|
|
|
self.fail("\n" + libraryName + " is in nodeswig blacklist.\n" + \
|
|
|
|
"Remove it from blacklist or remove " + \
|
|
|
|
interfaceFileName + " from sources.")
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
u.main()
|