diff --git a/MiniC/test_codegen.py b/MiniC/test_codegen.py index 5cb0294..05228cb 100755 --- a/MiniC/test_codegen.py +++ b/MiniC/test_codegen.py @@ -6,7 +6,7 @@ import pytest import glob from test_expect_pragma import ( TestExpectPragmas, TestCompiler, - filter_pathnames, cat + cat ) """ @@ -69,21 +69,21 @@ MINIC_EVAL = os.path.join( # MINIC_EVAL = os.path.join( # HERE, '..', '..', 'TP03', 'MiniC-type-interpret', 'Main.py') -# Avoid duplicates -ALL_IN_MEM_FILES = list(set(ALL_FILES) | set(ALLOC_FILES)) -ALL_IN_MEM_FILES.sort() -ALL_FILES = list(set(ALL_FILES)) -ALL_FILES.sort() - if 'TEST_FILES' in os.environ: ALLOC_FILES = ALL_FILES ALL_IN_MEM_FILES = ALL_FILES +ALL_IN_MEM_FILES = list(set(ALL_FILES) | set(ALLOC_FILES)) if 'FILTER' in os.environ: - ALL_FILES = filter_pathnames(ALL_FILES, os.environ['FILTER']) - ALLOC_FILES = filter_pathnames(ALLOC_FILES, os.environ['FILTER']) - ALL_IN_MEM_FILES = filter_pathnames(ALL_IN_MEM_FILES, os.environ['FILTER']) + FILTER_FILES = glob.glob(os.path.join(HERE, os.environ['FILTER']), recursive=True) + ALL_FILES = list(set(FILTER_FILES) & set(ALL_FILES)) + ALLOC_FILES = list(set(FILTER_FILES) & set(ALLOC_FILES)) + ALL_IN_MEM_FILES = list(set(FILTER_FILES) & set(ALL_IN_MEM_FILES)) +# Avoid duplicates +ALL_IN_MEM_FILES.sort() +ALL_FILES = list(set(ALL_FILES)) +ALL_FILES.sort() class TestCodeGen(TestExpectPragmas, TestCompiler): DISABLE_CODEGEN = DISABLE_CODEGEN diff --git a/MiniC/test_interpreter.py b/MiniC/test_interpreter.py index 1da3fe2..9095ba3 100755 --- a/MiniC/test_interpreter.py +++ b/MiniC/test_interpreter.py @@ -5,7 +5,7 @@ import os import sys from test_expect_pragma import ( TestExpectPragmas, cat, - TestCompiler, filter_pathnames + TestCompiler ) HERE = os.path.dirname(os.path.realpath(__file__)) @@ -34,7 +34,8 @@ if 'TEST_FILES' in os.environ: MINIC_EVAL = os.path.join(IMPLEM_DIR, 'MiniCC.py') if 'FILTER' in os.environ: - ALL_FILES = filter_pathnames(ALL_FILES, os.environ['FILTER']) + FILTER_FILES = glob.glob(os.path.join(HERE, os.environ['FILTER']), recursive=True) + ALL_FILES = list(set(FILTER_FILES) & set(ALL_FILES)) class TestInterpret(TestExpectPragmas, TestCompiler): diff --git a/TP03/tp3.pdf b/TP03/tp3.pdf index 84a6c46..84dc914 100644 Binary files a/TP03/tp3.pdf and b/TP03/tp3.pdf differ diff --git a/TP04/tp4a.pdf b/TP04/tp4a.pdf index b2cdd05..604e689 100644 Binary files a/TP04/tp4a.pdf and b/TP04/tp4a.pdf differ