added tests
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
# CMAKE generated file: DO NOT EDIT!
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.9
|
||||
|
||||
# Relative path conversion top directories.
|
||||
set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/johannes/git/flippr-code/FlippR-Driver")
|
||||
set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/johannes/git/flippr-code/FlippR-Driver")
|
||||
|
||||
# Force unix paths in dependencies.
|
||||
set(CMAKE_FORCE_UNIX_PATHS 1)
|
||||
|
||||
|
||||
# The C and CXX include file regular expressions for this directory.
|
||||
set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$")
|
||||
set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$")
|
||||
set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})
|
||||
set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})
|
||||
1
FlippR-Driver/src/input/CMakeFiles/progress.marks
Normal file
1
FlippR-Driver/src/input/CMakeFiles/progress.marks
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -14,10 +14,10 @@
|
||||
|
||||
using namespace Input;
|
||||
|
||||
Detector::Detector(InputGPIOInterface* input_gpio_interface, std::map<char, Event> events, IEventNotifier* event_notifier) :
|
||||
Detector::Detector(IInputGPIOInterface* input_gpio_interface, std::map<char, Event> events, IEventNotifier* event_notifier) :
|
||||
input_gpio_interface(input_gpio_interface), events(events), is_running(true), event_notifier(event_notifier)
|
||||
{
|
||||
detect_thread = std::thread(&Detector::detect, this);
|
||||
this->detect_thread = std::thread(&Detector::detect, this);
|
||||
|
||||
CLOG(WARNING, INPUT_LOGGER) << "Created Detector";
|
||||
}
|
||||
@@ -41,7 +41,7 @@ void Detector::detect()
|
||||
while(is_running)
|
||||
{
|
||||
char address;
|
||||
if(check_inputs(address))
|
||||
if(this->check_inputs(address))
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -58,7 +58,7 @@ void Detector::detect()
|
||||
|
||||
bool Detector::check_inputs(char& address)
|
||||
{
|
||||
for(int pin = 0; pin < (INPUT_MATRIX_SIZE * INPUT_MATRIX_SIZE); pin++)
|
||||
for(char pin = 0; pin < (INPUT_MATRIX_SIZE * INPUT_MATRIX_SIZE); pin++)
|
||||
{
|
||||
if(input_gpio_interface->read_input_data(pin))
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <thread>
|
||||
#include <map>
|
||||
|
||||
#include "../utilities/InputGPIOInterface.h"
|
||||
#include "../utilities/IInputGPIOInterface.h"
|
||||
#include "Event.h"
|
||||
#include "IEventNotifier.h"
|
||||
|
||||
@@ -30,7 +30,7 @@ class Detector : public IDetector
|
||||
{
|
||||
|
||||
public:
|
||||
Detector(InputGPIOInterface* input_gpio_interface, std::map<char, Event> events, IEventNotifier* event_notifier);
|
||||
Detector(IInputGPIOInterface* input_gpio_interface, std::map<char, Event> events, IEventNotifier* event_notifier);
|
||||
~Detector();
|
||||
|
||||
private:
|
||||
@@ -38,7 +38,7 @@ private:
|
||||
bool check_inputs(char& address);
|
||||
|
||||
private:
|
||||
InputGPIOInterface* input_gpio_interface;
|
||||
IInputGPIOInterface* input_gpio_interface;
|
||||
|
||||
std::map<char, Event> events;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
using namespace Input;
|
||||
|
||||
Event::Event(char address, char priority, std::string name) :
|
||||
Event::Event(char address, int priority, std::string name) :
|
||||
address(address), priority(priority), name(name)
|
||||
{
|
||||
CLOG_IF(VLOG_IS_ON(HIGH_VERBOSITY), INFO, INPUT_LOGGER) << "Created event: " << name << ", address: " << address;
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Input
|
||||
class Event
|
||||
{
|
||||
public:
|
||||
Event(char address, char priority, std::string name);
|
||||
Event(char address, int priority, std::string name);
|
||||
bool operator==(const Event& other);
|
||||
friend bool operator<(const Event& left, const Event& right)
|
||||
{
|
||||
@@ -30,7 +30,7 @@ private:
|
||||
char address;
|
||||
|
||||
public:
|
||||
char priority;
|
||||
int priority;
|
||||
std::string name;
|
||||
|
||||
|
||||
|
||||
134
FlippR-Driver/src/input/Makefile
Normal file
134
FlippR-Driver/src/input/Makefile
Normal file
@@ -0,0 +1,134 @@
|
||||
# CMAKE generated file: DO NOT EDIT!
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.9
|
||||
|
||||
# Default target executed when no arguments are given to make.
|
||||
default_target: all
|
||||
|
||||
.PHONY : default_target
|
||||
|
||||
# Allow only one "make -f Makefile2" at a time, but pass parallelism.
|
||||
.NOTPARALLEL:
|
||||
|
||||
|
||||
#=============================================================================
|
||||
# Special targets provided by cmake.
|
||||
|
||||
# Disable implicit rules so canonical targets will work.
|
||||
.SUFFIXES:
|
||||
|
||||
|
||||
# Remove some rules from gmake that .SUFFIXES does not remove.
|
||||
SUFFIXES =
|
||||
|
||||
.SUFFIXES: .hpux_make_needs_suffix_list
|
||||
|
||||
|
||||
# Suppress display of executed commands.
|
||||
$(VERBOSE).SILENT:
|
||||
|
||||
|
||||
# A target that is always out of date.
|
||||
cmake_force:
|
||||
|
||||
.PHONY : cmake_force
|
||||
|
||||
#=============================================================================
|
||||
# Set environment variables for the build.
|
||||
|
||||
# The shell in which to execute make rules.
|
||||
SHELL = /bin/sh
|
||||
|
||||
# The CMake executable.
|
||||
CMAKE_COMMAND = /usr/bin/cmake
|
||||
|
||||
# The command to remove a file.
|
||||
RM = /usr/bin/cmake -E remove -f
|
||||
|
||||
# Escaping for special characters.
|
||||
EQUALS = =
|
||||
|
||||
# The top-level source directory on which CMake was run.
|
||||
CMAKE_SOURCE_DIR = /home/johannes/git/flippr-code/FlippR-Driver
|
||||
|
||||
# The top-level build directory on which CMake was run.
|
||||
CMAKE_BINARY_DIR = /home/johannes/git/flippr-code/FlippR-Driver
|
||||
|
||||
#=============================================================================
|
||||
# Targets provided globally by CMake.
|
||||
|
||||
# Special rule for the target rebuild_cache
|
||||
rebuild_cache:
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
|
||||
/usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
|
||||
.PHONY : rebuild_cache
|
||||
|
||||
# Special rule for the target rebuild_cache
|
||||
rebuild_cache/fast: rebuild_cache
|
||||
|
||||
.PHONY : rebuild_cache/fast
|
||||
|
||||
# Special rule for the target edit_cache
|
||||
edit_cache:
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..."
|
||||
/usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available.
|
||||
.PHONY : edit_cache
|
||||
|
||||
# Special rule for the target edit_cache
|
||||
edit_cache/fast: edit_cache
|
||||
|
||||
.PHONY : edit_cache/fast
|
||||
|
||||
# The main all target
|
||||
all: cmake_check_build_system
|
||||
cd /home/johannes/git/flippr-code/FlippR-Driver && $(CMAKE_COMMAND) -E cmake_progress_start /home/johannes/git/flippr-code/FlippR-Driver/CMakeFiles /home/johannes/git/flippr-code/FlippR-Driver/src/input/CMakeFiles/progress.marks
|
||||
cd /home/johannes/git/flippr-code/FlippR-Driver && $(MAKE) -f CMakeFiles/Makefile2 src/input/all
|
||||
$(CMAKE_COMMAND) -E cmake_progress_start /home/johannes/git/flippr-code/FlippR-Driver/CMakeFiles 0
|
||||
.PHONY : all
|
||||
|
||||
# The main clean target
|
||||
clean:
|
||||
cd /home/johannes/git/flippr-code/FlippR-Driver && $(MAKE) -f CMakeFiles/Makefile2 src/input/clean
|
||||
.PHONY : clean
|
||||
|
||||
# The main clean target
|
||||
clean/fast: clean
|
||||
|
||||
.PHONY : clean/fast
|
||||
|
||||
# Prepare targets for installation.
|
||||
preinstall: all
|
||||
cd /home/johannes/git/flippr-code/FlippR-Driver && $(MAKE) -f CMakeFiles/Makefile2 src/input/preinstall
|
||||
.PHONY : preinstall
|
||||
|
||||
# Prepare targets for installation.
|
||||
preinstall/fast:
|
||||
cd /home/johannes/git/flippr-code/FlippR-Driver && $(MAKE) -f CMakeFiles/Makefile2 src/input/preinstall
|
||||
.PHONY : preinstall/fast
|
||||
|
||||
# clear depends
|
||||
depend:
|
||||
cd /home/johannes/git/flippr-code/FlippR-Driver && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
|
||||
.PHONY : depend
|
||||
|
||||
# Help Target
|
||||
help:
|
||||
@echo "The following are some of the valid targets for this Makefile:"
|
||||
@echo "... all (the default if no target is provided)"
|
||||
@echo "... clean"
|
||||
@echo "... depend"
|
||||
@echo "... rebuild_cache"
|
||||
@echo "... edit_cache"
|
||||
.PHONY : help
|
||||
|
||||
|
||||
|
||||
#=============================================================================
|
||||
# Special targets to cleanup operation of make.
|
||||
|
||||
# Special rule to run CMake to check the build system integrity.
|
||||
# No rule that depends on this can have commands that come from listfiles
|
||||
# because they might be regenerated.
|
||||
cmake_check_build_system:
|
||||
cd /home/johannes/git/flippr-code/FlippR-Driver && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
|
||||
.PHONY : cmake_check_build_system
|
||||
|
||||
34
FlippR-Driver/src/input/cmake_install.cmake
Normal file
34
FlippR-Driver/src/input/cmake_install.cmake
Normal file
@@ -0,0 +1,34 @@
|
||||
# Install script for directory: /home/johannes/git/flippr-code/FlippR-Driver/src/input
|
||||
|
||||
# Set the install prefix
|
||||
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||
set(CMAKE_INSTALL_PREFIX "/usr/local")
|
||||
endif()
|
||||
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
# Set the install configuration name.
|
||||
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
|
||||
if(BUILD_TYPE)
|
||||
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
|
||||
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
|
||||
else()
|
||||
set(CMAKE_INSTALL_CONFIG_NAME "")
|
||||
endif()
|
||||
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
|
||||
endif()
|
||||
|
||||
# Set the component getting installed.
|
||||
if(NOT CMAKE_INSTALL_COMPONENT)
|
||||
if(COMPONENT)
|
||||
message(STATUS "Install component: \"${COMPONENT}\"")
|
||||
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
|
||||
else()
|
||||
set(CMAKE_INSTALL_COMPONENT)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Install shared libraries without execute permission?
|
||||
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
|
||||
set(CMAKE_INSTALL_SO_NO_EXE "1")
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user