From ee6b1388404cedbbe70afb0548fb2adca854444e Mon Sep 17 00:00:00 2001 From: Theodoros Theodoridis Date: Thu, 15 Feb 2024 12:41:17 +0100 Subject: [PATCH 1/3] [CSmithGenerator] Drop checksum from random flags Using --no-checksum forces Csmith to generate a volatile variable --- diopter/generator.py | 1 - 1 file changed, 1 deletion(-) diff --git a/diopter/generator.py b/diopter/generator.py index 842acb7..1bdb0e9 100644 --- a/diopter/generator.py +++ b/diopter/generator.py @@ -89,7 +89,6 @@ class CSmithGenerator(Generator): default_options_pool = [ "arrays", "bitfields", - "checksum", "comma-operators", "compound-assignment", "consts", From 97cc4621307189090274d0f53b3ac362a5ebca79 Mon Sep 17 00:00:00 2001 From: Theodoros Theodoridis Date: Thu, 15 Feb 2024 12:44:58 +0100 Subject: [PATCH 2/3] Update pre-commit hooks' versions and reformat --- .pre-commit-config.yaml | 8 ++++---- diopter/compiler.py | 9 ++++++--- diopter/reducer.py | 1 + diopter/sanitizer.py | 1 + 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cb403bd..d29636c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,19 +1,19 @@ repos: - repo: https://github.com/psf/black - rev: 23.3.0 + rev: 24.2.0 hooks: - id: black - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort args: ['--profile', 'black'] - repo: https://github.com/PyCQA/flake8 - rev: 6.0.0 + rev: 7.0.0 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.3.0 + rev: v1.8.0 hooks: - id: mypy additional_dependencies: [pytest >= 7.0.0] diff --git a/diopter/compiler.py b/diopter/compiler.py index 56cc279..8225821 100644 --- a/diopter/compiler.py +++ b/diopter/compiler.py @@ -47,6 +47,7 @@ # The output should be 2 assert output.stdout.strip() == "2" """ + from __future__ import annotations import argparse @@ -1185,9 +1186,11 @@ def get_compilation_cmd( str(self.compiler.exe), f"-{self.opt_level.name}", ), - (program[0].language.get_language_flag(),) - if include_language_flags - else ("",), + ( + (program[0].language.get_language_flag(),) + if include_language_flags + else ("",) + ), self.flags, (f"-I{path}" for path in self.include_paths), (f"-isystem{path}" for path in self.system_include_paths), diff --git a/diopter/reducer.py b/diopter/reducer.py index eefd86e..442385b 100644 --- a/diopter/reducer.py +++ b/diopter/reducer.py @@ -20,6 +20,7 @@ def test(self, program: SourceProgram) -> bool: if rprogram: #the reduction was successful """ + import inspect import logging import os diff --git a/diopter/sanitizer.py b/diopter/sanitizer.py index 8686f15..3ff8c9a 100644 --- a/diopter/sanitizer.py +++ b/diopter/sanitizer.py @@ -11,6 +11,7 @@ if not sanitizer.sanitize(program): # the program is broken """ + from __future__ import annotations import subprocess From dfa57a07b501c6a2a84be7fab1fcb85f20f8873a Mon Sep 17 00:00:00 2001 From: Theodoros Theodoridis Date: Thu, 15 Feb 2024 12:42:24 +0100 Subject: [PATCH 3/3] Bump version --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index cd2a31c..9e6e9ca 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = diopter -version = 0.0.26 +version = 0.0.27 author = Theodoros Theodoridis, Yann Girsberger author_email = theodort@inf.ethz.ch description = A library for building differential tests