• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Castle: The best Real-Time/Embedded/HighTech language EVER. Attempt 2


Commit MetaInfo

Revision527562d7aefe1bf6517a84d1fc716700ee4b3148 (tree)
Time2023-09-19 00:47:44
AuthorAlbert Mietus < albert AT mietus DOT nl >
CommiterAlbert Mietus < albert AT mietus DOT nl >

Log Message

CC2Cpy backend is abandoned, start with RPy. Finsch: Split Makefiles

Change Summary

Incremental Difference

diff -r 1ad8b1732b6d -r 527562d7aefe Makefile
--- a/Makefile Mon Sep 18 17:46:26 2023 +0200
+++ b/Makefile Mon Sep 18 17:47:44 2023 +0200
@@ -1,115 +1,27 @@
11 default: all
22
33 all: current demo test mutmut pyanalyse XXX missing current-todo
4+NOTES: CC2CpyNote
45
5-LAST = \
6- pytst/writers/CC2Cpy/test_2a_groundwork.py \
7- pytst/writers/CC2Cpy/test_2b_EventProtocol.py \
8- pytst/writers/CC2Cpy/test_3a_CompPorts.py \
9- pytst/writers/CC2Cpy/test_3b_CompInterface.py \
10- pytst/writers/CC2Cpy/test_3c_CompImpl.py \
6+include Mk/RPy.mk
7+rPY_LAST = \
8+ pytst/writers/rPY/XXX \
119 #
12-CURRENT_TESTS = \
13- pytst/writers/CC2Cpy/test_4a_HandlerTables.py \
14- pytst/writers/CC2Cpy/test_9_genSieve.py \
10+rPY_CURRENT = \
11+ pytst/writers/rPY/XXX \
1512 #
16-TODO_TESTS = \
17- pytst/writers/CC2Cpy/test_999_NoNameCollision.py \
13+CC2CPy_TODO = \
14+ pytst/writers/rPY/XXX \
1815 #
1916
20-ToCS_dir = _ToCS-reports/
21-COVERAGE_dir = ${ToCS_dir}Coverage/
22-MUTMUT_dir = ${ToCS_dir}MutMut/
17+include Mk/settings.mk
18+include Mk/testing.mk
19+include Mk/helpful.mk
2320
2421 missing: missing_visitor missing_serialization
25-
26-PYTEST_OPTONS=-rxXsfE
27-pytest test coverage:
28- coverage run --branch -m pytest ${PYTEST_OPTONS} pytst/
29- coverage report --skip-covered
30- coverage html --directory=${COVERAGE_dir}
31-coverage-open: coverage
32- open ${COVERAGE_dir}index.html
33-
34-pytest-only: # No coverage reports
35- pytest ${PYTEST_OPTONS} pytst
36-pytest-s: # -s : No capure (so, show stdout/stderr)
37- pytest ${PYTEST_OPTONS} -s pytst
38-pytest-d pytest-ds pytest-sd: # with debuging
39- pytest ${PYTEST_OPTONS} --log-cli-level=DEBUG -s pytst/
40-
41-mutmut: mutmut-3.11 # Mutation testing (takes a long run) https://en.wikipedia.org/wiki/Mutation_testing
42- -mutmut run --tests-dir pytst --paths-to-mutate castle
43- mutmut html && rm -rf ${MUTMUT_dir} && mv html ${MUTMUT_dir}
44- mutmut results
45-mutmut-open: mutmut
46- open ${MUTMUT_dir}index.html
47-
48-mutmut-3.11:
49- @echo Mutmut is currenly not working in python-3.11. See BUGS.rst.
50- @echo But it works on 3.10 -- Therefore we use the 3.10 version
51- python --version
52-
53-open: coverage-open mutmut-open
54-remake: veryclean coverage mutmut open
55-
56-last:
57- PYTHONPATH=`pwd` pytest ${PYTEST_OPTONS} ${LAST}
58-current-only:
59- PYTHONPATH=`pwd` pytest ${PYTEST_OPTONS} ${CURRENT_TESTS}
60-current:
61- PYTHONPATH=`pwd` pytest ${PYTEST_OPTONS} ${CURRENT_TESTS} ${TODO_TESTS}
62-current-todo:
63- PYTHONPATH=`pwd` pytest ${PYTEST_OPTONS} ${TODO_TESTS}
64-current-ds current-sd:
65- PYTHONPATH=`pwd` pytest ${PYTEST_OPTONS} --log-cli-level=DEBUG -s ${CURRENT_TESTS}
66-demo: pytest-demo python-demo
22+open: coverage-open mutmut-open
23+remake: veryclean coverage mutmut open
6724
68-python-demo:
69- @echo Running all 'dem*.py' python-files
70- export PYTHONPATH=`pwd`; for d in `find demos -type f -iname \*.py `; do echo "=== $$d ==="; python $$d; echo "=========="; done
71-
72-pytest-demo:
73- -PYTHONPATH=`pwd` pytest -s demos || echo "currently NO pytest-demos (check/fix manually)"
74-
75-LANGUAGEd=castle/readers/parser/grammar/
76-missing_visitor: ${LANGUAGEd}language.py
77- @for R in $(shell grep '^ *def ' $< | awk '{print $$2}' | sed 's/()://') ; do \
78- if ! grep -q -E "^ *((def)|(# *NO_VISITOR_NEEDED:)) *visit_$$R" ${LANGUAGEd}visitor.py > /dev/null ; then\
79- echo "Warning: $${R} has no visitor (nor is marked as to need none)" ;\
80- fi ;\
81- done
82-
83-ASTd=castle/ast/
84-missing_serialization: ${ASTd}grammar.py
85- @for R in ${shell grep '^ *class ' $< | sed 's/class //g' | sed 's/[:( ].*$$//g' } ; do \
86- if ! grep -q -E "^ *((def)|(# *NO_VISITOR_NEEDED:)) $${R}2xml" ${ASTd}serialization/ast2xml/*.py > /dev/null ; then\
87- echo "Warning: $${R} has no xml-serializer (nor is marked as to need none)" ;\
88- fi ;\
89- done
90-XXX:
91- grep XXX `find . -type f -name \*.py`
92-
93-WC:
94- wc -l `find . -type f -name \*.py`
95-
96-
97-PYREVERSE_DIR=_pyreversed/
98-PYREVERSE_FORMAT=svg
99-PYREVERSE_OPTIONS=-k -A
100-PYREVERSE_PRJS= castle castle.readers castle.ast castle.writers.CC2Cpy
101-
102-pyanalyse pyreverse: ${PYREVERSE_DIR}
103- for P in ${PYREVERSE_PRJS}; do \
104- echo "PYANALYSE::" $$P "...";\
105- pyreverse -d ${PYREVERSE_DIR} -o ${PYREVERSE_FORMAT} ${PYREVERSE_OPTIONS} -p $$P-noModules -mn --colorized --max-color-depth=42 $$P >>/dev/null;\
106- pyreverse -d ${PYREVERSE_DIR} -o ${PYREVERSE_FORMAT} ${PYREVERSE_OPTIONS} -p $$P-Modules -my --colorized --max-color-depth=42 $$P >>/dev/null;\
107- done
108- @echo ".. done. Result:"
109- @ls -l ${PYREVERSE_DIR}/*.${PYREVERSE_FORMAT}
110-
111-
112-clean: clean_caches
11325 clean_caches:
11426 find . -type d -name __pycache__ -print0 | xargs -0 rm -r
11527 find . -type d -name .pytest_cache -print0 | xargs -0 rm -r
@@ -122,3 +34,6 @@
12234 rm -rf ${PYREVERSE_DIR}*
12335
12436 cleanest veryclean: cleaner
37+
38+#CC2Cpy is outdated -- see make CC2CpyNote
39+include mk/CC2Cpy.mk