Skip to content

Bump CBMC submodule and prettify JSON output #118

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
Jan 31, 2019

Conversation

chrisr-diffblue
Copy link
Contributor

No description provided.

By default, gnatcoll-json will generate 'compact' JSON - i.e. JSON
that has no line breaks or indentation. This is tricky to read when
debugging. This change tells gnatcoll-json not to compact the JSON
output.
The 'Comment' JSON object is only needed in the JSON schema to handle
naming of '#' in comment attributes. The final JSON output should
contain the comment attributes as part of the 'namedSub' object.
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.

Approve assuming CI issues are resolved.

Copy link
Contributor

@xbauch xbauch left a comment

Choose a reason for hiding this comment

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

Looks good.

Element_Type_Ent : constant Entity_Id := Get_Array_Component_Type (N);
Element_Type : constant Irep := Do_Type_Reference (Element_Type_Ent);
-- Element_Type_Ent : constant Entity_Id := Get_Array_Component_Type (N);
-- Element_Type : constant Irep := Do_Type_Reference (Element_Type_Ent);
StrLen : constant Integer :=
Integer (String_Length (Strval (N)));
String_Length_Expr : constant Irep := New_Irep (I_Constant_Expr);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this used anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Technically not, at the moment - but I think it will be again when we finally get types for string literals sorted out. The gnat compiler is happy enough for the moment though as String_Length_Expr gets passed into Set_Type/Set_Value. Happy to comment out these as well if people prefer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've commented out this currently unused code too.

Until we get proper types working for string literals, this
change allows cbmc to at least assert equality/inequality between
string literals. Even if we had proper array types for strings,
until we have arrays working, we can't do much with them - so this
is a reasonable halfway house for now.
@martin-cs
Copy link
Collaborator

All fine with me.

@chrisr-diffblue chrisr-diffblue merged commit c8785f1 into diffblue:master Jan 31, 2019
@martin-cs
Copy link
Collaborator

martin-cs commented Jan 31, 2019

Correction : please check the CI results; esp. the regression tests for packages.

@chrisr-diffblue
Copy link
Contributor Author

@martin-cs - I'm not seeing any test failures other than things that are XFAILED:

Summary: Ran 42/42 tests, with 0 failed, 0 crashed, 0 unexpectedly passed.
The command "(cd testsuite/gnat2goto; ./testsuite.py --timeout 60 --diffs --enable-color -j 2 )" exited with 0.
0.01s$ gnat2goto/install/bin/unit_tests
##########################################################
# Running suite: Floating point literals
##########################################################
Running test: Integer [Success]
Running test: Between 0 and 1 [Success]
Running test: General number [Success]
Running test: Negative Integer [Success]
Running test: Negative between 0 and 1 [Success]
Running test: General negative number [Success]
Running test: Zero [Success]
All 7 tests succeeded
##########################################################
# Running suite: Binary to hex
##########################################################
Running test: Converting 0 [Success]
Running test: Converting 2 [Success]
Running test: Converting 17 [Success]
Running test: Converting 138 [Success]
Running test: Converting 48879 [Success]
All 5 tests succeeded
The command "gnat2goto/install/bin/unit_tests" exited with 0.

@chrisr-diffblue
Copy link
Contributor Author

This is the CI build from before the submodule bump: https://travis-ci.org/diffblue/gnat2goto/builds/485435139

@martin-cs
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants