Skip to content

Tests for JBMC classpath problems #2733

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 2 commits into from
Aug 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.diffblue;

class Test
{
public static void main(String[] args)
{
assert true;
}
}
10 changes: 10 additions & 0 deletions jbmc/regression/jbmc/classpath-class-incorrect-package/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
KNOWNBUG
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the actual behaviour? Is there a bug ticket?

Copy link
Member Author

Choose a reason for hiding this comment

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

done #2864

Test.class
--classpath src
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the expected return code?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

^EXIT=6$
--
Java main class: Test
failed to open input file `Test.class'
--
Test.class is not in the right directory corresponding to its package.
Issue: 2864
Binary file not shown.
7 changes: 7 additions & 0 deletions jbmc/regression/jbmc/classpath-class-with-jar/Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class Test
{
public static void main(String[] args)
{
TestJar.foo();
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class TestJar
{
public static void foo()
{
assert false;
}
}
8 changes: 8 additions & 0 deletions jbmc/regression/jbmc/classpath-class-with-jar/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
Test.class
--classpath `../../../../scripts/format_classpath.sh src.jar .`
^EXIT=10$
^SIGNAL=0$
^VERIFICATION FAILED$
--
^warning: ignoring
Binary file not shown.
7 changes: 7 additions & 0 deletions jbmc/regression/jbmc/classpath-class-with-one-dir/Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class Test
{
public static void main(String[] args)
{
assert false;
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class Test
{
public static void main(String[] args)
{
assert true;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
test.class
-classpath my_cp:.
Test.class
--classpath src
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CORE symex-driven-lazy-loading-expected-failure
Test.class
--classpath wrong
^EXIT=6$
^SIGNAL=0$
the program has no entry point
--
--
We override the default path. Hence, Test cannot be found.
Currently fails because symex-driven lazy-loading aborts without an error message.
Copy link
Contributor

Choose a reason for hiding this comment

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

If this only fails with symex-driven lazy-loading, you can mark that test as CORE symex-driven-lazy-loading-expected-failure

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
KNOWNBUG
src/Test.class

Copy link
Contributor

Choose a reason for hiding this comment

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

Add expected return code.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

^EXIT=6$
--
Parsing src/Test.class
--
Test class is not in src package. Therefore, this must fail.
Issue: 2864
8 changes: 8 additions & 0 deletions jbmc/regression/jbmc/classpath-class-with-two-dirs/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
test.class
--classpath `../../../../scripts/format_classpath.sh my_cp .`
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
^warning: ignoring
9 changes: 9 additions & 0 deletions jbmc/regression/jbmc/classpath-invalid/test_jar_warning.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
KNOWNBUG
Test.class
--classpath ./NotHere.jar
^EXIT=0$
^SIGNAL=0$
^Warning: file './NotHere.jar' does not exist$
--
--
Issue: 2864
8 changes: 8 additions & 0 deletions jbmc/regression/jbmc/classpath-invalid/test_path_warning.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
KNOWNBUG
Test.class
--classpath `../../../../scripts/format_classpath.sh ./NotHere .`
^EXIT=0$
^SIGNAL=0$
^Warning: path './NotHere' does not exist$
--
--
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.diffblue;

class Test
{
public static void main(String[] args)
{
assert true;
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
KNOWNBUG
Test.class
--classpath test.jar
^EXIT=6$
--
Java main class: Test
failed to open input file `Test.class'
--
Test.class is not in the right directory corresponding to its package.
Issue: 2864
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
KNOWNBUG
test.jar
--main-class Test.class
^EXIT=6$
--
Java main class: Test
failed to open input file `Test.class'
--
Test.class is not in the right directory corresponding to its package.
Issue: 2864
8 changes: 8 additions & 0 deletions jbmc/regression/jbmc/classpath-jar-with-two-jars/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
C.jar
--function jarfile3.f -classpath `../../../../scripts/format_classpath.sh A.jar B.jar`
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL
--
^warning: ignoring
Binary file not shown.
8 changes: 8 additions & 0 deletions jbmc/regression/jbmc/classpath-two-classes/Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class Test
{
public static void main(String[] args)
{
Test2.foo();
assert true;
}
}
Binary file not shown.
7 changes: 7 additions & 0 deletions jbmc/regression/jbmc/classpath-two-classes/Test2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class Test2
{
public static void foo()
{
assert false;
}
}
8 changes: 8 additions & 0 deletions jbmc/regression/jbmc/classpath-two-classes/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
Test.class

^EXIT=10$
^VERIFICATION FAILED$
--
--
Test2 is found because . is default classpath.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
KNOWNBUG
Test.class
Test2.class
^EXIT=6$
--
Invariant check failed
--
We don't allow two classes passed on the command line.
Issue: 2864
8 changes: 8 additions & 0 deletions jbmc/regression/jbmc/classpath-two-jars/Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class Test
{
public static void main(String[] args)
{
Test2.foo();
assert true;
}
}
7 changes: 7 additions & 0 deletions jbmc/regression/jbmc/classpath-two-jars/Test2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class Test2
{
public static void foo()
{
assert false;
}
}
Binary file not shown.
Binary file not shown.
8 changes: 8 additions & 0 deletions jbmc/regression/jbmc/classpath-two-jars/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
libs/test.jar
--main-class Test --classpath lib/test2.jar
^EXIT=10$
^VERIFICATION FAILED$
--
--
This is a correct way of dealing with two jars.
8 changes: 8 additions & 0 deletions jbmc/regression/jbmc/classpath-two-jars/test2.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
lib/test2.jar
--main-class Test --classpath libs/test.jar
^EXIT=10$
^VERIFICATION FAILED$
--
--
This is a correct way of dealing with two jars.
10 changes: 10 additions & 0 deletions jbmc/regression/jbmc/classpath-two-jars/test_incorrect.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
KNOWNBUG
libs/test.jar
lib/test2.jar --main-class Test.class
^EXIT=6$
--
Invariant check failed
the program has no entry point
--
We don't allow two jar files passed on the command line.
Issue: 2864
8 changes: 8 additions & 0 deletions jbmc/regression/jbmc/classpath-two-jars/test_incorrect2.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
KNOWNBUG
Test.class
--classpath `../../../../scripts/format_classpath.sh libs/test.jar lib/test2.jar`
^EXIT=6$
--
--
This is incorrect as it would search for a Test.class file outside the jar files.
Issue: 2864
8 changes: 0 additions & 8 deletions jbmc/regression/jbmc/jar-file3/test.desc

This file was deleted.