Skip to content

Enable regression tests of weak memory model instrumentation #5937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 22, 2021

Conversation

tautschnig
Copy link
Collaborator

These regression tests are a selected subset (cf. README.txt) of the
full set of available tests (stored in goto-instrument-wmm-full.tgz),
and will ensure basic testing of the functionality implemented in
goto-instrument.

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@tautschnig tautschnig self-assigned this Mar 15, 2021
@tautschnig tautschnig force-pushed the wmm-tests branch 8 times, most recently from abc0896 to f4499e3 Compare March 17, 2021 22:20
@codecov
Copy link

codecov bot commented Mar 17, 2021

Codecov Report

Merging #5937 (947b913) into develop (4c58926) will increase coverage by 0.77%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #5937      +/-   ##
===========================================
+ Coverage    74.23%   75.01%   +0.77%     
===========================================
  Files         1431     1431              
  Lines       155291   155294       +3     
===========================================
+ Hits        115287   116499    +1212     
+ Misses       40004    38795    -1209     
Impacted Files Coverage Δ
src/util/simplify_expr_int.cpp 83.92% <0.00%> (+0.32%) ⬆️
src/goto-programs/goto_program.h 91.17% <0.00%> (+0.32%) ⬆️
src/goto-programs/goto_program.cpp 66.37% <0.00%> (+2.10%) ⬆️
src/pointer-analysis/value_set.cpp 82.63% <0.00%> (+3.26%) ⬆️
.../goto-instrument/goto_instrument_parse_options.cpp 67.90% <0.00%> (+4.67%) ⬆️
src/goto-instrument/wmm/event_graph.cpp 13.58% <0.00%> (+13.58%) ⬆️
src/assembler/remove_asm.cpp 50.71% <0.00%> (+13.87%) ⬆️
src/analyses/static_analysis.cpp 47.52% <0.00%> (+14.35%) ⬆️
src/util/graph.h 97.28% <0.00%> (+14.57%) ⬆️
src/pointer-analysis/value_set_analysis.h 37.50% <0.00%> (+25.00%) ⬆️
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1feb6e4...947b913. Read the comment docs.

Copy link
Collaborator

@martin-cs martin-cs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I must confess that I haven't read every line of this PR but I think I get the general picture. One concern : how often do the THOROUGH tests get run. Could we add it to the new version / release workflow?

@tautschnig
Copy link
Collaborator Author

I must confess that I haven't read every line of this PR but I think I get the general picture. One concern : how often do the THOROUGH tests get run. Could we add it to the new version / release workflow?

I'll create a separate PR for this.

Store the elements to be removed in a set until after the iteration is
done, and then remove the chosen elements. The more standard approach
could be returning the iterator to the next element in the
remove-an-element function, but this requires larger changes here. Thus
keeping it small and simple for now.
These regression tests are a selected subset (cf. README.txt) of the
full set of available tests (stored in goto-instrument-wmm-full.tgz),
and will ensure basic testing of the functionality implemented in
goto-instrument. Test specifications were updated to work with current
infrastructure.
Make all regression tests from the archive available (yet marking them as
THOROUGH or KNOWNBUG to avoid including them by default). This avoids having an
unused archive file bit-rotting in the repository. This commit was generated as
follows:

```

set -e

cd regression/goto-instrument-wmm-core/
tar xzf ../goto-instrument-wmm-full.tgz --strip-components=1
for f in $(tar tzf ../goto-instrument-wmm-full.tgz | sed 's#^goto-instrument-wmm-full/##')
do
  [ -f $f ] || continue
  if git status --porcelain $f | grep -q '^?'
  then
    if [[ $(basename $f) == "test.desc" ]]
    then
      sed -i '1s/^CORE$/THOROUGH/' $f
      if ! grep -q EXIT $f
      then
        if grep -q "VERIFICATION FAILED" $f
        then
          sed -i '/SIGNAL=0/ i ^EXIT=10$' $f
        else
          sed -i '/SIGNAL=0/ i ^EXIT=0$' $f
        fi
      fi
    elif [[ $f =~ \.c$ ]]
    then
      clang-format -i $f
    fi
    git add $f
  else
    git checkout -- $f
  fi
done
git rm ../goto-instrument-wmm-full.tgz

git commit -F - <<EOF
Add regression tests from goto-instrument-wmm-full.tgz

Make all regression tests from the archive available (yet marking them as
THOROUGH or KNOWNBUG to avoid including them by default). This avoids having an
unused archive file bit-rotting in the repository. This commit was generated as
follows:

\`\`\`
$(<../../script.sh)
\`\`\`
EOF
```
Tag all *_OPT tests "glpk" and exclude them from test runs by default as
we don't currently build with glpk by default.
Some of the tests that were previously imported as THOROUGH from the tar
archive actually are failing and require further investigation.
These tests currently pass and each of them completes in under 1 second.
@tautschnig tautschnig merged commit c923c3d into diffblue:develop Mar 22, 2021
@tautschnig tautschnig deleted the wmm-tests branch March 22, 2021 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants