Skip to content

Commit

Permalink
regenerated M3 binaries after minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
jurgenvinju committed May 8, 2024
1 parent 860cd30 commit 6f9bac7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public loc snakesAndLaddersProject = unpackExampleProject("snakes-and-ladder
public list[loc] snakesClassPath = [snakesAndLaddersProject + "jexample-4.5-391.jar"];
public list[loc] snakesSourcePath = [snakesAndLaddersProject + "/src/"];

public bool OVERWRITE = false;

@synopsis{regression testing M3 on the JUnit project}
test bool junitM3RemainedTheSame() {
reference = readBinaryValueFile(#M3, junitBinaryM3);
Expand All @@ -52,36 +54,45 @@ test bool junitM3RemainedTheSame() {
javaVersion = JLS13());
result = composeJavaM3(|project://junit4|, models);

if (OVERWRITE) {
writeBinaryValueFile(junitBinaryM3, result);
}

return compareM3s(reference, result);
}

@synopsis{regression testing M3 on the Snakes-and-ladders project}
test bool snakesM3RemainedTheSame() {
reference = readBinaryValueFile(#M3, snakesAndLaddersBinaryM3);

root = snakesAndLaddersProject;

models = createM3sFromFiles(find(root + "src", "java"),
sourcePath = snakesSourcePath,
classPath = snakesClassPath,
javaVersion = JLS13());

result = composeJavaM3(|project://snakes-and-ladders/|, models);

if (OVERWRITE) {
writeBinaryValueFile(snakesAndLaddersBinaryM3, result);
}

return compareM3s(reference, result);
}

@synopsis{regression testing ASTs on the Junit4 project}
test bool junitASTsRemainedTheSame() {
reference = readBinaryValueFile(#set[Declaration], junitBinaryASTs);

root = junitProject;

asts = createAstsFromFiles(find(root + "src", "java"), true,
sourcePath = junitSourcePath,
classPath = junitClassPath,
javaVersion = JLS13());

if (OVERWRITE) {
writeBinaryValueFile(junitBinaryASTs, asts);
}

return reference == asts;
}

Expand All @@ -96,13 +107,20 @@ test bool snakesASTsRemainedTheSame() {
classPath = junitClassPath,
javaVersion = JLS13());

if (OVERWRITE) {
writeBinaryValueFile(snakesAndLaddersBinaryAST, asts);
}

return reference == asts;
}

@synopsis{Regression testing M3 extraction from .class files from a Hamcrest Jar file}
test bool hamcrestJarM3RemainedTheSame() {
reference = readBinaryValueFile(#M3, hamcrestBinaryM3);
result = createM3FromJar(hamcrestJar);
if (OVERWRITE) {
writeBinaryValueFile(hamcrestBinaryM3, result);
}
return compareM3s(reference, result);
}

Expand Down
Binary file modified test/org/rascalmpl/test/data/m3/junit4-m3s.bin
Binary file not shown.
Binary file modified test/org/rascalmpl/test/data/m3/snakes-and-ladders-m3s.bin
Binary file not shown.

0 comments on commit 6f9bac7

Please sign in to comment.