# along with this file. If not, see <http://www.gnu.org/licenses/>. ### Imports ### import builtins import copy import os import sys from ctypes import POINTER, cast, c_char_p, c_uint8, c_uint16, Structure import kiilogger ### Logger ### logger = kiilogger.get_logger('Output/TestOut/host.py') ### Variables ### data = builtins.kiibohd_data debug = False control = builtins.kiibohd_control ### Structs ### class HIDIO_Packet(Structure): ''' HIDIO_Packet struct See hidio_com.h in Output/HID-IO '''
import inspect import json import linecache import logging import sys from collections import namedtuple import kiilogger ### Logger ### logger = kiilogger.get_logger('Tests/common.py') ### Classes ### class KLLTestRunner: ''' Runs KLLTest classes Given a list of test classes objects, run the tests and query the result. ''' def __init__(self, tests): ''' Initialize KLLTestRunner objects
from common import ( check, fail_tests, pass_tests, result, KLLTest, KLLTestUnitResult, KLLTestRunner, TriggerResultEval, ) ### Setup ### # Logger (current file and parent directory only) logger = kiilogger.get_logger( os.path.join(os.path.split(__file__)[0], os.path.basename(__file__))) # Reference to callback datastructure data = i.control.data # Reference to KLL generated json klljson = i.jsonInput class SimpleLayerTest(KLLTest): ''' Simple layer test For each layer, individually test each trigger, validating the capability and the output. This test is looking for evaluation correctness.
c_uint32, c_void_p, cast, create_string_buffer, CFUNCTYPE, POINTER, Structure, ) import kiilogger ### Logger ### logger = kiilogger.get_logger('Scan/TestIn/host.py') ### Variables ### data = builtins.kiibohd_data debug = False control = builtins.kiibohd_control ### Enums ### class ScheduleState: '''
### Imports ### import logging import os import interface as i import kiilogger from common import (check, result, header) ### Setup ### # Logger (current file and parent directory only) logger = kiilogger.get_logger(os.path.join(os.path.split(__file__)[0], os.path.basename(__file__))) logging.root.setLevel(logging.INFO) # Reference to callback datastructure data = i.control.data ### Test ### # Drop to cli, type exit in the displayed terminal to continue #i.control.cli() logger.info(header("-Pixel Test-"))
# # You should have received a copy of the GNU General Public License # along with this file. If not, see <http://www.gnu.org/licenses/>. ### Imports ### import sys from ctypes import (Structure, POINTER, cast, c_uint32, c_uint16, c_uint8, c_void_p, create_string_buffer) import kiilogger ### Logger ### logger = kiilogger.get_logger('Scan/TestIn/host.py') ### Variables ### data = None debug = False control = None ### Structures ### class TriggerMacro(Structure): ''' C-Struct for TriggerMacro See Macro/PartialMap/kll.h '''
c_uint32, c_void_p, cast, CDLL, CFUNCTYPE, POINTER, Structure, ) import kiilogger ### Logger ### logger = kiilogger.get_logger('Lib/host.py') ### Decorators ### ## Python Text Formatting Fixer... ## Because the creators of Python are averse to proper capitalization. textFormatter_lookup = { "usage: " : "Usage: ", "optional arguments" : "Optional Arguments", } def textFormatter_gettext( s ): return textFormatter_lookup.get( s, s )
### Imports ### import builtins import copy import os import sys from ctypes import POINTER, cast, c_char_p, c_int8, c_int16, c_uint8, c_uint16, Structure import kiilogger ### Logger ### logger = kiilogger.get_logger('Output/TestOut/host.py') ### Variables ### data = builtins.kiibohd_data debug = False control = builtins.kiibohd_control ### Structs ### class HIDIO_Packet( Structure ): '''
c_uint8, c_uint16, c_uint32, c_void_p, cast, CDLL, CFUNCTYPE, POINTER, Structure, ) import kiilogger ### Logger ### logger = kiilogger.get_logger('Lib/host.py') ### Decorators ### ## Python Text Formatting Fixer... ## Because the creators of Python are averse to proper capitalization. textFormatter_lookup = { "usage: ": "Usage: ", "optional arguments": "Optional Arguments", } def textFormatter_gettext(s): return textFormatter_lookup.get(s, s)