Initial setup of unttest collection

This commit is contained in:
Dirk Alders 2025-08-06 20:11:18 +02:00
parent f0c53f6985
commit cc65218504
21 changed files with 204 additions and 0 deletions

48
.gitmodules vendored Normal file
View File

@ -0,0 +1,48 @@
[submodule "caching"]
path = caching
url = https://git.mount-mockery.de/unittest/caching.git
[submodule "fstools"]
path = fstools
url = https://git.mount-mockery.de/unittest/fstools.git
[submodule "geo"]
path = geo
url = https://git.mount-mockery.de/unittest/geo.git
[submodule "helpers"]
path = helpers
url = https://git.mount-mockery.de/unittest/helpers.git
[submodule "keyboard"]
path = keyboard
url = https://git.mount-mockery.de/unittest/keyboard.git
[submodule "media"]
path = media
url = https://git.mount-mockery.de/unittest/media.git
[submodule "mqtt"]
path = mqtt
url = https://git.mount-mockery.de/unittest/mqtt.git
[submodule "report"]
path = report
url = https://git.mount-mockery.de/unittest/report.git
[submodule "socket_protocol"]
path = socket_protocol
url = https://git.mount-mockery.de/unittest/socket_protocol.git
[submodule "state_machine"]
path = state_machine
url = https://git.mount-mockery.de/unittest/state_machine.git
[submodule "stringtools"]
path = stringtools
url = https://git.mount-mockery.de/unittest/stringtools.git
[submodule "task"]
path = task
url = https://git.mount-mockery.de/unittest/task.git
[submodule "tcp_socket"]
path = tcp_socket
url = https://git.mount-mockery.de/unittest/tcp_socket.git
[submodule "__scripts__/unittest"]
path = __scripts__/unittest
url = https://git.mount-mockery.de/pylib/unittest.git
[submodule "__scripts__/fstools"]
path = __scripts__/fstools
url = https://git.mount-mockery.de/pylib/fstools.git
[submodule "__scripts__/report"]
path = __scripts__/report
url = https://git.mount-mockery.de/pylib/report.git

14
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,14 @@
{
"python.defaultInterpreterPath": "python3",
"autopep8.args": ["--max-line-length=150"],
"[python]": {
"python.formatting.provider": "none",
"editor.defaultFormatter": "ms-python.autopep8",
"editor.formatOnSave": true
},
"editor.fontSize": 14,
"emmet.includeLanguages": { "django-html": "html" },
"python.testing.pytestArgs": ["-v", "--cov", "--cov-report=xml", "__test__"],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}

95
Makefile Normal file
View File

@ -0,0 +1,95 @@
# git helper Makefile: Version 1.7 (2025-08-05)
default: help
.ONESHELL:
SHELL = /usr/bin/bash
.SILENT:
-include __make.d__/*.mk
GIT_FLAG = ./.git
VENV_FLAG = ./.venv_required
VENV_FOLDER = ./venv
localhelp:
help:
echo "Possible common options are:"
echo " - init - Initialise the repository and all folders below with a Makefile"
echo " - giti - Get the git status of all submodules including their submodules"
echo " - update_submodules - Set all submodules to remote master"
echo " - venv_flag - Set the venev flag for the base folder. A venv will be generated"
echo " - clean - clean up"
echo " - deepclean - clean up this and all Makefiles below"
$(MAKE) localhelp
echo "You are able to create files make.d/*.mk and add local rules there. "
echo " - localinit: print_head - Will be executed as last step in the init process."
echo " - localhelp: print_head - Will be executed in th middle of the help text generation"
echo " - localclean:print_head - Will be executed before the clean rule"
localinit:
init: print_head
# Init git repo
if [[ -e $(GIT_FLAG) ]]; then
git submodule init
git submodule update
fi
# Init submodules
for subdir in $$(find . -maxdepth 2 -mindepth 2 -name Makefile | sort); do
$(MAKE) --no-print-directory -C $$(dirname $$subdir) init
done
# Create venv if needed
if [[ -e $(VENV_FLAG) ]]; then
if [[ ! -e $(VENV_FOLDER) ]]; then
mkvenv
fi
fi
# Start local init
$(MAKE) localinit
update_submodules:
git submodule foreach "git fetch && git checkout master && git pull && git submodule init && git submodule update"
giti_this: print_head
giti
echo " Submodules:"
git submodule --quiet foreach "echo -n ' ' && giti"
giti:
git submodule --quiet foreach [ -e Makefile ] || make --no-print-directory giti_this
localclean:
clean: localclean
if [[ ! -e $(VENV_FLAG) ]]; then
if [[ -d $(VENV_FOLDER) ]]; then
rm -rf $(VENV_FOLDER)
fi
fi
cleanall: clean
for subdir in $$(find . -maxdepth 2 -mindepth 2 -name Makefile | sort); do
$(MAKE) --no-print-directory -C $$(dirname $$subdir) cleanall
done
venv_flag:
if [[ ! -e $(VENV_FLAG) ]]; then
touch $(VENV_FLAG)
if [[ -e $(GIT_FLAG) ]]; then
git add $(VENV_FLAG)
fi
fi
print_head:
DIRNAME=$$(basename $$(pwd))
DIRLENGTH=$${#DIRNAME}
echo -ne "\n\n\033[1;34m╔═"
for i in $$(seq 1 $$DIRLENGTH); do echo -n "═"; done
echo -e "═╗"
echo -e "$$DIRNAME ║"
echo -ne "╚═"
for i in $$(seq 1 $$DIRLENGTH); do echo -n "═"; done
echo -e "═╝\033[00m"

13
__make.d__/unittest.mk Normal file
View File

@ -0,0 +1,13 @@
MAKEFLAGS += --no-print-directory
.ONESHELL:
SHELL = /usr/bin/bash
.SILENT:
localhelp:
echo "Possible unittest options are:"
echo " - status - Prints a table for the status of each unittest"
status:
__scripts__/unittest_status

1
__scripts__/fstools Submodule

@ -0,0 +1 @@
Subproject commit 9237f6f7f77eed79b8163077c1b4d87189193fbe

1
__scripts__/report Submodule

@ -0,0 +1 @@
Subproject commit 5995368f07f7f680136860af55510dbb61e7503b

1
__scripts__/unittest Submodule

@ -0,0 +1 @@
Subproject commit 631e7c60bfb822a7a50f63855633aa24436353ce

18
__scripts__/unittest_status Executable file
View File

@ -0,0 +1,18 @@
#! /usr/bin/env python3
#
import os
import sys
MY_PATH = os.path.abspath('.')
sys.path.insert(0, os.path.join(MY_PATH, 'report', 'pylibs'))
import unittest
import fstools
module_pathes = fstools.dirlist(MY_PATH, rekursive=False)
module_pathes.sort()
sys.stdout.write(unittest.module_status.module_status_head())
for module_path in module_pathes:
if not os.path.basename(module_path) in ['.git', '__make.d__', '__scripts__']:
sys.stdout.write(unittest.module_status.module_status_line(module_path))

1
caching Submodule

@ -0,0 +1 @@
Subproject commit 148a75af68f69e164b98a737ba135ed9b295af51

1
fstools Submodule

@ -0,0 +1 @@
Subproject commit 86f69041a5eb76c6d6716b07e40580978be7a509

1
geo Submodule

@ -0,0 +1 @@
Subproject commit caf8e0370e4adce570776801bc160eeb030d5b69

1
helpers Submodule

@ -0,0 +1 @@
Subproject commit c47a2d4d8f90df707f21f6449609c587dac4d9c8

1
keyboard Submodule

@ -0,0 +1 @@
Subproject commit 6b12d889a9d52bf61404fab6814495e853b8783d

1
media Submodule

@ -0,0 +1 @@
Subproject commit d5d9529a78f3de1da67ea7f1e63997f7d78bc53f

1
mqtt Submodule

@ -0,0 +1 @@
Subproject commit 05ed33f75e7c6ecc8dc970931ec4f80329f30811

1
report Submodule

@ -0,0 +1 @@
Subproject commit fe6c1fdbed9ee8ab9851fb9bd05d142d6376d166

1
socket_protocol Submodule

@ -0,0 +1 @@
Subproject commit d1ef6bac9a5ee53c460ab0430d1a1d4275ad1b4f

1
state_machine Submodule

@ -0,0 +1 @@
Subproject commit 0d4a97a99555f8b34560fab9f1c4aff347df2d86

1
stringtools Submodule

@ -0,0 +1 @@
Subproject commit 6c3d466a0608db3f4d2f4bfa2a11bd7afc492e7f

1
task Submodule

@ -0,0 +1 @@
Subproject commit f3f04fd285484fe4f876714cfbf5f927f2792173

1
tcp_socket Submodule

@ -0,0 +1 @@
Subproject commit 9930a42f45c0f1211a996c282abb80c0d4e37ad5