-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (35 loc) · 1.01 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Makefile
SHELL := /bin/bash
# Virtual environment directory
VENV := .env
# Python executable
PYTHON := $(VENV)/bin/python3
# pip executable
PIP := $(VENV)/bin/pip3
# Install dependencies
install-deps:
@echo "Installing dependencies..."
@python3 -m venv $(VENV)
@$(PIP) install lark
# Freeze dependencies
freeze-deps:
@echo "Freezing dependencies..."
@$(PIP) freeze > requirements.txt
# Run tests
tests: parser-check
# Run parser sanity check.
parser-check:
@echo "Running parser tests..."
@for file in tests/programs/*.bril; do \
filename=`basename "$$file" .bril`; \
cat "$$file" | $(PYTHON) -m bril.tools.bril2json; \
done
# Run optimizations sanity check.
optimizations-check:
@echo "Running optimizations tests..."
@for file in tests/transforms/dce/*.bril; do \
input_file=$$file; \
expected_file=$${file%.bril}.out; \
echo "Testing for input $$input_file against $$expected_file"; \
$(PYTHON) -m turnstile.turnstile --input $$input_file --expected $$expected_file --optimizations 'dce, lvn'; \
done