Commit 2e6bf733 by lwc-tester

compile_all.py now accepts a submissions directory

parent e78ab7e8
...@@ -93,7 +93,6 @@ def find_test_vectors(d): ...@@ -93,7 +93,6 @@ def find_test_vectors(d):
def main(argv): def main(argv):
submissions_dir = "all-lwc-submission-files"
include_list = None include_list = None
# Parse the arguments # Parse the arguments
...@@ -101,15 +100,18 @@ def main(argv): ...@@ -101,15 +100,18 @@ def main(argv):
description='Compiles all LWC submissions for a given template') description='Compiles all LWC submissions for a given template')
argparser.add_argument('-v', '--verbose', action='count') argparser.add_argument('-v', '--verbose', action='count')
argparser.add_argument('-t', '--template', default='templates/linux')
argparser.add_argument('-b', '--build-dir')
argparser.add_argument('-i', '--include', action='append') argparser.add_argument('-i', '--include', action='append')
argparser.add_argument('-t', '--template', default='templates/linux')
argparser.add_argument('-b', '--build-dir', default='build')
argparser.add_argument('-s', '--submissions-dir',
default='all-lwc-submission-files')
args = argparser.parse_args(argv[1:]) args = argparser.parse_args(argv[1:])
template_dir = args.template template_dir = args.template
build_root_dir = args.build_dir build_root_dir = args.build_dir
include_list = args.include include_list = args.include
submissions_dir = args.submissions_dir
print("Using template %s" % template_dir) print("Using template %s" % template_dir)
subs = os.listdir(submissions_dir) subs = os.listdir(submissions_dir)
......
...@@ -5,8 +5,9 @@ shopt -s extglob ...@@ -5,8 +5,9 @@ shopt -s extglob
export PYTHONPATH="$PYTHONPATH:$(pwd)" export PYTHONPATH="$PYTHONPATH:$(pwd)"
function run() { function run() {
TEMPLATE="$1" SUBMISSION="$1"
DESTDIR="$2" TEMPLATE="$2"
DESTDIR="$3"
if [[ ! -d "templates/$TEMPLATE" ]]; then if [[ ! -d "templates/$TEMPLATE" ]]; then
echo "Template '$TEMPLATE' does not exist" echo "Template '$TEMPLATE' does not exist"
...@@ -29,7 +30,7 @@ function run() { ...@@ -29,7 +30,7 @@ function run() {
mkdir -p $DESTDIR mkdir -p $DESTDIR
echo "Compiling for template '$TEMPLATE' in directory '$TMPDIR'" echo "Compiling for template '$TEMPLATE' in directory '$TMPDIR'"
./compile_all.py -t "templates/$TEMPLATE" -b "$TMPDIR" ./compile_all.py -s $SUBMISSION -t "templates/$TEMPLATE" -b "$TMPDIR"
for cipher in $TMPDIR/*; do for cipher in $TMPDIR/*; do
if [[ ! -d $cipher ]]; then continue; fi if [[ ! -d $cipher ]]; then continue; fi
...@@ -73,7 +74,7 @@ function run() { ...@@ -73,7 +74,7 @@ function run() {
} }
if [[ $1 == "run" ]]; then if [[ $1 == "run" ]]; then
run $2 $3 run $2 $3 $4
else else
ZIP_PATH="$1" ZIP_PATH="$1"
if [[ ! -f $ZIP_PATH ]]; then if [[ ! -f $ZIP_PATH ]]; then
...@@ -89,7 +90,7 @@ else ...@@ -89,7 +90,7 @@ else
TEMPLATE="${i##*/}" TEMPLATE="${i##*/}"
echo "Template is $TEMPLATE" echo "Template is $TEMPLATE"
touch $MAINDIR/locky.lock touch $MAINDIR/locky.lock
flock $MAINDIR/locky.lock $0 run $TEMPLATE $MAINDIR/$TEMPLATE flock $MAINDIR/locky.lock $0 run $TMPDIR $TEMPLATE $MAINDIR/$TEMPLATE
done done
rm -rf $TMPDIR rm -rf $TMPDIR
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment