Permalink
Browse files

upgrade to version 4.0.4 of randoop; use replacecall agent for rando…

…op coverage
  • Loading branch information...
markro49 authored and mernst committed May 29, 2018
1 parent 3a654fa commit ce8a8b4e7a5776eb6abcc2b03a116249d5b5a8be
Showing with 20 additions and 3 deletions.
  1. +9 −1 framework/core/Project.pm
  2. +5 −1 framework/test/README.md
  3. +6 −1 init.sh
@@ -888,15 +888,23 @@ sub run_randoop {
# and set appropriate arguments.
my $log = `java -cp $TESTGEN_LIB_DIR/randoop-current.jar randoop.main.Main`;
if (($log =~ /minimize/) == 1) {
if (($log =~ /4.0/) == 1) {
# print "new version \n";
$config = "$config --time-limit=$timeout --flaky-test-behavior=output";
} else {
# print "middle version \n";
$config = "$config --time-limit=$timeout --ignore-flaky-tests=true";
}
} else {
# print "old version \n";
$config = "$config --timelimit=$timeout --ignore-flaky-tests=true";
}
my $cmd = "cd $self->{prog_root}" .
" && java -ea -classpath $cp:$TESTGEN_LIB_DIR/randoop-current.jar randoop.main.Main gentests " .
" && java -ea -classpath $cp:$TESTGEN_LIB_DIR/randoop-current.jar " .
"-Xbootclasspath/a:$TESTGEN_LIB_DIR/replacecall-current.jar " .
"-javaagent:$TESTGEN_LIB_DIR/replacecall-current.jar=--replacement-file=$TESTGEN_LIB_DIR/default-replacements.txt " .
"randoop.main.Main gentests " .
"$target_classes " .
"--junit-output-dir=randoop " .
"--usethreads " .
@@ -36,8 +36,12 @@ more details about the defects and requirements).
- `export TESTGEN_LIB_DIR="path2directory-containing-randoop-current.jar"`
The randoop.jar you wish to test must be named randoop-current.jar.
By default, the system runs version 4.0.3 of Randoop,
By default, the system runs version 4.0.4 of Randoop,
located at "path2defects4j"/framework/lib/test_generation/generation/randooop-current.jar.
If you change the default version of randoop-current.jar you must also copy the
matching version of replacecall.jar to replacecall-current.jar in the same location as
randoop-current.jar. Finally, you must extract the replacements file from replacecall-current.jar:
- `(cd "path2replacecall-current.jar" && jar -xf replacecall-current.jar default-replacements.txt)`
2. Run the test generation and coverage analysis:
- `./randoop_coverage.sh`
@@ -68,13 +68,18 @@ cd "$DIR_LIB_RT" && [ ! -f "$EVOSUITE_RT_JAR" ] \
#
echo
echo "Setting up Randoop ... "
RANDOOP_VERSION="4.0.3"
RANDOOP_VERSION="4.0.4"
RANDOOP_URL="https://github.com/randoop/randoop/releases/download/v${RANDOOP_VERSION}"
RANDOOP_JAR="randoop-all-${RANDOOP_VERSION}.jar"
REPLACECALL_JAR="replacecall-${RANDOOP_VERSION}.jar"
cd "$DIR_LIB_GEN" && [ ! -f "$RANDOOP_JAR" ] \
&& wget -nv "$RANDOOP_URL/$RANDOOP_JAR"
cd "$DIR_LIB_GEN" && [ ! -f "$REPLACECALL_JAR" ] \
&& wget -nv "$RANDOOP_URL/$REPLACECALL_JAR"
# Set symlink for the supported version of Randoop
(cd "$DIR_LIB_GEN" && ln -sf "$RANDOOP_JAR" "randoop-current.jar")
(cd "$DIR_LIB_GEN" && ln -sf "$REPLACECALL_JAR" "replacecall-current.jar")
(cd "$DIR_LIB_GEN" && jar -xf "$REPLACECALL_JAR" "default-replacements.txt")
################################################################################
#

0 comments on commit ce8a8b4

Please sign in to comment.