Skip to content
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

How to run a specific test case in the test suite? #161

Closed
zhangysh1995 opened this issue Jun 13, 2018 · 3 comments
Closed

How to run a specific test case in the test suite? #161

zhangysh1995 opened this issue Jun 13, 2018 · 3 comments
Labels

Comments

@zhangysh1995
Copy link

zhangysh1995 commented Jun 13, 2018

I use the following commands to run a test case that triggered the bug in Chart version 1:

defects4j  checkout -p Chart -v 1b -w ./chart1
defects4j export -p  tests.trigger -o failed.txt -w chart1/
vi failed.txt
defects4j test -w chart1/ -t org.jfree.chart.renderer.category.junit.AbstractCategoryItemRendererTests::test2947660

And got an error:

goods@yqzhang-PowerEdge-R830:/bigdata/zhangyushan/nonefound/chart/not_localized_result$ defects4j test -w chart1/ -t or
g.jfree.chart.renderer.category.junit.AbstractCategoryItemRendererTests::test2947660
Running ant (compile.tests)................................................ FAIL
OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
Buildfile: /Volume1/MBFL/defects4j/framework/projects/defects4j.build.xml

initialise:

compile:
    [javac] /Volume1/MBFL/defects4j/framework/projects/Chart/Chart.build.xml:56: warning: 'includeantruntime' was not $
et, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 654 source files to /bigdata/zhangyushan/nonefound/chart/not_localized_result/chart1/build
    [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.4
    [javac] error: Source option 1.4 is no longer supported. Use 1.6 or later.
    [javac] error: Target option 1.4 is no longer supported. Use 1.6 or later.

BUILD FAILED
/Volume1/MBFL/defects4j/framework/projects/Chart/Chart.build.xml:56: Compile failed; see the compiler error output for
details.

Total time: 0 seconds
Executed command:  cd /bigdata/zhangyushan/nonefound/chart/not_localized_result/chart1 && ant -f /Volume1/MBFL/defects4
j/framework/projects/defects4j.build.xml -Dd4j.home=/Volume1/MBFL/defects4j -Dbasedir=/bigdata/zhangyushan/nonefound/ch
art/not_localized_result/chart1  compile.tests 2>&1
Cannot compile test suite! at /Volume1/MBFL/defects4j/framework/bin/d4j/d4j-test line 134.
Compilation failed in require at /Volume1/MBFL/defects4j/framework/bin/defects4j line 155.

I tried to figure out the error with the scripts, but I cannot find the function call to compile_tests().

Java version:

goods@yqzhang-PowerEdge-R830:/bigdata/zhangyushan/nonefound/chart/not_localized_result$ java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
@rjust
Copy link
Owner

rjust commented Jun 13, 2018

Hi,

The OpenJDK 64-Bit Server VM warning indicates that you are running a Java-8+ compiler. There a multiple reasons for why the versions of java and javac could be different. Can you please check that 1) you have a Java-7 jdk (not just the jre) installed and 2) your environment is configured correctly (check, e.g., javac -version and whether JAVA_HOME is exported correctly).

Hope this helps.

Best,
René

PS The workflow that you described for finding and running a particular test is correct -- it's just a set-up issue.

@zhangysh1995
Copy link
Author

Sorry for late reply.

I use sdkman to manage the java environment, you could see the java version information here:

goods@yqzhang-PowerEdge-R830:~$ sdk use java 7.0.181-zulu

Using java version 7.0.181-zulu in this shell.
goods@yqzhang-PowerEdge-R830:~$ javac -version
javac 1.7.0_181
goods@yqzhang-PowerEdge-R830:~$ whereis java
java: /usr/bin/java /etc/java /usr/local/java /usr/share/java /home/goods/.sdkman/candidates/java/7.0.181-zulu/bin/java /usr/local/java/jdk1.7.0_80/bin/java /usr/share/man/man1/java.1.gz

I will check again with Oracle JDK 7 and update later.

@rjust
Copy link
Owner

rjust commented Aug 15, 2018

Is this still a problem for you?

@rjust rjust added the question label Aug 15, 2018
@rjust rjust closed this as completed Nov 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants