Skip to content

Commit 6f5d7c4

Browse files
Merge pull request diffblue#2733 from peterschrammel/test-classpath
Tests for JBMC classpath problems
2 parents 1351169 + 3e2c1ce commit 6f5d7c4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+219
-10
lines changed
Binary file not shown.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.diffblue;
2+
3+
class Test
4+
{
5+
public static void main(String[] args)
6+
{
7+
assert true;
8+
}
9+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
KNOWNBUG
2+
Test.class
3+
--classpath src
4+
^EXIT=6$
5+
--
6+
Java main class: Test
7+
failed to open input file `Test.class'
8+
--
9+
Test.class is not in the right directory corresponding to its package.
10+
Issue: 2864
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Test
2+
{
3+
public static void main(String[] args)
4+
{
5+
TestJar.foo();
6+
}
7+
}
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class TestJar
2+
{
3+
public static void foo()
4+
{
5+
assert false;
6+
}
7+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
Test.class
3+
--classpath `../../../../scripts/format_classpath.sh src.jar .`
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^VERIFICATION FAILED$
7+
--
8+
^warning: ignoring
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Test
2+
{
3+
public static void main(String[] args)
4+
{
5+
assert false;
6+
}
7+
}
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Test
2+
{
3+
public static void main(String[] args)
4+
{
5+
assert true;
6+
}
7+
}

jbmc/regression/jbmc/classpath1/test.desc renamed to jbmc/regression/jbmc/classpath-class-with-one-dir/test.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
2-
test.class
3-
-classpath my_cp:.
2+
Test.class
3+
--classpath src
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CORE symex-driven-lazy-loading-expected-failure
2+
Test.class
3+
--classpath wrong
4+
^EXIT=6$
5+
^SIGNAL=0$
6+
the program has no entry point
7+
--
8+
--
9+
We override the default path. Hence, Test cannot be found.
10+
Currently fails because symex-driven lazy-loading aborts without an error message.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
KNOWNBUG
2+
src/Test.class
3+
4+
^EXIT=6$
5+
--
6+
Parsing src/Test.class
7+
--
8+
Test class is not in src package. Therefore, this must fail.
9+
Issue: 2864
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
test.class
3+
--classpath `../../../../scripts/format_classpath.sh my_cp .`
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
^warning: ignoring
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
KNOWNBUG
2+
Test.class
3+
--classpath ./NotHere.jar
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^Warning: file './NotHere.jar' does not exist$
7+
--
8+
--
9+
Issue: 2864
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
KNOWNBUG
2+
Test.class
3+
--classpath `../../../../scripts/format_classpath.sh ./NotHere .`
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^Warning: path './NotHere' does not exist$
7+
--
8+
--
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.diffblue;
2+
3+
class Test
4+
{
5+
public static void main(String[] args)
6+
{
7+
assert true;
8+
}
9+
}
Binary file not shown.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
KNOWNBUG
2+
Test.class
3+
--classpath test.jar
4+
^EXIT=6$
5+
--
6+
Java main class: Test
7+
failed to open input file `Test.class'
8+
--
9+
Test.class is not in the right directory corresponding to its package.
10+
Issue: 2864
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
KNOWNBUG
2+
test.jar
3+
--main-class Test.class
4+
^EXIT=6$
5+
--
6+
Java main class: Test
7+
failed to open input file `Test.class'
8+
--
9+
Test.class is not in the right directory corresponding to its package.
10+
Issue: 2864
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
C.jar
3+
--function jarfile3.f -classpath `../../../../scripts/format_classpath.sh A.jar B.jar`
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL
7+
--
8+
^warning: ignoring
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Test
2+
{
3+
public static void main(String[] args)
4+
{
5+
Test2.foo();
6+
assert true;
7+
}
8+
}
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Test2
2+
{
3+
public static void foo()
4+
{
5+
assert false;
6+
}
7+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
Test.class
3+
4+
^EXIT=10$
5+
^VERIFICATION FAILED$
6+
--
7+
--
8+
Test2 is found because . is default classpath.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
KNOWNBUG
2+
Test.class
3+
Test2.class
4+
^EXIT=6$
5+
--
6+
Invariant check failed
7+
--
8+
We don't allow two classes passed on the command line.
9+
Issue: 2864
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Test
2+
{
3+
public static void main(String[] args)
4+
{
5+
Test2.foo();
6+
assert true;
7+
}
8+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Test2
2+
{
3+
public static void foo()
4+
{
5+
assert false;
6+
}
7+
}
Binary file not shown.
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
libs/test.jar
3+
--main-class Test --classpath lib/test2.jar
4+
^EXIT=10$
5+
^VERIFICATION FAILED$
6+
--
7+
--
8+
This is a correct way of dealing with two jars.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
lib/test2.jar
3+
--main-class Test --classpath libs/test.jar
4+
^EXIT=10$
5+
^VERIFICATION FAILED$
6+
--
7+
--
8+
This is a correct way of dealing with two jars.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
KNOWNBUG
2+
libs/test.jar
3+
lib/test2.jar --main-class Test.class
4+
^EXIT=6$
5+
--
6+
Invariant check failed
7+
the program has no entry point
8+
--
9+
We don't allow two jar files passed on the command line.
10+
Issue: 2864
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
KNOWNBUG
2+
Test.class
3+
--classpath `../../../../scripts/format_classpath.sh libs/test.jar lib/test2.jar`
4+
^EXIT=6$
5+
--
6+
--
7+
This is incorrect as it would search for a Test.class file outside the jar files.
8+
Issue: 2864

jbmc/regression/jbmc/jar-file3/test.desc

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)