mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2024-12-29 17:36:26 -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
|
||||
wipedonce
|
||||
|
@ -417,7 +417,7 @@ def run_tests(test_list):
|
||||
return True
|
||||
|
||||
if __name__ == '__main__':
|
||||
last_a = 0
|
||||
last_a = 1
|
||||
|
||||
# Allow any of the settings in the file_locations structure to be overridden
|
||||
import argparse
|
||||
@ -454,13 +454,9 @@ if __name__ == '__main__':
|
||||
options.append([test])
|
||||
i += 1
|
||||
|
||||
|
||||
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 == '':
|
||||
a = last_a
|
||||
a = input('\n\n\nPress return to run test {:}, or type in a new option number and press return:'.format(last_a))
|
||||
if a == '':
|
||||
a = last_a
|
||||
|
||||
try:
|
||||
test_sequence = options[int(a)-1]
|
||||
|
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