Skip to content

Commit

Permalink
Merge branch 'master' of github.com:rjust/defects4j into java-11-comp…
Browse files Browse the repository at this point in the history
…atibility
  • Loading branch information
rjust committed Oct 12, 2023
2 parents 8bb0012 + 4f7d4fe commit 6ae6d4a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions framework/core/Utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -534,11 +534,11 @@ sub ensure_valid_bid {
my $project_dir = "$PROJECTS_DIR/$pid";

if ( ! -e "${project_dir}" ) {
confess("Error: ${pid} is a non-existent project\n");
confess("Error: ${pid} is not a project id; for a list, see https://github.com/rjust/defects4j#the-projects\n");
}

if ( ! -e "${project_dir}/trigger_tests/${bid}" ) {
confess("Error: ${pid}-${bid} is a non-existent bug\n");
confess("Error: ${pid}-${bid} is a not a bug id; for a list, see ${project_dir}/trigger_tests\n");
}

# Instantiate the project and get the list of all active bug ids
Expand Down
7 changes: 7 additions & 0 deletions framework/lib/test_generation/bin/evosuite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ if [ $D4J_TEST_MODE != "regression" ]; then
die "Unsupported test mode: $D4J_TEST_MODE"
fi

# Confirm D4J_FILE_TARGET_CLASSES ends in a newline character. Not ending with a
# newline will lead to the below call to `wc -l` not counting the final line.
# This is very likely a mistake.
if [[ $(tail -c1 "$D4J_FILE_TARGET_CLASSES" | wc -l) -eq 0 ]]; then
die "File did not end in newline: $D4J_FILE_TARGET_CLASSES"
fi

# Compute the budget per target class; evenly split the time for search and assertions
num_classes=$(cat $D4J_FILE_TARGET_CLASSES | wc -l)
budget=$(echo "$D4J_TOTAL_BUDGET/2/$num_classes" | bc)
Expand Down

0 comments on commit 6ae6d4a

Please sign in to comment.