From 38f76c1947358230ea5b4a53e70b5640fb0caa27 Mon Sep 17 00:00:00 2001 From: mpownby Date: Wed, 10 Jul 2024 17:10:22 -0600 Subject: [PATCH] Add files via upload Added integration test for mutation score threshold feature (mutation score should be 50%, we set our threshold to 49% and expect the test runner to still return success) --- .../runner/mutation-score-threshold/mull.yml | 5 +++++ .../runner/mutation-score-threshold/test.c | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 tests-lit/tests/runner/mutation-score-threshold/mull.yml create mode 100644 tests-lit/tests/runner/mutation-score-threshold/test.c diff --git a/tests-lit/tests/runner/mutation-score-threshold/mull.yml b/tests-lit/tests/runner/mutation-score-threshold/mull.yml new file mode 100644 index 00000000..86fa4594 --- /dev/null +++ b/tests-lit/tests/runner/mutation-score-threshold/mull.yml @@ -0,0 +1,5 @@ +mutators: + - cxx_init_const + - cxx_add_to_sub + +quiet: false diff --git a/tests-lit/tests/runner/mutation-score-threshold/test.c b/tests-lit/tests/runner/mutation-score-threshold/test.c new file mode 100644 index 00000000..40d26c00 --- /dev/null +++ b/tests-lit/tests/runner/mutation-score-threshold/test.c @@ -0,0 +1,17 @@ +int sum(int a, int b) { + return a + b; +} + +int main() { + int r = sum(2, 5) == 7; + return !r; +} + +// clang-format off + +/* + +RUN: %clang_cc %sysroot %s %pass_mull_ir_frontend -g -o %S/test.exe + +RUN: cd /; unset TERM; %mull_runner --mutation-score-threshold 49 %S/test.exe +*/