Skip to content

Commit

Permalink
Som devel 20 (#66)
Browse files Browse the repository at this point in the history
* coverage

* coverage

* coverage

* added sompy

* added sompy

* pre-commit

* check of pre-commit

* test

* test

* test

* test

* removed pass()

* removed pass()

* review rework

* review rework

* Squashed commit of the following:

commit 1491ebc943d1c2da1dc9d5d22796250a916629ae
Author: sorgom <[email protected]>
Date:   Sun Oct 13 18:53:18 2024 +0200

    merge SOM_DEVEL_20

* bullseye build & run

* include guards I

* include guards I

* include guards I

* minor corrections
  • Loading branch information
sorgom authored Oct 14, 2024
1 parent f3c9847 commit 7d016c6
Show file tree
Hide file tree
Showing 42 changed files with 280 additions and 112 deletions.
47 changes: 27 additions & 20 deletions .gitHooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,46 @@
# use: git config core.hooksPath .gitHooks

py=$(which py || which python || which python3)
if [[ -z $py ]]; then exit 0; fi
echo "Using python: $py"
if [[ -z $py ]]
then
echo "No python found"
exit 0
fi

cd $(git rev-parse --show-toplevel)
echo current directory: $(pwd)
sompy=$(pwd)/sompy/somutil

mdjs=
svgs=
txts=

for file in `git diff-index --cached --name-only HEAD`;
do
if [[ -f $file ]]
then
add=1
echo checking file: $file
if [[ $file == *.mdj ]]
then
echo cleaning mdj file: $file
$py $sompy/cleanMdj.py $file
elif [[ $file == *.svg ]]
then
echo cleaning svg file: $file
$py $sompy/cleanSvg.py $file
elif [[ $file == *.py ]] || [[ $file == *.cpp ]] || [[ $file == *.h ]]
then
echo cleaning text file: $file
$py $sompy/cleanTxt.py $file
if [[ $file == *.mdj ]]; then mdjs="$mdjs $file"
elif [[ $file == *.svg ]]; then svgs="$svgs $file"
elif [[ $file == *.py ]] || [[ $file == *.cpp ]] || [[ $file == *.h ]] || [[ $file == *.cmd ]]
then
txts="$txts $file"
else
add=0
fi

if [[ $add -eq 1 ]]
then
git add $file
fi
if [[ $add -eq 1 ]]; then git add $file; fi
fi
done

if [[ -n $mdjs ]]; then
echo cleaning mdj files
$py $sompy/cleanMdj.py $mdjs
fi
if [[ -n $svgs ]]; then
echo cleaning svg files
$py $sompy/cleanSvg.py $svgs
fi
if [[ -n $txts ]]; then
echo cleaning text files
$py $sompy/cleanTxt.py $txts
fi
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,7 @@ transitions_*.md
# valgrind
*.out.[0-9]*

.obsidian
.obsidian

!_cov*.txt
reports
3 changes: 3 additions & 0 deletions application/components/BAS/BAS_Provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
// created by Manfred Sorgo

#pragma once
#ifndef BAS_PROVIDER_H
#define BAS_PROVIDER_H

#include <BAS/Containers.h>
#include <ifs/I_Provider.h>
Expand Down Expand Up @@ -44,3 +46,4 @@ class BAS_Provider : public I_Provider

PolyVec<I_Elem> mElems;
};
#endif // _H
5 changes: 4 additions & 1 deletion application/components/BAS/Containers.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// created by Manfred Sorgo

#pragma once
#ifndef CONTAINERS_H
#define CONTAINERS_H

#include <BAS/coding.h>
#include <ifs/DataTypes.h>
Expand Down Expand Up @@ -145,7 +147,7 @@ class Index
pos = mid;
}
}
return PosRes{pos, found};
return PosRes{found, pos};
}
private:
// data storage
Expand Down Expand Up @@ -190,3 +192,4 @@ class Index
return dups;
}
};
#endif // _H
7 changes: 5 additions & 2 deletions application/components/BAS/NcpIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// created by Manfred Sorgo

#pragma once
#ifndef NCPINDEX_H
#define NCPINDEX_H

#include <BAS/coding.h>
#include <BAS/Containers.h>
Expand Down Expand Up @@ -41,8 +43,9 @@ class NcpIndex : public Index<const ComName&, Ncp>
NOCOPY(NcpIndex)

protected:
inline const ComName& getKey(const Ncp& ntp) const final
inline const ComName& getKey(const Ncp& ncp) const final
{
return ntp.name;
return ncp.name;
}
};
#endif // _H
3 changes: 3 additions & 0 deletions application/components/BAS/coding.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// ============================================================
// created by Manfred Sorgo
#pragma once
#ifndef CODING_H
#define CODING_H

#include <codebase/BaseTypes.h>
#include <codebase/nocopy.h>
Expand All @@ -21,3 +23,4 @@
static NAME instance; \
return instance; \
}
#endif // _H
3 changes: 3 additions & 0 deletions application/components/COM/Com.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// created by Manfred Sorgo

#pragma once
#ifndef COM_H
#define COM_H

#include <ifs/I_Com.h>
#include <BAS/coding.h>
Expand All @@ -23,3 +25,4 @@ class Com : public I_Com
inline Com() = default;
bool mRunning = false;
};
#endif // _H
3 changes: 3 additions & 0 deletions application/components/COM/TCP.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// created by Manfred Sorgo

#pragma once
#ifndef TCP_H
#define TCP_H

#include <ifs/I_TCP.h>
#include <BAS/coding.h>
Expand Down Expand Up @@ -41,3 +43,4 @@ class TCP : public I_TCP
UINT32 mSec = 0;
UINT32 mMicro = 10000;
};
#endif // _H
3 changes: 3 additions & 0 deletions application/components/COM/TCP_Com.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// created by Manfred Sorgo

#pragma once
#ifndef TCP_COM_H
#define TCP_COM_H

#include <ifs/I_TCP.h>
#include <BAS/coding.h>
Expand Down Expand Up @@ -132,3 +134,4 @@ class TCP_Con_Ctrl : public TCP_Con_Base
private:
inline TCP_Con_Ctrl() = default;
};
#endif // _H
3 changes: 3 additions & 0 deletions application/components/LCR/LCR_Provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// created by Manfred Sorgo

#pragma once
#ifndef LCR_PROVIDER_H
#define LCR_PROVIDER_H

#include <BAS/coding.h>
#include <BAS/BAS_Provider.h>
Expand All @@ -19,3 +21,4 @@ class LCR_Provider : public BAS_Provider
private:
inline LCR_Provider() = default;
};
#endif // _H
3 changes: 3 additions & 0 deletions application/components/LCR/LCR_X.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// created by Manfred Sorgo

#pragma once
#ifndef LCR_X_H
#define LCR_X_H

#include <ifs/I_Elem.h>
#include <BAS/coding.h>
Expand Down Expand Up @@ -75,3 +77,4 @@ class LCR_UBK : public LCR_X
UINT8 mUbkToGui;
static bool validUbk(UINT8 ubk);
};
#endif // _H
3 changes: 3 additions & 0 deletions application/components/SIG/SIG_Provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// created by Manfred Sorgo

#pragma once
#ifndef SIG_PROVIDER_H
#define SIG_PROVIDER_H

#include <BAS/coding.h>
#include <BAS/BAS_Provider.h>
Expand All @@ -19,3 +21,4 @@ class SIG_Provider : public BAS_Provider
private:
inline SIG_Provider() = default;
};
#endif // _H
3 changes: 3 additions & 0 deletions application/components/SIG/SIG_X.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// created by Manfred Sorgo

#pragma once
#ifndef SIG_X_H
#define SIG_X_H

#include <ifs/values.h>
#include <ifs/I_Elem.h>
Expand Down Expand Up @@ -136,3 +138,4 @@ class SIG_H_N : public SIG_XS
void proc_H1_N0(UINT8 speed);
void proc_H1_N1(UINT8 speed);
};
#endif // _H
3 changes: 3 additions & 0 deletions application/components/SYS/Dispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// ============================================================
// created by Manfred Sorgo
#pragma once
#ifndef DISPATCHER_H
#define DISPATCHER_H

#include <BAS/coding.h>
#include <BAS/NcpIndex.h>
Expand Down Expand Up @@ -37,3 +39,4 @@ class Dispatcher : public I_Dispatcher
static void forwardGui(I_Provider& prov, const Ncp& ncp, const ComTele& tele);
static void reGui(I_Provider& prov);
};
#endif // _H
3 changes: 3 additions & 0 deletions application/components/SYS/IL.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// created by Manfred Sorgo

#pragma once
#ifndef IL_H
#define IL_H

#include <COM/Com.h>
#include <COM/TCP_Com.h>
Expand Down Expand Up @@ -34,3 +36,4 @@ namespace IL
inline I_TCP_Listener& getTCP_Listener_Gui() { return TCP_Listener_Gui::instance(); }
inline I_TCP_Listener& getTCP_Listener_Ctrl() { return TCP_Listener_Ctrl::instance(); }
} // namespace
#endif // _H
3 changes: 3 additions & 0 deletions application/components/SYS/Log.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// created by Manfred Sorgo

#pragma once
#ifndef LOG_H
#define LOG_H

#include <ifs/I_Log.h>
#include <BAS/coding.h>
Expand All @@ -27,3 +29,4 @@ class Log : public I_Log
E_Ret mErr = RET_NO_ERR;
inline Log() = default;
};
#endif // _H
3 changes: 3 additions & 0 deletions application/components/SYS/Reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// class Reader implements I_Reader
// ============================================================
#pragma once
#ifndef READER_H
#define READER_H

#include <ifs/I_Reader.h>
#include <BAS/coding.h>
Expand All @@ -18,3 +20,4 @@ class Reader : public I_Reader
ComSetup mComSetup = {};
inline Reader() = default;
};
#endif // _H
2 changes: 1 addition & 1 deletion application/components/SYS/src/Dispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const PosRes Dispatcher::assign(
const size_t pos)
{
mIndx.add(name, comp, pos);
return PosRes{mIndx.size() - 1, true};
return PosRes{true, mIndx.size() - 1};
}

void Dispatcher::fromFld(const ComTele& tele) const
Expand Down
3 changes: 3 additions & 0 deletions application/components/TSW/TSW.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// created by Manfred Sorgo

#pragma once
#ifndef TSW_H
#define TSW_H

#include <ifs/values.h>
#include <ifs/I_Elem.h>
Expand Down Expand Up @@ -38,3 +40,4 @@ class TSW : public I_Elem
void chgState(UINT8 state);
void toFld(UINT8 state) const;
};
#endif // _H
3 changes: 3 additions & 0 deletions application/components/TSW/TSW_Provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// created by Manfred Sorgo

#pragma once
#ifndef TSW_PROVIDER_H
#define TSW_PROVIDER_H

#include <BAS/coding.h>
#include <BAS/BAS_Provider.h>
Expand All @@ -25,3 +27,4 @@ class TSW_Provider : public BAS_Provider
private:
inline TSW_Provider() = default;
};
#endif // _H
3 changes: 3 additions & 0 deletions make/bullseye/_covexclude.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
exclude all /
include folder application/
include folder specification/
9 changes: 9 additions & 0 deletions make/bullseye/_covoptions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
options:
-p [VS-version] run premake e.g. -p vs2019
-c force clean build
-r remove reports
-H generate HTML
-u just update coverage file (no report, no HTML)
-h this help

all options must be given separately
Loading

0 comments on commit 7d016c6

Please sign in to comment.