-
Notifications
You must be signed in to change notification settings - Fork 350
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
Master #510
base: master
Are you sure you want to change the base?
Master #510
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is a typo, please fix it so we can try the CI build/test again.
yeah sure @cyrille-artho |
Could you suggest me any changes, according to the errors the code encountered. @cyrille-artho |
Thanks! The build file works now, but one of the paths seems to be wrong, and
See the full log here: https://github.com/javapathfinder/jpf-core/actions/runs/12714274234/job/35472592178?pr=510 |
Thanks for quoting the issue @cyrille-artho . I would be working on the on some amendments and would come up with a new PR. |
Hey! @cyrille-artho could this issue be assigned to me? |
This is a PR, not an issue. I can assign an issue to you once you have made a successful PR. This version works better than the previous one, but it still results in build failures:
I can see that |
corrected the paths of C.java and D.java Added explicit dependencies in compileTestJava, compileModules, createJpfClassesJar
The build was successful on my system @cyrille-artho |
Great! I can confirm that the new build now works. This resolves the most difficult step.
|
@cyrille-artho Thanks!! I would surely be working on these two points and will revert back in a day. |
checks whether JPF incorrectly allows a static call to a non-static method. The test has passed and the build was successful.
I have created the test file and have successfully checked whether JPF incorrectly allows a static call to a non-static method. The build was successful. @cyrille-artho |
Hi,
So your test can try that and call If you adapt the test, it should first fail, because JPF does not check the |
I think it's a good idea to first try to get a "properly failing" test, so we are sure that the expected exception is checked against in the right way. After that, the one-line change in JPF to fix the test can easily be confirmed as valid by rerunning the test against the fix. |
@cyrille-artho Sure!! I would that and will revert back asap. I have understood the issue. Thank you @cyrille-artho for the clear guidance. It really makes easy for me to proceed towards next steps. |
When I am rebuilding, the exception is caught and the test fails with the message.
I have tested the failure case successfully and have made a PR to show it. But I am not able to get what can I do next. @cyrille-artho can you give me some suggestions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove temp. files and move the test files to the right place. You might not need C.java
anymore. Furthermore, the tests no longer compile, so please check your build.
__test__
Outdated
@@ -0,0 +1 @@ | |||
*** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove any temporary files in the PR. Change the test so any such files are removed at the end of the test.
src/main/gov/nasa/jpf/D.java
Outdated
@@ -0,0 +1,8 @@ | |||
package gov.nasa.jpf; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These files should be in src/test
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this file (as it is no longer needed, we have src/test/.../D.java
now.
src/main/java/C.java
Outdated
@@ -0,0 +1,7 @@ | |||
class C { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to src/test
.
src/main/java/D.java
Outdated
@@ -0,0 +1,3 @@ | |||
class D { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to src/test
.
As of now, some test files need to be moved to
|
…emporary files. Stored D.java in src/test. Updated dependencies for JUNIT5. The build was successful.
@cyrille-artho I have made the suggested changes for cleaning up files and removing them at the end. Made some dependency changes in build.gradle. Updated StaticCallToNonStaticTest.java. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, you have almost all the points resolved. There are a few changes remaining, but I hope they will be easy to do. Please see my comments.
src/main/gov/nasa/jpf/D.java
Outdated
@@ -0,0 +1,8 @@ | |||
package gov.nasa.jpf; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this file (as it is no longer needed, we have src/test/.../D.java
now.
src/test/C.java
Outdated
@@ -0,0 +1,7 @@ | |||
class C { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this file can be deleted, as testStaticCallToNonStatic
does not use it, and we don't need a standalone example; once testStaticCallToNonStatic
works as intended, it is simple enough to copy this to main
in an empty class if one wants a standalone program to run the test.
@Test | ||
public void testStaticCallToNonStatic() { | ||
// Create an instance of D | ||
D instance = new D(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove.
// Expect IncompatibleClassChangeError when calling instance.m() | ||
try { | ||
System.out.println("Calling m() method"); | ||
instance.m(); // This should throw IncompatibleClassChangeError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has to be D.m();
(like in C.java
).
|
||
// Expect IncompatibleClassChangeError when calling instance.m() | ||
try { | ||
System.out.println("Calling m() method"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The println
statement here can be deleted, as it is not desirable in a unit test to print to the console.
Thank you very much! The process is mostly working now, but you accidentally changed the static to a dynamic call in the test; please see my comments. Another thing I have not commented on, for some reason, this time, only one test (for your new feature) was run, rather than over 1000 tests. I don't know if this is due to change in the build/test process in |
Having now tried a clean clone with the test, I see that there is a problem with the new build dependencies.
We want |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding build dependencies.
build.gradle
Outdated
@@ -76,16 +114,20 @@ tasks.named('compilePeersJava') { | |||
tasks.named('compileTestJava') { | |||
dependsOn(copyLibs) | |||
dependsOn(copyResources) | |||
mustRunAfter(modifyAndCompileD) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is reversed. I am not very familiar with the Gradle DSL, and the documentation is not 100 % clear, but this dependency and others (even some that have been declared previously) might be redundant or reversed. Please look at the dependencies and ensure that the original unit tests are preserved, so we have again over 1000 tests in the CI build/test.
You can check this by running ./gradlew clean test
.
@cyrille-artho I will work on the suggestions and will make changes ensuring that the original tests are preserved. |
@cyrille-artho If the method |
Deleted C.java Removed instance statement with D.m() Removed D.java from src/tests/gov/nasa/jpf/ D.java is in src/test The build was successful Updated dependency at line 116 in build.gradle, now that is not reversed I think.
Hey @cyrille-artho I have made the suggested changes. I think now the issues is solved and the build was also successful. And the dependency issue is solved I think. |
Please try the build/test on your system before pushing: |
Integrated a mechanism to detect and prevent invalid INVOKESTATIC calls by validating method properties during runtime in JPF (line 274).
Optimized the test pipeline by using Gradle-native methods to manage input-output dependencies, ensuring task portability and proper execution order.