2024-01-17 17:30:48 +01:00
|
|
|
# to run the tests, run make PASS=controllerpassword test
|
|
|
|
|
|
|
|
PREFIX=/usr/local
|
2024-01-16 19:10:43 +01:00
|
|
|
PYTHON_EXE_MSYS=${PREFIX}/bin/python3.sh
|
2024-02-04 04:29:52 +01:00
|
|
|
PIP_EXE_MSYS=${PREFIX}/bin/pip3.sh
|
2024-01-16 19:10:43 +01:00
|
|
|
LOCAL_DOCTEST=${PREFIX}/bin/toxcore_run_doctest3.bash
|
2024-01-14 15:28:53 +01:00
|
|
|
DOCTEST=${LOCAL_DOCTEST}
|
2024-01-15 13:37:32 +01:00
|
|
|
MOD=stem_examples
|
|
|
|
|
|
|
|
check::
|
|
|
|
sh python3.sh -c "import ${MOD}"
|
2024-01-14 15:28:53 +01:00
|
|
|
|
|
|
|
lint::
|
|
|
|
sh .pylint.sh
|
|
|
|
|
2024-02-05 15:26:19 +01:00
|
|
|
install::
|
|
|
|
${PIP_EXE_MSYS} --python ${PYTHON_EXE_MSYS} install \
|
2024-02-21 09:03:10 +01:00
|
|
|
--no-deps \
|
2024-02-05 15:26:19 +01:00
|
|
|
--target ${PREFIX}/lib/python${PYTHON_MINOR}/site-packages/ \
|
|
|
|
--upgrade .
|
2024-02-21 09:03:10 +01:00
|
|
|
sed -i -e "1s@/usr/bin/python${PYTHON_MINOR}@${PYTHON_EXE_MSYS}@" \
|
|
|
|
${PREFIX}/lib/python${PYTHON_MINOR}/site-packages/bin/*
|
2024-02-04 04:29:52 +01:00
|
|
|
|
2024-01-14 15:28:53 +01:00
|
|
|
rsync::
|
|
|
|
bash .rsync.sh
|
|
|
|
|
2024-01-17 17:30:48 +01:00
|
|
|
# execute these tests as: make test PASS=password
|
2024-01-16 19:10:43 +01:00
|
|
|
test::
|
2024-01-17 17:30:48 +01:00
|
|
|
echo src/${MOD}/check_digests.py
|
2024-02-21 09:03:10 +01:00
|
|
|
TOR_CONTROLLER_PASSWORD=${PASS} ${PYTHON_EXE_MSYS} src/${MOD}/check_digests.py
|
2024-02-04 04:29:52 +01:00
|
|
|
echo src/${MOD}/interpreter.py
|
2024-02-21 09:03:10 +01:00
|
|
|
TOR_CONTROLLER_PASSWORD=${PASS} ${PYTHON_EXE_MSYS} src/${MOD}/interpreter.py
|
2024-01-17 21:35:20 +01:00
|
|
|
echo src/${MOD}/connection_resolution.py
|
2024-02-21 09:03:10 +01:00
|
|
|
sudo env TOR_CONTROLLER_PASSWORD=${PASS} ${PYTHON_EXE_MSYS} src/${MOD}/connection_resolution.py
|
2024-01-16 19:10:43 +01:00
|
|
|
# broken because this site fails: http://128.31.0.39:9131/tor/status-vote
|
|
|
|
# ${PYTHON_EXE_MSYS} src/${MOD}/compare_flags.py
|
|
|
|
# cant use from make: waits for the cmdline to to terminate
|
2024-01-17 17:30:48 +01:00
|
|
|
# TOR_CONTROLLER_PASSWORD=${PASS} ${PYTHON_EXE_MSYS} src/${MOD}/exit_used.py 10
|
|
|
|
echo src/${MOD}/introduction_points.py
|
2024-01-16 19:10:43 +01:00
|
|
|
TOR_CONTROLLER_PASSWORD=${PASS} ${PYTHON_EXE_MSYS} src/${MOD}/introduction_points.py
|
2024-01-17 17:30:48 +01:00
|
|
|
echo src/${MOD}/list_circuits.py
|
|
|
|
TOR_CONTROLLER_PASSWORD=${PASS} ${PYTHON_EXE_MSYS} src/${MOD}/list_circuits.py
|
|
|
|
echo src/${MOD}/mappaddress.py
|
2024-01-16 19:10:43 +01:00
|
|
|
TOR_CONTROLLER_PASSWORD=${PASS} ${PYTHON_EXE_MSYS} src/${MOD}/mappaddress.py
|
2024-01-17 17:30:48 +01:00
|
|
|
echo src/${MOD}/outdated_relays.py NOT WORKING?
|
|
|
|
TOR_CONTROLLER_PASSWORD=${PASS} ${PYTHON_EXE_MSYS} src/${MOD}/outdated_relays.py
|
|
|
|
echo src/${MOD}/relay_connections.py
|
2024-02-21 09:03:10 +01:00
|
|
|
sudo env TOR_CONTROLLER_PASSWORD=${PASS} ${PYTHON_EXE_MSYS} src/${MOD}/relay_connections.py
|
2024-01-17 17:30:48 +01:00
|
|
|
echo src/${MOD}/tor_bootstrap_check.py
|
|
|
|
TOR_CONTROLLER_PASSWORD=${PASS} ${PYTHON_EXE_MSYS} src/${MOD}/tor_bootstrap_check.py
|
2024-01-16 19:10:43 +01:00
|
|
|
|
2024-01-14 15:28:53 +01:00
|
|
|
doctest:
|
2024-02-05 15:26:19 +01:00
|
|
|
sudo -u tor env PYTHONPATH=${PWD}/src \
|
2024-01-16 19:10:43 +01:00
|
|
|
${DOCTEST} ${MOD}.txt
|
2024-01-15 13:37:32 +01:00
|
|
|
|
|
|
|
veryclean:: clean
|
|
|
|
rm -rf build dist __pycache__ .pylint.err .pylint.out
|
|
|
|
|
|
|
|
clean::
|
|
|
|
find . -name \*~ -delete
|