-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
47 lines (38 loc) · 1.03 KB
/
makefile
File metadata and controls
47 lines (38 loc) · 1.03 KB
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
45
46
47
# Define the directory containing test files
TEST_DIR := test
# Define the directory containing output files
OUTPUT_DIR := test
# Define the command to run for each test file
TEST_COMMAND := ./main.exe
# Define the python command
PYTHON_COMMAND := python
# Find all .txt files recursively in the test directory
TEST_FILES := $(wildcard $(TEST_DIR)/*/*.txt)
build:
@echo "Compiling Files"
@dune build
python:
@python3 main.py
# Define a target to run the command for each test file
run_tests:
@echo "Creating python files..."
@for file in $(TEST_FILES); do \
$(TEST_COMMAND) -silent $$file; \
if [ $$? -ne 0 ]; then \
echo "Error running test $$file"; \
exit 1; \
fi; \
done
@echo "Cormen Pseudocode successfully compiled."
run_debug:
@echo "Creating python files..."
@for file in $(TEST_FILES); do \
$(TEST_COMMAND) $$file; \
if [ $$? -ne 0 ]; then \
echo "Error running test $$file"; \
exit 1; \
fi; \
done
@echo "Cormen Pseudocode successfully compiled."
test: build run_tests python
debug: build run_debug