mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-01-04 04:10:52 -05:00
Add script to set up venv and run production test
This commit is contained in:
parent
4f68e93b84
commit
2536011fb9
1
hw/production_test/.gitignore
vendored
1
hw/production_test/.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
venv
|
venv
|
||||||
|
wipedonce
|
||||||
|
@ -417,7 +417,7 @@ def run_tests(test_list):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
last_a = 0
|
last_a = 1
|
||||||
|
|
||||||
# Allow any of the settings in the file_locations structure to be overridden
|
# Allow any of the settings in the file_locations structure to be overridden
|
||||||
import argparse
|
import argparse
|
||||||
@ -454,11 +454,7 @@ if __name__ == '__main__':
|
|||||||
options.append([test])
|
options.append([test])
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
|
a = input('\n\n\nPress return to run test {:}, or type in a new option number and press return:'.format(last_a))
|
||||||
if(int(last_a) == 0):
|
|
||||||
a = input('\n\n\nPlease type an option number and press return:')
|
|
||||||
else:
|
|
||||||
a = input('\n\n\nPress return to re-run test {:}, or type in a new option number and press return:'.format(last_a))
|
|
||||||
if a == '':
|
if a == '':
|
||||||
a = last_a
|
a = last_a
|
||||||
|
|
||||||
|
22
hw/production_test/run
Executable file
22
hw/production_test/run
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
if [ -e /etc/debian_version ]; then
|
||||||
|
dpkg -s python3-venv || sudo apt install python3-venv
|
||||||
|
fi
|
||||||
|
|
||||||
|
# their current venv might have gone funky...
|
||||||
|
if [ -e venv ] && [ ! -e wipedonce ]; then
|
||||||
|
rm -rf venv
|
||||||
|
touch wipedonce
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -e venv ]; then
|
||||||
|
python3 -m venv venv
|
||||||
|
. ./venv/bin/activate
|
||||||
|
pip3 install -r requirements.txt
|
||||||
|
else
|
||||||
|
. ./venv/bin/activate
|
||||||
|
fi
|
||||||
|
|
||||||
|
./production_test.py
|
Loading…
Reference in New Issue
Block a user