Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
6a0c334
Fix more Python 3 issues
peternewman Dec 31, 2021
7be0001
Merge branch '0.10' into 0.10-c11-compat
peternewman Dec 31, 2021
ed10398
Encode JSON output in RDM test server for Python 3 compatibility
peternewman Dec 31, 2021
de7c3ee
Merge branch '0.10-c11-compat' of https://github.com/peternewman/ola …
peternewman Dec 31, 2021
260b12d
Add tests for TestRunner.GetTestClasses
peternewman Jan 3, 2022
f3f6704
Cause rdm_responder_test to die if there were no tests found
peternewman Jan 3, 2022
ef7494d
Change how we do the import to try and fix the tests
peternewman Jan 3, 2022
19663da
Another way to try and work round the path issues for the Python test
peternewman Jan 4, 2022
8996884
Fix the flake8 errors, try fixing the build on Travis
peternewman Jan 4, 2022
370ebe6
Fix the TestRunnerTest on Python 2.7
peternewman Jan 4, 2022
be2f809
Merge branch '0.10' into 0.10-c11-compat
peternewman Jan 20, 2022
ce29794
Merge branch '0.10' into 0.10-c11-compat
peternewman Nov 12, 2022
f6de4c2
Add test cases for ExpectedResults classes.
peternewman Nov 18, 2022
f9131dd
Merge branch '0.10-c11-compat' of https://github.com/peternewman/ola …
peternewman Nov 18, 2022
97c4b21
Make more build steps verbose so we hopefully see test failures when …
peternewman Nov 18, 2022
67a5a9d
Short-circuit the main build while we're troubleshooting
peternewman Nov 18, 2022
c2ab8fc
Build more files to fix the testing
peternewman Nov 18, 2022
c92bf06
Add more missing symlinks to try and fix the tests
peternewman Nov 18, 2022
6a56b54
Add another Python symlink for the tests
peternewman Nov 18, 2022
c90596a
Ignore any distcheck folders
peternewman Nov 18, 2022
5af94cd
Also clean compiled pyc files from testing folder
peternewman Nov 18, 2022
322d41e
Add a comment about one of the test hacks
peternewman Nov 18, 2022
621c75d
More NEWS
peternewman Nov 18, 2022
81b0e45
Revert "Short-circuit the main build while we're troubleshooting"
peternewman Nov 18, 2022
7d84bbe
Merge branch '0.10' into 0.10-c11-compat
peternewman Nov 20, 2022
cd8bce9
Merge branch '0.10' of https://github.com/openlightingproject/ola int…
peternewman Nov 21, 2022
15eb5aa
Merge branch '0.10-c11-compat' of https://github.com/peternewman/ola …
peternewman Nov 21, 2022
1bf606a
Fix the RDM test suite discovery code to work with Python 3
peternewman Nov 22, 2022
1cf9e36
Try and fix more encoding issues for further RDM tests
peternewman Nov 22, 2022
8b6441b
Clean more pycache files
peternewman Nov 22, 2022
fa23506
Fix a few more RDM bugs in both the PidStore and a TestMixin
peternewman Nov 22, 2022
2bdfa82
Add a test for packing non-ascii characters, currently fails on Python 3
peternewman Nov 25, 2022
ec0fe8a
Fix the new non-ASCII PidStore test on Python 2
peternewman Nov 25, 2022
1781894
Switch back to the same non-ascii as the responder test
peternewman Nov 25, 2022
d0e772b
Fix even more tests on Python 3
peternewman Nov 25, 2022
f0c0b8d
Add a StringEscape function wrapper
peternewman Nov 26, 2022
f340f99
Switch ContainsUnprintable to use our new StringEscape function
peternewman Nov 26, 2022
3c7f6de
Catch and raise an exception if StringEscape is used on things other …
peternewman Nov 26, 2022
4f1da3f
Catch and raise an exception if ContainsUnprintable is used on things…
peternewman Nov 26, 2022
c8c6ee5
Fix string escaping on Python 3 too
peternewman Nov 26, 2022
fcb9fa6
Fix StringEscape so it still returns a string in Python 3, also add s…
peternewman Nov 26, 2022
7dfe971
Fix the ContainsUnprintable test given our StringEscape changes
peternewman Nov 26, 2022
9d0c68b
Use our escape function and write the pickle data as binary
peternewman Nov 26, 2022
fc9db0d
Use our new StringEscape function rather than duplicating code
peternewman Nov 26, 2022
6451ad5
Encode more response data and decode the post data so it behaves as i…
peternewman Nov 26, 2022
e5cefeb
Use our StringEscape function everywhere else
peternewman Nov 26, 2022
aedf7ec
Make the exception more useful
peternewman Nov 26, 2022
315f071
Software version doesn't need escaping as it's just an int
peternewman Nov 26, 2022
de53080
Escape using our function. Add separate non-printable and non-ASCII t…
peternewman Nov 26, 2022
a405bb2
Fix a syntax issue
peternewman Nov 26, 2022
63a3105
Fix the flake8 issues
peternewman Nov 27, 2022
02af38e
Switch to some alternative test characters for the String PID test co…
peternewman Nov 27, 2022
c4ca6ca
Handle utf8 throughout the Python string class. Conversely it will no…
peternewman Nov 27, 2022
00a273d
Fix the UTF-8 related tests on both Python versions, also sort unpack
peternewman Nov 27, 2022
abf91a5
Fix our SetNonAsciiDeviceLabel test so it sends the expected bytes
peternewman Nov 27, 2022
1342f57
Catch, and test, for Unicode decode errors on incoming data
peternewman Nov 27, 2022
ecf842c
Add a basic null handling test
peternewman Nov 27, 2022
73d2f39
Sort the Python imports with isort
peternewman Nov 27, 2022
5ba1615
Switch to fully qualified imports for Python
peternewman Nov 27, 2022
9f50218
Keep GitHub Actions up to date with Dependabot
peternewman Nov 27, 2022
46476ee
Simplify the test discovery code now we've changed the imports and go…
peternewman Nov 27, 2022
d4cf464
Fix the licence for the new test
peternewman Nov 27, 2022
05a5945
Symlink more files required for the distcheck build
peternewman Nov 27, 2022
a95d4fa
Hopefully add the last hacky symlink
peternewman Nov 27, 2022
dfe877f
Simplify the ContainsUnprintable logic
peternewman Nov 27, 2022
b69d424
Fix a copyright year
peternewman Nov 27, 2022
84ffa62
Improve some comments and exception messages
peternewman Nov 27, 2022
85da44b
Simplify some of the RDM unit testing
peternewman Nov 27, 2022
1ca6d30
Remove some errant whitespace
peternewman Nov 27, 2022
eab7a44
Sort the imports as isort likes
peternewman Nov 27, 2022
d870219
Merge branch '0.10' of https://github.com/openlightingproject/ola int…
peternewman Dec 6, 2022
80e1aeb
Merge branch '0.10-c11-compat' of https://github.com/peternewman/ola …
peternewman Dec 6, 2022
45145ba
Comment out the SetNonAsciiDeviceLabel test for now as it breaks when…
peternewman Feb 14, 2023
a8bfb32
Merge branch '0.10' of https://github.com/openlightingproject/ola int…
peternewman Feb 14, 2023
40e8910
Merge branch '0.10' of https://github.com/openlightingproject/ola int…
peternewman Feb 25, 2023
c41589d
Revert "Remove some statements that won't be true until another PR ha…
peternewman Feb 25, 2023
7a55db7
Remove some duplicate codespell ignore lines
peternewman Feb 25, 2023
f917588
Ignore more codespell lines
peternewman Feb 25, 2023
f5be4e7
Fix a comment
peternewman Feb 25, 2023
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
8 changes: 2 additions & 6 deletions .codespellignorelines
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
/(?:([0-9]{1,3})(?:\s+THRU\s+([0-9]{0,3}))?)(?:\s+@\s+([0-9]{0,3}))?$/);
str = str.replace('>', 'THRU');
' THRU ' + ola.common.DmxConstants.MAX_CHANNEL_NUMBER);
' THRU ' + ola.common.DmxConstants.MAX_CHANNEL_NUMBER);
// If it's the T or > keys, autocomplete 'THRU'
case 'U': // THRU
var values = ['7', '8', '9', ' THRU ', '4', '5', '6', ' @ ', '1', '2', '3',
Expand Down Expand Up @@ -118,9 +117,6 @@ class AsyncronousLibUsbAdaptor : public BaseLibUsbAdaptor {
OLA_ASSERT_EQ(expected, JsonWriter::AsString(uint_value));
* Test the uint item
" \"type\": \"uint\",\n"
" \"type\": \"uint\",\n"
" \"type\": \"uint\",\n"
" \"type\": \"uint\",\n"
std::map<std::string, UIntMap*> m_uint_map_variables;
if (message.uint_offset < MAX_UINT_FIELDS) {
message.uint16_fields[message.uint_offset++] = field->Value();
Expand All @@ -131,10 +127,8 @@ class AsyncronousLibUsbAdaptor : public BaseLibUsbAdaptor {
status_message() : uint_offset(0), int_offset(0), status_type(0),
std::string Type() const { return "uint"; }
if (items[i]['type'] == 'uint') {
if (items[i]['type'] == 'uint') {
if (type == 'string' || type == 'uint' || type == 'hidden') {
const char RDMHTTPModule::GENERIC_UINT_FIELD[] = "int";
section.AddItem(new HiddenItem("1", GENERIC_UINT_FIELD));
section.AddItem(new HiddenItem("1", GENERIC_UINT_FIELD));
SelectItem *item = new SelectItem("Personality", GENERIC_UINT_FIELD);
string personality_str = request->GetParameter(GENERIC_UINT_FIELD);
Expand Down Expand Up @@ -198,4 +192,6 @@ import java.nio.ByteOrder;
"{'a': 'caf\\\\xe9'}")
# self.assertEqual('%s' % rtf._EscapeData({"caf\xe9": "bar"}),
# "{'caf\xe9': 'bar'}")
self.assertEqual('caf\\xe9', StringEscape(u'caf\xe9'))
self.assertEqual('caf\\xe9', ("%s" % StringEscape(u'caf\xe9')))
"forin": true,
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ python/ola/PidStoreTest.sh
python/ola/RDMTest.sh
python/ola/Version.py
python/ola/rpc/SimpleRpcControllerTest.sh
python/ola/testing/
python/ola/testing/__init__.py
slp/slp_client
slp/slp_client.exe
slp/slp_server
Expand Down Expand Up @@ -228,6 +230,7 @@ tools/rdm/DataLocation.py
tools/rdm/ExpectedResultsTest.sh
tools/rdm/ResponderTestTest.sh
tools/rdm/TestHelpersTest.sh
tools/rdm/TestRunnerTest.sh
tools/rdm/TestStateTest.sh
tools/rdmpro/rdmpro_sniffer
tools/rdmpro/rdmpro_sniffer.exe
Expand Down
4 changes: 3 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
x/y/2023 ola-0.10.9
Features:
* Further improvements on Python 3 compatibility #1506
* Python 3 compatibility across the board (including the RDM Responder Tests)!
#1506
* Support for the JMS USB2DMX PRO V2.1 device via the FTDI plugin #1728

API:
* Python: Add a fetch current DMX example.

RDM Tests:
* Python 3 compatibility of the RDM Tests #1599
* Fix a longstanding bug in the GetMaxPacketSize RDM test around timeouts

Bugs:
Expand Down
9 changes: 9 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -973,18 +973,27 @@ AM_CONDITIONAL([FOUND_CPPLINT], [test "x$cpplint" = xyes])
# srcdir and set PYTHONPATH=${top_builddir}/python in data/rdm/Makefile.am
AC_CONFIG_LINKS([python/ola/__init__.py:python/ola/__init__.py
python/ola/ClientWrapper.py:python/ola/ClientWrapper.py
python/ola/DMXConstants.py:python/ola/DMXConstants.py
python/ola/DUBDecoder.py:python/ola/DUBDecoder.py
python/ola/MACAddress.py:python/ola/MACAddress.py
python/ola/OlaClient.py:python/ola/OlaClient.py
python/ola/PidStore.py:python/ola/PidStore.py
python/ola/RDMAPI.py:python/ola/RDMAPI.py
python/ola/RDMConstants.py:python/ola/RDMConstants.py
python/ola/StringUtils.py:python/ola/StringUtils.py
python/ola/TestUtils.py:python/ola/TestUtils.py
python/ola/UID.py:python/ola/UID.py
python/ola/rpc/__init__.py:python/ola/rpc/__init__.py
python/ola/rpc/SimpleRpcController.py:python/ola/rpc/SimpleRpcController.py
python/ola/rpc/StreamRpcChannel.py:python/ola/rpc/StreamRpcChannel.py
tools/rdm/__init__.py:tools/rdm/__init__.py
tools/rdm/ExpectedResults.py:tools/rdm/ExpectedResults.py
tools/rdm/ResponderTest.py:tools/rdm/ResponderTest.py
tools/rdm/TestCategory.py:tools/rdm/TestCategory.py
tools/rdm/TestDefinitions.py:tools/rdm/TestDefinitions.py
tools/rdm/TestHelpers.py:tools/rdm/TestHelpers.py
tools/rdm/TestMixins.py:tools/rdm/TestMixins.py
tools/rdm/TestRunner.py:tools/rdm/TestRunner.py
tools/rdm/TestState.py:tools/rdm/TestState.py
tools/rdm/TimingStats.py:tools/rdm/TimingStats.py])

Expand Down
2 changes: 2 additions & 0 deletions python/ola/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ dist_check_SCRIPTS += \
python/ola/OlaClientTest.py \
python/ola/PidStoreTest.py \
python/ola/RDMTest.py \
python/ola/StringUtilsTest.py \
python/ola/TestUtils.py \
python/ola/UIDTest.py

Expand All @@ -96,6 +97,7 @@ test_scripts += \
python/ola/OlaClientTest.sh \
python/ola/PidStoreTest.sh \
python/ola/RDMTest.sh \
python/ola/StringUtilsTest.py \
python/ola/UIDTest.py
endif

Expand Down
24 changes: 16 additions & 8 deletions python/ola/PidStore.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
MAX_VALID_SUB_DEVICE = 0x0200
ALL_SUB_DEVICES = 0xffff

# The two types of commands classes
# The different types of commands classes
RDM_GET, RDM_SET, RDM_DISCOVERY = range(3)


Expand Down Expand Up @@ -637,6 +637,12 @@ def Pack(self, args):
arg = args[0]
arg_size = len(arg)

# Handle the fact a UTF-8 character could be multi-byte
if sys.version_info >= (3, 2):
arg_size = max(arg_size, len(bytes(arg, 'utf-8')))
else:
arg_size = max(arg_size, len(arg.encode('utf-8')))

if self.max is not None and arg_size > self.max:
raise ArgsValidationError('%s can be at most %d,' %
(self.name, self.max))
Expand All @@ -647,9 +653,9 @@ def Pack(self, args):

try:
if sys.version_info >= (3, 2):
data = struct.unpack('%ds' % arg_size, bytes(arg, 'utf8'))
data = struct.unpack('%ds' % arg_size, bytes(arg, 'utf-8'))
else:
data = struct.unpack('%ds' % arg_size, arg)
data = struct.unpack('%ds' % arg_size, arg.encode('utf-8'))
except struct.error as e:
raise ArgsValidationError("Can't pack data: %s" % e)
return data[0], 1
Expand All @@ -669,10 +675,12 @@ def Unpack(self, data):
except struct.error as e:
raise UnpackException(e)

if sys.version_info >= (3, 2):
return value[0].rstrip(b'\x00').decode('utf-8')
else:
return value[0].rstrip(b'\x00')
try:
value = value[0].rstrip(b'\x00').decode('utf-8')
except UnicodeDecodeError as e:
raise UnpackException(e)

return value

def GetDescription(self, indent=0):
indent = ' ' * indent
Expand Down Expand Up @@ -878,7 +886,7 @@ def Unpack(self, data):
'Too many repeated group_count for %s, limit is %d, found %d' %
(self.name, self.max, group_count))

if self.max is not None and group_count < self.min:
if self.min is not None and group_count < self.min:
raise UnpackException(
'Too few repeated group_count for %s, limit is %d, found %d' %
(self.name, self.min, group_count))
Expand Down
38 changes: 38 additions & 0 deletions python/ola/PidStoreTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,22 @@ def testPackUnpack(self):
self.assertEqual(decoded['slots_required'], 7)
self.assertEqual(decoded['name'], "UnpackTest")

# Test null handling, trailing null should be truncated on the way back in
args = ["42", "7", "Foo\0"]
blob = pid._responses.get(PidStore.RDM_GET).Pack(args)[0]
# Not truncated here
self.assertEqual(blob, binascii.unhexlify("2a0007466f6f00"))
decoded = pid.Unpack(blob, PidStore.RDM_GET)
self.assertEqual(decoded['personality'], 42)
self.assertEqual(decoded['slots_required'], 7)
self.assertEqual(decoded['name'], "Foo")

# Confirm we raise an error if we try and unpack a non-ASCII, non-UTF-8
# containing packet (0xc0)
with self.assertRaises(PidStore.UnpackException):
blob = binascii.unhexlify("2a0007556e7061636bc054657374")
decoded = pid.Unpack(blob, PidStore.RDM_GET)

def testPackRanges(self):
store = PidStore.PidStore()
store.Load([os.path.join(path, "test_pids.proto")])
Expand Down Expand Up @@ -279,6 +295,28 @@ def testPackRanges(self):
args = ["enx"]
blob = pid._responses.get(PidStore.RDM_GET).Pack(args)[0]

# test packing some non-printable characters
args = ["\x0d\x7f"]
blob = pid._responses.get(PidStore.RDM_GET).Pack(args)[0]
self.assertEqual(blob, binascii.unhexlify("0d7f"))
decoded = pid.Unpack(blob, PidStore.RDM_GET)
self.assertEqual(decoded, {'languages': [{'language': '\x0d\x7f'}]})

# test packing some non-ascii characters, as the
# LATIN CAPITAL LETTER A WITH GRAVE, unicode U+00C0 gets encoded as two
# bytes (\xc3\x80) the total length is three bytes and it doesn't fit!
with self.assertRaises(PidStore.ArgsValidationError):
args = [u"\x0d\xc0"]
blob = pid._responses.get(PidStore.RDM_GET).Pack(args)[0]

# It works on it's own as it's short enough...
args = [u"\u00c0"]
blob = pid._responses.get(PidStore.RDM_GET).Pack(args)[0]
self.assertEqual(blob, binascii.unhexlify("c380"))
decoded = pid.Unpack(blob, PidStore.RDM_GET)
# This is the unicode code point for it
self.assertEqual(decoded, {'languages': [{'language': u'\u00c0'}]})

# valid empty string
pid = store.GetName("STATUS_ID_DESCRIPTION")
args = [""]
Expand Down
45 changes: 45 additions & 0 deletions python/ola/StringUtils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
# StringUtils.py
# Copyright (C) 2022 Peter Newman

"""Common utils for OLA Python string handling"""

import sys

if sys.version_info >= (3, 0):
try:
unicode
except NameError:
unicode = str

__author__ = '[email protected] (Simon Newton)'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason to not using your name as the author? you got it in line 16 as well



def StringEscape(s):
"""Escape unprintable characters in a string."""
# TODO(Peter): How does this interact with the E1.20 Unicode flag?
# We don't use sys.version_info.major to support Python 2.6.
if sys.version_info[0] == 2 and type(s) == str:
return s.encode('string-escape')
elif sys.version_info[0] == 2 and type(s) == unicode:
return s.encode('unicode-escape')
elif type(s) == str:
# All strings in Python 3 are unicode
# This encode/decode pair gets us an escaped string
return s.encode('unicode-escape').decode(encoding="ascii",
errors="backslashreplace")
else:
raise TypeError('Only strings are supported not %s' % type(s))
57 changes: 57 additions & 0 deletions python/ola/StringUtilsTest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/usr/bin/env python
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
# StringUtilsTest.py
# Copyright (C) 2022 Peter Newman

import unittest

from ola.StringUtils import StringEscape

"""Test cases for StringUtils utilities."""

__author__ = '[email protected] (Simon Newton)'


class StringUtilsTest(unittest.TestCase):
def testStringEscape(self):
# Test we escape properly
self.assertEqual('foo', StringEscape("foo"))
self.assertEqual('bar', StringEscape("bar"))
self.assertEqual('bar[]', StringEscape("bar[]"))
self.assertEqual('foo-bar', StringEscape(u'foo-bar'))
self.assertEqual('foo\\x00bar', StringEscape("foo\x00bar"))
# TODO(Peter): How does this interact with the E1.20 Unicode flag?
self.assertEqual('caf\\xe9', StringEscape(u'caf\xe9'))
self.assertEqual('foo\\u2014bar', StringEscape(u'foo\u2014bar'))

# Test that we display nicely in a string
self.assertEqual('foo', ("%s" % StringEscape("foo")))
self.assertEqual('bar[]', ("%s" % StringEscape("bar[]")))
self.assertEqual('foo-bar', ("%s" % StringEscape(u'foo-bar')))
self.assertEqual('foo\\x00bar', ("%s" % StringEscape("foo\x00bar")))
# TODO(Peter): How does this interact with the E1.20 Unicode flag?
self.assertEqual('caf\\xe9', ("%s" % StringEscape(u'caf\xe9')))
self.assertEqual('foo\\u2014bar', ("%s" % StringEscape(u'foo\u2014bar')))

# Confirm we throw an exception if we pass in a number or something else
# that's not a string
with self.assertRaises(TypeError):
result = StringEscape(42)
self.assertNone(result)


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions tools/rdm/ExpectedResultsTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import unittest
from collections import namedtuple

# Keep this import relative to simplify the testing
from ExpectedResults import (BroadcastResult, DUBResult, InvalidResponse,
SuccessfulResult, TimeoutResult,
UnsupportedResult)
Expand Down
19 changes: 18 additions & 1 deletion tools/rdm/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ tools/rdm/ExpectedResultsTest.sh: tools/rdm/Makefile.mk
chmod +x $(top_builddir)/tools/rdm/ExpectedResultsTest.sh

tools/rdm/ResponderTestTest.sh: tools/rdm/Makefile.mk
mkdir -p $(top_builddir)/python/ola
mkdir -p $(top_builddir)/python/ola/testing
touch $(top_builddir)/python/ola/testing/__init__.py
# This link is relative within the builddir
$(LN_S) -f ../../../tools/rdm $(top_builddir)/python/ola/testing/rdm
echo "PYTHONPATH=${top_builddir}/python $(PYTHON) ${srcdir}/tools/rdm/ResponderTestTest.py; exit \$$?" > $(top_builddir)/tools/rdm/ResponderTestTest.sh
chmod +x $(top_builddir)/tools/rdm/ResponderTestTest.sh

Expand All @@ -70,6 +73,14 @@ tools/rdm/TestHelpersTest.sh: tools/rdm/Makefile.mk
echo "PYTHONPATH=${top_builddir}/python $(PYTHON) ${srcdir}/tools/rdm/TestHelpersTest.py; exit \$$?" > $(top_builddir)/tools/rdm/TestHelpersTest.sh
chmod +x $(top_builddir)/tools/rdm/TestHelpersTest.sh

tools/rdm/TestRunnerTest.sh: tools/rdm/Makefile.mk
mkdir -p $(top_builddir)/python/ola/testing
touch $(top_builddir)/python/ola/testing/__init__.py
# This link is relative within the builddir
$(LN_S) -f ../../../tools/rdm $(top_builddir)/python/ola/testing/rdm
echo "PYTHONPATH=${top_builddir}/python $(PYTHON) ${srcdir}/tools/rdm/TestRunnerTest.py; exit \$$?" > $(top_builddir)/tools/rdm/TestRunnerTest.sh
chmod +x $(top_builddir)/tools/rdm/TestRunnerTest.sh

tools/rdm/TestStateTest.sh: tools/rdm/Makefile.mk
mkdir -p $(top_builddir)/python/ola
echo "PYTHONPATH=${top_builddir}/python $(PYTHON) ${srcdir}/tools/rdm/TestStateTest.py; exit \$$?" > $(top_builddir)/tools/rdm/TestStateTest.sh
Expand All @@ -79,21 +90,27 @@ dist_check_SCRIPTS += \
tools/rdm/ExpectedResultsTest.py \
tools/rdm/ResponderTestTest.py \
tools/rdm/TestHelpersTest.py \
tools/rdm/TestRunnerTest.py \
tools/rdm/TestStateTest.py

if BUILD_PYTHON_LIBS
test_scripts += \
tools/rdm/ExpectedResultsTest.sh \
tools/rdm/ResponderTestTest.sh \
tools/rdm/TestHelpersTest.sh \
tools/rdm/TestRunnerTest.sh \
tools/rdm/TestStateTest.sh
endif

CLEANFILES += \
python/ola/testing/*.pyc \
python/ola/testing/__pycache__/* \
python/ola/testing/__init__.py \
tools/rdm/*.pyc \
tools/rdm/ExpectedResultsTest.sh \
tools/rdm/ResponderTestTest.sh \
tools/rdm/TestHelpersTest.sh \
tools/rdm/TestRunnerTest.sh \
tools/rdm/TestStateTest.sh \
tools/rdm/__pycache__/*

Expand Down
Loading