Skip to content

Commit

Permalink
made the benchmark:// scheme superfluous and replaced it with a norma…
Browse files Browse the repository at this point in the history
…l source folder configured in RASCAL.MF. Also used findResources to get access to resources in the source folders to run the RSF benchmarks
  • Loading branch information
jurgenvinju committed Sep 12, 2023
1 parent 309e333 commit faa93cf
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 20 deletions.
2 changes: 1 addition & 1 deletion META-INF/RASCAL.MF
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Project-Name: rascal
Source: src/org/rascalmpl/library
Source: src/org/rascalmpl/library,test/org/rascalmpl/benchmark
Courses: src/org/rascalmpl/courses


Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ public void contributePaths(List<ISourceLocation> l) {
try {
l.add(vf.sourceLocation("std","",""));
l.add(vf.sourceLocation("testdata","",""));
l.add(vf.sourceLocation("test-modules","",""));
l.add(vf.sourceLocation("benchmarks","",""));
l.add(vf.sourceLocation("test-modules","",""));
}
catch (URISyntaxException e) {
assert false;
Expand All @@ -76,7 +75,7 @@ public void contributePaths(List<ISourceLocation> l) {

@Override
public String toString() {
return "[std://, testdata://, test-modules://, benchmarks://]";
return "[std://, testdata://, test-modules://]";
}

@Override
Expand Down
4 changes: 3 additions & 1 deletion src/org/rascalmpl/test/infrastructure/TestFramework.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ public class TestFramework {
evaluator.addRascalSearchPathContributor(StandardLibraryContributor.getInstance());

evaluator.addRascalSearchPath(URIUtil.rootLocation("test-modules"));
evaluator.addRascalSearchPath(URIUtil.rootLocation("benchmarks"));

RascalJUnitTestRunner.configureProjectEvaluator(evaluator, RascalJUnitTestRunner.inferProjectRoot(TestFramework.class));

try {
assert (false);
throw new RuntimeException("Make sure you enable the assert statement in your run configuration ( add -ea )");
Expand Down
9 changes: 0 additions & 9 deletions src/org/rascalmpl/uri/libraries/BenchmarkURIResolver.java

This file was deleted.

1 change: 0 additions & 1 deletion src/org/rascalmpl/uri/resolvers.config
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ org.rascalmpl.uri.file.CWDURIResolver
org.rascalmpl.uri.file.SystemPathURIResolver
org.rascalmpl.uri.libraries.TestDataURIResolver
org.rascalmpl.uri.libraries.MemoryResolver
org.rascalmpl.uri.libraries.BenchmarkURIResolver
org.rascalmpl.uri.libraries.RascalLibraryURIResolver
org.rascalmpl.shell.ManifestURIResolver
7 changes: 3 additions & 4 deletions test/org/rascalmpl/benchmark/RSF/RSFCalls.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module RSF::RSFCalls
import Relation;
import util::Math;
import Set;
import analysis::graphs::Graph;
import analysis::graphs::Graph;
import lang::rsf::IO;
import IO;
import util::Benchmark;
Expand All @@ -29,11 +29,10 @@ public bool measureOne(){
}

public bool measure(list[str] names){

loc p = |benchmarks:///RSF/|;
loc p = {loc x} := findResources("RSF") ? x : |not-found:///|;

for(str name <- names){
map[str, rel[str,str]] values = readRSF(p[path= p.path + name]);
map[str, rel[str,str]] values = readRSF(p + name);
rel[str,str] CALL = values["CALL"];
n = size(CALL);
println("<name>: CALL contains <n> tuples");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ private static Evaluator freshEvaluator() {
var evaluator = new Evaluator(ValueFactoryFactory.getValueFactory(), System.in, System.err, System.out, root, heap);
evaluator.addRascalSearchPathContributor(StandardLibraryContributor.getInstance());
evaluator.addRascalSearchPath(URIUtil.rootLocation("test-modules"));
evaluator.addRascalSearchPath(URIUtil.rootLocation("benchmarks"));

evaluator.setTestResultListener(new ITestResultListener() {
@Override
Expand Down

0 comments on commit faa93cf

Please sign in to comment.