From b164bb2ee948cadfd95b23efe8db2eb3613bca22 Mon Sep 17 00:00:00 2001 From: Jonas Zeunert Date: Tue, 10 Jul 2018 22:02:26 +0200 Subject: [PATCH] looking into old commit --- FlippR-Driver/.bash_aliases | 10 - FlippR-Driver/.bash_functions | 79 --- FlippR-Driver/.cproject | 609 +++++++++++++++--- FlippR-Driver/.project | 197 +++++- FlippR-Driver/.settings/language.settings.xml | 28 - .../org.eclipse.cdt.codan.core.prefs | 71 -- .../org.eclipse.cdt.managedbuilder.core.prefs | 13 - FlippR-Driver/CMakeLists.txt | 11 +- FlippR-Driver/tests/CMakeLists.txt | 25 + FlippR-Driver/tests/input/TestDetector.cpp | 10 +- .../tests/input/TestEventNotifier.cpp | 10 +- FlippR-Driver/tests/input/TestInputDriver.cpp | 12 +- FlippR-Driver/tests/input/main.cpp | 2 +- 13 files changed, 760 insertions(+), 317 deletions(-) delete mode 100644 FlippR-Driver/.bash_aliases delete mode 100644 FlippR-Driver/.bash_functions delete mode 100644 FlippR-Driver/.settings/language.settings.xml delete mode 100644 FlippR-Driver/.settings/org.eclipse.cdt.codan.core.prefs delete mode 100644 FlippR-Driver/.settings/org.eclipse.cdt.managedbuilder.core.prefs diff --git a/FlippR-Driver/.bash_aliases b/FlippR-Driver/.bash_aliases deleted file mode 100644 index fa40af8..0000000 --- a/FlippR-Driver/.bash_aliases +++ /dev/null @@ -1,10 +0,0 @@ -alias ll='ls -alF' -alias la='ls -A' -alias l='ls -lA' -alias cat='cat -n' -alias ncat='cat' -alias mkdir='mkdir -p' -alias pdfmerge='gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOUTPUTFILE=' -alias sync_bash_rc='sync_bash .bashrc_ssh' -alias sync_bash_aliases='sync_bash .bash_aliases' -alias sync_bash_functions='sync_bash .bash_functions' diff --git a/FlippR-Driver/.bash_functions b/FlippR-Driver/.bash_functions deleted file mode 100644 index d5b30e0..0000000 --- a/FlippR-Driver/.bash_functions +++ /dev/null @@ -1,79 +0,0 @@ -function up { -[ "${1/[^0-9]/}" == "$1" ] && { - local ups="" - for i in $(seq 1 $1) - do - ups=$ups"../" - done - cd $ups - } || cd ../ -} - -function ccat { - pygmentize -g $1 | cat -n -} - -function sync_bash { - if [ -z "$1" ] - then - exit 1 - fi - echo $BASHRC_DIR - echo $1 - rsync -avzhe ssh $1 $BASHRC_USER@$BASHRC_SERVER:$BASHRC_DIR/$1 -} - -function get_bash_file { - if [ -z "$1" ] - then - exit 1 - fi - echo $BASHRC_DIR - echo $1 - rsync -avzhe ssh $BASHRC_USER@$BASHRC_SERVER:$BASHRC_DIR/$1 $1 -} - -SAVEIFS=$IFS -IFS=$(echo -en "\n\b") - -function extract { - if [ -z "$1" ]; then - # display usage if no parameters given - echo "Usage: extract ." - echo " extract [path/file_name_2.ext] [path/file_name_3.ext]" - else - for n in "$@" - do - if [ -f "$n" ] ; then - case "${n%,}" in - *.tar.bz2|*.tar.gz|*.tar.xz|*.tbz2|*.tgz|*.txz|*.tar) - tar xvf "$n" ;; - *.lzma) unlzma ./"$n" ;; - *.bz2) bunzip2 ./"$n" ;; - *.rar) unrar x -ad ./"$n" ;; - *.gz) gunzip ./"$n" ;; - *.zip) unzip ./"$n" ;; - *.z) uncompress ./"$n" ;; - *.7z|*.arj|*.cab|*.chm|*.deb|*.dmg|*.iso|*.lzh|*.msi|*.rpm|*.udf|*.wim|*.xar) - 7z x ./"$n" ;; - *.xz) unxz ./"$n" ;; - *.exe) cabextract ./"$n" ;; - *.cpio) cpio -id < ./"$n" ;; - *) - echo "extract: '$n' - unknown archive method" - return 1 - ;; - esac - else - echo "'$n' - file does not exist" - return 1 - fi - done -fi -} - -IFS=$SAVEIFS - -calc() { - echo "scale=3;$@" | bc -l -} diff --git a/FlippR-Driver/.cproject b/FlippR-Driver/.cproject index 1251af0..07c8c37 100644 --- a/FlippR-Driver/.cproject +++ b/FlippR-Driver/.cproject @@ -1,84 +1,525 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /usr/bin/make + -j8 + rebuild_cache + true + false + + + /usr/bin/make + -j8 + FlippR-Driver + true + false + + + /usr/bin/make + -j8 + FlippR-Driver/fast + true + false + + + /usr/bin/make + -C "/home/rhetenor/FlippR/flippr-code/FlippR-Driver" -j8 + FlippR-Driver + true + false + + + /usr/bin/cmake + -E chdir "/home/rhetenor/FlippR/flippr-code/FlippR-Driver" "/usr/bin/cmake" -P "CMakeFiles/FlippR-Driver.dir/cmake_clean.cmake" + + true + false + + + /usr/bin/make + -j8 + edit_cache + true + false + + + /usr/bin/make + -j8 + all + true + false + + + /usr/bin/make + -j8 + clean + true + false + + + /usr/bin/make + -j8 + all + true + false + + + /usr/bin/make + -j8 + clean + true + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/FlippR-Driver/.project b/FlippR-Driver/.project index 7cb6a73..dfeb1cb 100644 --- a/FlippR-Driver/.project +++ b/FlippR-Driver/.project @@ -1,27 +1,200 @@ - FlippR-Driver + FlippR-Driver-Debug@FlippR-Driver - - + - org.eclipse.cdt.managedbuilder.core.genmakebuilder + org.eclipse.cdt.make.core.makeBuilder clean,full,incremental, + + org.eclipse.cdt.make.core.cleanBuildTarget + clean + + + org.eclipse.cdt.make.core.enableCleanBuild + true + + + org.eclipse.cdt.make.core.append_environment + true + + + org.eclipse.cdt.make.core.stopOnError + true + + + org.eclipse.cdt.make.core.enabledIncrementalBuild + true + + + org.eclipse.cdt.make.core.build.command + /usr/bin/make + + + org.eclipse.cdt.make.core.contents + org.eclipse.cdt.make.core.activeConfigSettings + + + org.eclipse.cdt.make.core.build.target.inc + all + + + org.eclipse.cdt.make.core.build.arguments + -j8 + + + org.eclipse.cdt.make.core.buildLocation + /home/rhetenor/FlippR/flippr-code/FlippR-Driver + + + org.eclipse.cdt.make.core.useDefaultBuildCmd + false + + + org.eclipse.cdt.make.core.environment + VERBOSE=1|CMAKE_NO_VERBOSE=1| + + + org.eclipse.cdt.make.core.enableFullBuild + true + + + org.eclipse.cdt.make.core.build.target.auto + all + + + org.eclipse.cdt.make.core.enableAutoBuild + false + + + org.eclipse.cdt.make.core.build.target.clean + clean + + + org.eclipse.cdt.make.core.fullBuildTarget + all + + + org.eclipse.cdt.make.core.buildArguments + + + + org.eclipse.cdt.make.core.build.location + /home/rhetenor/FlippR/flippr-code/FlippR-Driver + + + org.eclipse.cdt.make.core.autoBuildTarget + all + + + org.eclipse.cdt.core.errorOutputParser + org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser; + - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - + org.eclipse.cdt.make.core.ScannerConfigBuilder + - org.eclipse.cdt.core.cnature + org.eclipse.cdt.make.core.makeNature + org.eclipse.cdt.make.core.ScannerConfigNature org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + org.eclipse.cdt.core.cnature - + + + [Subprojects] + 2 + virtual:/virtual + + + [Targets] + 2 + virtual:/virtual + + + [Targets]/[lib] FlippR-Driver + 2 + virtual:/virtual + + + [Targets]/[lib] FlippR-Driver/ + 2 + virtual:/virtual + + + [Targets]/[lib] FlippR-Driver/Source Files + 2 + virtual:/virtual + + + [Targets]/[lib] FlippR-Driver/Source Files/Detector.cpp + 1 + /home/rhetenor/FlippR/flippr-code/FlippR-Driver/src/input/Detector.cpp + + + [Targets]/[lib] FlippR-Driver/Source Files/Event.cpp + 1 + /home/rhetenor/FlippR/flippr-code/FlippR-Driver/src/input/Event.cpp + + + [Targets]/[lib] FlippR-Driver/Source Files/EventHandler.cpp + 1 + /home/rhetenor/FlippR/flippr-code/FlippR-Driver/src/input/EventHandler.cpp + + + [Targets]/[lib] FlippR-Driver/Source Files/EventNotifier.cpp + 1 + /home/rhetenor/FlippR/flippr-code/FlippR-Driver/src/input/EventNotifier.cpp + + + [Targets]/[lib] FlippR-Driver/Source Files/InputDriver.cpp + 1 + /home/rhetenor/FlippR/flippr-code/FlippR-Driver/src/input/InputDriver.cpp + + + [Targets]/[lib] FlippR-Driver/Source Files/InputDriverFactory.cpp + 1 + /home/rhetenor/FlippR/flippr-code/FlippR-Driver/src/input/InputDriverFactory.cpp + + + [Targets]/[lib] FlippR-Driver/Source Files/GPIOInterface.cpp + 1 + /home/rhetenor/FlippR/flippr-code/FlippR-Driver/src/utilities/GPIOInterface.cpp + + + [Targets]/[lib] FlippR-Driver/Source Files/InputGPIOInterface.cpp + 1 + /home/rhetenor/FlippR/flippr-code/FlippR-Driver/src/utilities/InputGPIOInterface.cpp + + + [Targets]/[lib] FlippR-Driver/Header Files + 2 + virtual:/virtual + + + [Targets]/[lib] FlippR-Driver/CMake Rules + 2 + virtual:/virtual + + + [Targets]/[lib] FlippR-Driver/Resources + 2 + virtual:/virtual + + + [Targets]/[lib] FlippR-Driver/Object Files + 2 + virtual:/virtual + + + [Targets]/[lib] FlippR-Driver/Object Libraries + 2 + virtual:/virtual + + + \ No newline at end of file diff --git a/FlippR-Driver/.settings/language.settings.xml b/FlippR-Driver/.settings/language.settings.xml deleted file mode 100644 index c7e504e..0000000 --- a/FlippR-Driver/.settings/language.settings.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/FlippR-Driver/.settings/org.eclipse.cdt.codan.core.prefs b/FlippR-Driver/.settings/org.eclipse.cdt.codan.core.prefs deleted file mode 100644 index 812e407..0000000 --- a/FlippR-Driver/.settings/org.eclipse.cdt.codan.core.prefs +++ /dev/null @@ -1,71 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.cdt.codan.checkers.errnoreturn=Warning -org.eclipse.cdt.codan.checkers.errnoreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No return\\")",implicit\=>false} -org.eclipse.cdt.codan.checkers.errreturnvalue=Error -org.eclipse.cdt.codan.checkers.errreturnvalue.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused return value\\")"} -org.eclipse.cdt.codan.checkers.nocommentinside=-Error -org.eclipse.cdt.codan.checkers.nocommentinside.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Nesting comments\\")"} -org.eclipse.cdt.codan.checkers.nolinecomment=-Error -org.eclipse.cdt.codan.checkers.nolinecomment.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Line comments\\")"} -org.eclipse.cdt.codan.checkers.noreturn=Error -org.eclipse.cdt.codan.checkers.noreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No return value\\")",implicit\=>false} -org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation=Error -org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Abstract class cannot be instantiated\\")"} -org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem=Error -org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Ambiguous problem\\")"} -org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem=Warning -org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Assignment in condition\\")"} -org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem=Error -org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Assignment to itself\\")"} -org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem=Warning -org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No break at end of case\\")",no_break_comment\=>"no break",last_case_param\=>false,empty_case_param\=>false,enable_fallthrough_quickfix_param\=>false} -org.eclipse.cdt.codan.internal.checkers.CatchByReference=Warning -org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Catching by reference is recommended\\")",unknown\=>false,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem=Error -org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Circular inheritance\\")"} -org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization=Warning -org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Class members should be properly initialized\\")",skip\=>true} -org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem=Error -org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Field cannot be resolved\\")"} -org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem=Error -org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Function cannot be resolved\\")"} -org.eclipse.cdt.codan.internal.checkers.InvalidArguments=Error -org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid arguments\\")"} -org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem=Error -org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid template argument\\")"} -org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem=Error -org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Label statement not found\\")"} -org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem=Error -org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Member declaration not found\\")"} -org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem=Error -org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Method cannot be resolved\\")"} -org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker=-Info -org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Name convention for function\\")",pattern\=>"^[a-z]",macro\=>true,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem=Warning -org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Class has a virtual method and non-virtual destructor\\")"} -org.eclipse.cdt.codan.internal.checkers.OverloadProblem=Error -org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid overload\\")"} -org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem=Error -org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid redeclaration\\")"} -org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem=Error -org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid redefinition\\")"} -org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Return with parenthesis\\")"} -org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem=-Warning -org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Format String Vulnerability\\")"} -org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem=Warning -org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Statement has no effect\\")",macro\=>true,exceptions\=>()} -org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem=Warning -org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Suggested parenthesis around expression\\")",paramNot\=>false} -org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem=Warning -org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Suspicious semicolon\\")",else\=>false,afterelse\=>false} -org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem=Error -org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Type cannot be resolved\\")"} -org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem=Warning -org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused function declaration\\")",macro\=>true} -org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem=Warning -org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused static function\\")",macro\=>true} -org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem=Warning -org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused variable declaration in file scope\\")",macro\=>true,exceptions\=>("@(\#)","$Id")} -org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem=Error -org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Symbol is not resolved\\")"} diff --git a/FlippR-Driver/.settings/org.eclipse.cdt.managedbuilder.core.prefs b/FlippR-Driver/.settings/org.eclipse.cdt.managedbuilder.core.prefs deleted file mode 100644 index c9cd6c6..0000000 --- a/FlippR-Driver/.settings/org.eclipse.cdt.managedbuilder.core.prefs +++ /dev/null @@ -1,13 +0,0 @@ -eclipse.preferences.version=1 -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1796611039/CPATH/delimiter=\: -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1796611039/CPATH/operation=remove -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1796611039/CPLUS_INCLUDE_PATH/delimiter=\: -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1796611039/CPLUS_INCLUDE_PATH/operation=remove -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1796611039/C_INCLUDE_PATH/delimiter=\: -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1796611039/C_INCLUDE_PATH/operation=remove -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1796611039/append=true -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1796611039/appendContributed=true -environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.debug.1796611039/LIBRARY_PATH/delimiter=\: -environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.debug.1796611039/LIBRARY_PATH/operation=remove -environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.debug.1796611039/append=true -environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.debug.1796611039/appendContributed=true diff --git a/FlippR-Driver/CMakeLists.txt b/FlippR-Driver/CMakeLists.txt index c0f5b36..a583ab5 100644 --- a/FlippR-Driver/CMakeLists.txt +++ b/FlippR-Driver/CMakeLists.txt @@ -23,7 +23,7 @@ if(NOT CMAKE_BUILD_TYPE) endif(NOT CMAKE_BUILD_TYPE) option(BUILD_SHARED_LIB "Build a shared lib instead of a static." OFF) -option(ENABLE_TESTING "Enables testing." ON) +option(ENABLE_TESTING "Enables testing." OFF) #################### Adding Library ##################### file(GLOB_RECURSE SOURCES src/*.cpp) @@ -51,8 +51,13 @@ target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src) target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/${LIB_DIR}) ##################### WIRING_PI ########################## -find_library(wiringPi NAMES libwiringPi) -target_link_libraries(${PROJECT_NAME} PRIVATE wiringPi) +find_library(WIRING_PI NAMES libwiringPi.so.2.44 HINTS ${CMAKE_SOURCE_DIR}/lib) + +if(NOT WIRING_PI) + message(FATAL_ERROR "Could not find wiringPi library") +endif() + +target_link_libraries(${PROJECT_NAME} PUBLIC ${WIRING_PI}) if(ENABLE_TESTING) diff --git a/FlippR-Driver/tests/CMakeLists.txt b/FlippR-Driver/tests/CMakeLists.txt index e69de29..e3bfd78 100644 --- a/FlippR-Driver/tests/CMakeLists.txt +++ b/FlippR-Driver/tests/CMakeLists.txt @@ -0,0 +1,25 @@ +###################### START_CMAKE ####################### +cmake_minimum_required(VERSION 3.9.1) +project(FlippR-Driver-Tests VERSION 0.1.0 LANGUAGES CXX) + +# Compile tests to output_path/tests +set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/${OUTPUT_PATH}/tests) + + +file(GLOB_RECURSE SOURCES *.cpp) + +add_executable(${PROJECT_NAME} ${SOURCES}) + +target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/tests) +target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src) + +#find_library(flippr-driver NAMES lib${CMAKE_PROJECT_NAME}.a HINTS ${CMAKE_SOURCE_DIR}/bin) +#if(NOT flippr-driver) +# message(FATAL_ERROR "Could not find FlippR library") +#endif() + +target_link_libraries(${PROJECT_NAME} PRIVATE FlippR-Driver) + +enable_testing() + +add_test(tests ${PROJECT_NAME}) diff --git a/FlippR-Driver/tests/input/TestDetector.cpp b/FlippR-Driver/tests/input/TestDetector.cpp index a4ff681..4d22728 100644 --- a/FlippR-Driver/tests/input/TestDetector.cpp +++ b/FlippR-Driver/tests/input/TestDetector.cpp @@ -15,11 +15,11 @@ #define private public -#include "../../../src/input/IEventNotifier.h" -#include "../../../src/input/Event.h" -#include "../../../src/input/Detector.h" -#include "../../../src/utilities/LoggerFactory.hpp" -#include "../../../src/utilities/InputGPIOInterface.h" +#include "input/IEventNotifier.h" +#include "input/Event.h" +#include "input/Detector.h" +#include "utilities/LoggerFactory.hpp" +#include "utilities/InputGPIOInterface.h" using namespace fakeit; diff --git a/FlippR-Driver/tests/input/TestEventNotifier.cpp b/FlippR-Driver/tests/input/TestEventNotifier.cpp index fb7f64d..63ff346 100644 --- a/FlippR-Driver/tests/input/TestEventNotifier.cpp +++ b/FlippR-Driver/tests/input/TestEventNotifier.cpp @@ -6,16 +6,16 @@ */ -#include "../catch.hpp" -#include "../fakeit.hpp" -#include "../../src/utilities/LoggerFactory.hpp" -#include "../../src/utilities/IEventHandler.h" +#include "catch.hpp" +#include "fakeit.hpp" +#include "utilities/LoggerFactory.hpp" +#include "utilities/IEventHandler.h" // testing purposes #define private public -#include "../../src/input/EventNotifier.h" +#include "input/EventNotifier.h" using namespace Input; using namespace fakeit; diff --git a/FlippR-Driver/tests/input/TestInputDriver.cpp b/FlippR-Driver/tests/input/TestInputDriver.cpp index a765c27..3bab6fd 100644 --- a/FlippR-Driver/tests/input/TestInputDriver.cpp +++ b/FlippR-Driver/tests/input/TestInputDriver.cpp @@ -5,17 +5,17 @@ * Author: Andreas Schneider, Johannes Wendel, Jonas Zeunert, Rafael Vinci, Dr. Franca Rupprecht */ -#include "../catch.hpp" -#include "../fakeit.hpp" -#include "../../src/utilities/LoggerFactory.hpp" +#include "catch.hpp" +#include "fakeit.hpp" +#include "utilities/LoggerFactory.hpp" // testing purposes #define private public -#include "../../src/input/InputDriver.h" +#include "input/InputDriver.h" -#include "../../src/input/IEventNotifier.h" -#include "../../src/input/IDetector.h" +#include "input/IEventNotifier.h" +#include "input/IDetector.h" using namespace fakeit; diff --git a/FlippR-Driver/tests/input/main.cpp b/FlippR-Driver/tests/input/main.cpp index f0e73c1..f01ff5f 100644 --- a/FlippR-Driver/tests/input/main.cpp +++ b/FlippR-Driver/tests/input/main.cpp @@ -6,4 +6,4 @@ */ #define CATCH_CONFIG_MAIN -#include "../catch.hpp" +#include "catch.hpp"