Skip to content

Commit

Permalink
Add first niclk unit test (#1031)
Browse files Browse the repository at this point in the history
* Add initial metadata

* Create nitclk.mak

* Remove numpy restriction

Bug fixed

* Upgrade pip

* Remove specific version of flake8

'\' in comments now need to be escaped

* Add basepython section

* Try using pypy3.5

* Go back to pypy3 and remove basepython block

* Don't need to run build_test for all builds - only 3.6

* Remove warning from coverage

* Undo previous change

* Try disabling faulthandler

* Remove --no-faulthandler

* pypy needs an older version of pytest

See pytest-dev/pytest#5807

* Use platform_python_implementation since implementation_name is not defined on Python2

* Try to get back to the initial coverage

* Do the same thing for build_test

* Remove redundant pip

* Add codecov file to try to control limits for passing

* Enable nitclk build

* There are some files we will need to skip for now

* Add generated nitclk files

* Update generated files

* Can't skip README.rst

* Update templates

* Add new cases for buffers with a converter

* Need to handle ' []' to normalize everything

* Get the session handle name from config instead of hardcoding 'vi'

* Temp commit

* Fix syntax error

* Test new cases

* Force change

* Update generated files

* Update generated files

* Add different target for pr (project) and commit (patch)

* threshold should be number

* Renumber scaler cases to be in order used in the code

* Update generated files

* Renumber buffer cases to match order used in code

* Move and rename test to match case (C020)

* Update generated files

* Add nitclk specific session template

* No longer need to skip generating session.py

* Add new session.py

* Add placeholder nitclk example

* Enable example documentation build

* Add generated examples.rst

* Add VIUInt32 matcher

* Add ViSession buffer matcher

* We want to look at all of nitclk since there are differences in some of the generarted files

* Run unit tests on nitclk

* Add initial test and setup

* Update generated files

* Correct wrong exception

* Rename test

* Add return (helps editor auto formatting)

* Update generated files

* TClk doesn't have a close function so we need to allow for that

* Spell out number

* Update generated files

* Lower the target even more
  • Loading branch information
texasaggie97-zz authored and marcoskirsch committed Sep 20, 2019
1 parent 0528006 commit 9788218
Show file tree
Hide file tree
Showing 30 changed files with 219 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ coverage:
threshhold: 5
patch:
default:
target: 35%
target: 20%
threshhold: 5


4 changes: 2 additions & 2 deletions build/templates/_converters.py.mako
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,12 @@ def convert_to_nitclk_session_number(item):
'''
try:
return item.tclk._get_session_number()
except KeyError:
except AttributeError:
pass

try:
return item._get_session_number()
except KeyError:
except AttributeError:
pass

# If we haven't gotten a SessionReference, we assume the item is the actual nitclk session num and return it
Expand Down
10 changes: 10 additions & 0 deletions build/templates/_matchers.py.mako
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ class ViInt32Matcher(_ScalarMatcher):
_ScalarMatcher.__init__(self, _visatype.ViInt32, expected_value)


class ViUInt32Matcher(_ScalarMatcher):
def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViUInt32, expected_value)


class ViAttrMatcher(_ScalarMatcher):
def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViAttr, expected_value)
Expand Down Expand Up @@ -299,4 +304,9 @@ class ViReal64BufferMatcher(_BufferMatcher):
_BufferMatcher.__init__(self, _visatype.ViReal64, expected_size_or_value)


class ViSessionBufferMatcher(_BufferMatcher):
def __init__(self, expected_size_or_value):
_BufferMatcher.__init__(self, _visatype.ViSession, expected_size_or_value)



4 changes: 2 additions & 2 deletions generated/nidcpower/_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,12 @@ def convert_to_nitclk_session_number(item):
'''
try:
return item.tclk._get_session_number()
except KeyError:
except AttributeError:
pass

try:
return item._get_session_number()
except KeyError:
except AttributeError:
pass

# If we haven't gotten a SessionReference, we assume the item is the actual nitclk session num and return it
Expand Down
10 changes: 10 additions & 0 deletions generated/nidcpower/unit_tests/_matchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViInt32, expected_value)


class ViUInt32Matcher(_ScalarMatcher):
def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViUInt32, expected_value)


class ViAttrMatcher(_ScalarMatcher):
def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViAttr, expected_value)
Expand Down Expand Up @@ -299,4 +304,9 @@ def __init__(self, expected_size_or_value):
_BufferMatcher.__init__(self, _visatype.ViReal64, expected_size_or_value)


class ViSessionBufferMatcher(_BufferMatcher):
def __init__(self, expected_size_or_value):
_BufferMatcher.__init__(self, _visatype.ViSession, expected_size_or_value)



4 changes: 2 additions & 2 deletions generated/nidigital/_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,12 @@ def convert_to_nitclk_session_number(item):
'''
try:
return item.tclk._get_session_number()
except KeyError:
except AttributeError:
pass

try:
return item._get_session_number()
except KeyError:
except AttributeError:
pass

# If we haven't gotten a SessionReference, we assume the item is the actual nitclk session num and return it
Expand Down
10 changes: 10 additions & 0 deletions generated/nidigital/unit_tests/_matchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViInt32, expected_value)


class ViUInt32Matcher(_ScalarMatcher):
def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViUInt32, expected_value)


class ViAttrMatcher(_ScalarMatcher):
def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViAttr, expected_value)
Expand Down Expand Up @@ -299,4 +304,9 @@ def __init__(self, expected_size_or_value):
_BufferMatcher.__init__(self, _visatype.ViReal64, expected_size_or_value)


class ViSessionBufferMatcher(_BufferMatcher):
def __init__(self, expected_size_or_value):
_BufferMatcher.__init__(self, _visatype.ViSession, expected_size_or_value)



4 changes: 2 additions & 2 deletions generated/nidmm/_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,12 @@ def convert_to_nitclk_session_number(item):
'''
try:
return item.tclk._get_session_number()
except KeyError:
except AttributeError:
pass

try:
return item._get_session_number()
except KeyError:
except AttributeError:
pass

# If we haven't gotten a SessionReference, we assume the item is the actual nitclk session num and return it
Expand Down
10 changes: 10 additions & 0 deletions generated/nidmm/unit_tests/_matchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViInt32, expected_value)


class ViUInt32Matcher(_ScalarMatcher):
def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViUInt32, expected_value)


class ViAttrMatcher(_ScalarMatcher):
def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViAttr, expected_value)
Expand Down Expand Up @@ -299,4 +304,9 @@ def __init__(self, expected_size_or_value):
_BufferMatcher.__init__(self, _visatype.ViReal64, expected_size_or_value)


class ViSessionBufferMatcher(_BufferMatcher):
def __init__(self, expected_size_or_value):
_BufferMatcher.__init__(self, _visatype.ViSession, expected_size_or_value)



4 changes: 2 additions & 2 deletions generated/nifake/_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,12 @@ def convert_to_nitclk_session_number(item):
'''
try:
return item.tclk._get_session_number()
except KeyError:
except AttributeError:
pass

try:
return item._get_session_number()
except KeyError:
except AttributeError:
pass

# If we haven't gotten a SessionReference, we assume the item is the actual nitclk session num and return it
Expand Down
10 changes: 10 additions & 0 deletions generated/nifake/unit_tests/_matchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViInt32, expected_value)


class ViUInt32Matcher(_ScalarMatcher):
def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViUInt32, expected_value)


class ViAttrMatcher(_ScalarMatcher):
def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViAttr, expected_value)
Expand Down Expand Up @@ -299,4 +304,9 @@ def __init__(self, expected_size_or_value):
_BufferMatcher.__init__(self, _visatype.ViReal64, expected_size_or_value)


class ViSessionBufferMatcher(_BufferMatcher):
def __init__(self, expected_size_or_value):
_BufferMatcher.__init__(self, _visatype.ViSession, expected_size_or_value)



4 changes: 2 additions & 2 deletions generated/nifgen/_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,12 @@ def convert_to_nitclk_session_number(item):
'''
try:
return item.tclk._get_session_number()
except KeyError:
except AttributeError:
pass

try:
return item._get_session_number()
except KeyError:
except AttributeError:
pass

# If we haven't gotten a SessionReference, we assume the item is the actual nitclk session num and return it
Expand Down
10 changes: 10 additions & 0 deletions generated/nifgen/unit_tests/_matchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViInt32, expected_value)


class ViUInt32Matcher(_ScalarMatcher):
def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViUInt32, expected_value)


class ViAttrMatcher(_ScalarMatcher):
def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViAttr, expected_value)
Expand Down Expand Up @@ -299,4 +304,9 @@ def __init__(self, expected_size_or_value):
_BufferMatcher.__init__(self, _visatype.ViReal64, expected_size_or_value)


class ViSessionBufferMatcher(_BufferMatcher):
def __init__(self, expected_size_or_value):
_BufferMatcher.__init__(self, _visatype.ViSession, expected_size_or_value)



4 changes: 2 additions & 2 deletions generated/nimodinst/_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,12 @@ def convert_to_nitclk_session_number(item):
'''
try:
return item.tclk._get_session_number()
except KeyError:
except AttributeError:
pass

try:
return item._get_session_number()
except KeyError:
except AttributeError:
pass

# If we haven't gotten a SessionReference, we assume the item is the actual nitclk session num and return it
Expand Down
10 changes: 10 additions & 0 deletions generated/nimodinst/unit_tests/_matchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViInt32, expected_value)


class ViUInt32Matcher(_ScalarMatcher):
def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViUInt32, expected_value)


class ViAttrMatcher(_ScalarMatcher):
def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViAttr, expected_value)
Expand Down Expand Up @@ -299,4 +304,9 @@ def __init__(self, expected_size_or_value):
_BufferMatcher.__init__(self, _visatype.ViReal64, expected_size_or_value)


class ViSessionBufferMatcher(_BufferMatcher):
def __init__(self, expected_size_or_value):
_BufferMatcher.__init__(self, _visatype.ViSession, expected_size_or_value)



4 changes: 2 additions & 2 deletions generated/niscope/_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,12 @@ def convert_to_nitclk_session_number(item):
'''
try:
return item.tclk._get_session_number()
except KeyError:
except AttributeError:
pass

try:
return item._get_session_number()
except KeyError:
except AttributeError:
pass

# If we haven't gotten a SessionReference, we assume the item is the actual nitclk session num and return it
Expand Down
10 changes: 10 additions & 0 deletions generated/niscope/unit_tests/_matchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViInt32, expected_value)


class ViUInt32Matcher(_ScalarMatcher):
def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViUInt32, expected_value)


class ViAttrMatcher(_ScalarMatcher):
def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViAttr, expected_value)
Expand Down Expand Up @@ -299,4 +304,9 @@ def __init__(self, expected_size_or_value):
_BufferMatcher.__init__(self, _visatype.ViReal64, expected_size_or_value)


class ViSessionBufferMatcher(_BufferMatcher):
def __init__(self, expected_size_or_value):
_BufferMatcher.__init__(self, _visatype.ViSession, expected_size_or_value)



4 changes: 2 additions & 2 deletions generated/nise/_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,12 @@ def convert_to_nitclk_session_number(item):
'''
try:
return item.tclk._get_session_number()
except KeyError:
except AttributeError:
pass

try:
return item._get_session_number()
except KeyError:
except AttributeError:
pass

# If we haven't gotten a SessionReference, we assume the item is the actual nitclk session num and return it
Expand Down
10 changes: 10 additions & 0 deletions generated/nise/unit_tests/_matchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViInt32, expected_value)


class ViUInt32Matcher(_ScalarMatcher):
def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViUInt32, expected_value)


class ViAttrMatcher(_ScalarMatcher):
def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViAttr, expected_value)
Expand Down Expand Up @@ -299,4 +304,9 @@ def __init__(self, expected_size_or_value):
_BufferMatcher.__init__(self, _visatype.ViReal64, expected_size_or_value)


class ViSessionBufferMatcher(_BufferMatcher):
def __init__(self, expected_size_or_value):
_BufferMatcher.__init__(self, _visatype.ViSession, expected_size_or_value)



4 changes: 2 additions & 2 deletions generated/niswitch/_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,12 @@ def convert_to_nitclk_session_number(item):
'''
try:
return item.tclk._get_session_number()
except KeyError:
except AttributeError:
pass

try:
return item._get_session_number()
except KeyError:
except AttributeError:
pass

# If we haven't gotten a SessionReference, we assume the item is the actual nitclk session num and return it
Expand Down
10 changes: 10 additions & 0 deletions generated/niswitch/unit_tests/_matchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViInt32, expected_value)


class ViUInt32Matcher(_ScalarMatcher):
def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViUInt32, expected_value)


class ViAttrMatcher(_ScalarMatcher):
def __init__(self, expected_value):
_ScalarMatcher.__init__(self, _visatype.ViAttr, expected_value)
Expand Down Expand Up @@ -299,4 +304,9 @@ def __init__(self, expected_size_or_value):
_BufferMatcher.__init__(self, _visatype.ViReal64, expected_size_or_value)


class ViSessionBufferMatcher(_BufferMatcher):
def __init__(self, expected_size_or_value):
_BufferMatcher.__init__(self, _visatype.ViSession, expected_size_or_value)



4 changes: 2 additions & 2 deletions generated/nitclk/_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,12 @@ def convert_to_nitclk_session_number(item):
'''
try:
return item.tclk._get_session_number()
except KeyError:
except AttributeError:
pass

try:
return item._get_session_number()
except KeyError:
except AttributeError:
pass

# If we haven't gotten a SessionReference, we assume the item is the actual nitclk session num and return it
Expand Down

0 comments on commit 9788218

Please sign in to comment.