diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e86eac5..5e2aebc 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -26,6 +26,22 @@ jobs: - name: Test with Maven run: mvn -B --update-snapshots compile test + - name: Publish Test Reports + if: ${{ !cancelled() }} + uses: ctrf-io/github-test-reporter@v1 + with: + report-path: 'target/rascal-test-reports/*.json' + github-report: true + file-report: true + pull-request-report: true + summary-delta-report: true + insights-report: true + fail-rate-report: true + slowest-report: true + upload-artifact: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Attach artifact id: build-artifact uses: SWAT-engineering/maven-full-artifacts-action@v1 diff --git a/pom.xml b/pom.xml index c3a0494..281867a 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ org.rascalmpl rascal-maven-plugin - 0.30.3 + 0.32.0-RC7 false ${project.build.outputDirectory} @@ -81,6 +81,13 @@ compile + + it-test + test + + test + + default-cli compile @@ -88,7 +95,6 @@ tutor - true false ${project.build.outputDirectory} |http://github.com/usethesource/clair/blob/main| @@ -119,43 +125,15 @@ -Drascal.compile.skip -DskipTests -Drascal.tutor.skip - - org.apache.maven.plugins - maven-surefire-plugin - 3.0.0-M3 - - - test - test - - - -ea - -Xmx2G - -Xss128m - -Dfile.encoding=UTF-8 - - - **/*Tests.java - - ${basedir}/src/ - - - - - - junit - junit - 4.13.1 - org.rascalmpl rascal - 0.41.2 + 0.43.0-RC17 compile diff --git a/src/lang/cpp/internal/BindingsResolver.java b/src/lang/cpp/internal/BindingsResolver.java index 1f4da82..5115867 100644 --- a/src/lang/cpp/internal/BindingsResolver.java +++ b/src/lang/cpp/internal/BindingsResolver.java @@ -135,7 +135,7 @@ public class BindingsResolver { public ISetWriter containment; private ISourceLocation translationUnit; - private ISourceLocation translationUnitRoot = URIUtil.rootLocation("cpp+translationUnit"); + private ISourceLocation translationUnitRoot = URIUtil.rootLocation("cpp+translationunit"); private void out(String msg) { // stdOut.println(spaces() + msg.replace("\n", "\n" + spaces())); @@ -170,7 +170,7 @@ public BindingsResolver(IValueFactory vf, PrintWriter stdOut, PrintWriter stdErr this.vf = vf; this.stdErr = stdErr; this.containment = vf.setWriter(); - this.translationUnit = URIUtil.rootLocation("cpp+translationUnit"); + this.translationUnit = URIUtil.rootLocation("cpp+translationunit"); this.NYI = makeBinding("NYI", null, null); this.FIXME = makeBinding("FIXME", null, null); } @@ -183,9 +183,9 @@ private ISourceLocation ownedBinding(IBinding binding, String scheme, String pos String name = renameOperators(binding.getName()) + postfix; ISourceLocation ownerLocation = resolveOwner(binding, origin); ISourceLocation location = null; - boolean isAtRoot = "cpp+translationUnit".equals(ownerLocation.getScheme()); + boolean isAtRoot = "cpp+translationunit".equals(ownerLocation.getScheme()); - // * When we are at the root, we want a different parent from |cpp+translationUnit:///| as containment parent; name it should contain the file name from `translationUnit` + // * When we are at the root, we want a different parent from |cpp+translationunit:///| as containment parent; name it should contain the file name from `translationUnit` // * Also when we are the root, `static` variables and functions need to be prefixed with the file name because they are local to the current translationUnit if (isStatic) { diff --git a/src/lang/cpp/internal/Parser.java b/src/lang/cpp/internal/Parser.java index 126c9fa..3dd87fd 100644 --- a/src/lang/cpp/internal/Parser.java +++ b/src/lang/cpp/internal/Parser.java @@ -209,6 +209,7 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics; import org.eclipse.core.runtime.CoreException; import org.rascalmpl.debug.IRascalMonitor; +import org.rascalmpl.ast.AbstractAST; import org.rascalmpl.exceptions.RuntimeExceptionFactory; import org.rascalmpl.interpreter.Evaluator; import org.rascalmpl.uri.URIUtil; @@ -303,7 +304,7 @@ public IList parseFiles(IList files, IString charset, IBool inferCharset, IList IASTTranslationUnit tu = parser.parseFileAsCpp(file, charset, inferCharset); try { IValue result = convertCdtToRascal(tu, false); - ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationUnit", "", file.getPath()); + ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationunit", "", file.getPath()); result = ((IConstructor) result).asWithKeywordParameters().setParameter("decl", tuDecl); asts.append(result); } @@ -330,11 +331,11 @@ public IValue parseC(ISourceLocation file, IString charset, IBool inferCharset, try { IValue result = convertCdtToRascal(tu, false); - ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationUnit", "", file.getPath()); + ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationunit", "", file.getPath()); result = ((IConstructor) result).asWithKeywordParameters().setParameter("decl", tuDecl); if (result == null) { - throw RuntimeExceptionFactory.parseError(file, null, null); + throw RuntimeExceptionFactory.parseError(file, (AbstractAST) null, null); } return result; } @@ -358,10 +359,10 @@ public IValue parseCpp(ISourceLocation file, IString charset, IBool inferCharset try { IValue result = convertCdtToRascal(tu, false); - ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationUnit", "", file.getPath()); + ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationunit", "", file.getPath()); result = ((IConstructor) result).asWithKeywordParameters().setParameter("decl", tuDecl); if (result == null) { - throw RuntimeExceptionFactory.parseError(file, null, null); + throw RuntimeExceptionFactory.parseError(file, (AbstractAST) null, null); } return result; } @@ -380,7 +381,7 @@ public ITuple parseCToM3AndAst(ISourceLocation file, IString charset, IBool infe this.stdLib = stdLib; IValue m3 = builder.M3_m3(file); - ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationUnit", "", file.getPath()); + ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationunit", "", file.getPath()); br.setTranslationUnit(tuDecl); CDTParser parser = new CDTParser(vf,stdOut, stdErr, stdLib, includeDirs, standardMacros, additionalMacros, includeStdLib.getValue()); @@ -438,7 +439,7 @@ public ITuple parseCppToM3AndAst(ISourceLocation file, IString charset, IBool in this.stdLib = stdLib; IValue m3 = builder.M3_m3(file); - ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationUnit", "", file.getPath()); + ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationunit", "", file.getPath()); br.setTranslationUnit(tuDecl); CDTParser parser = new CDTParser(vf, stdOut, stdErr, stdLib, includeDirs, standardMacros, additionalMacros, includeStdLib.getValue()); @@ -621,7 +622,7 @@ public IValue parseString(IString code, ISourceLocation loc) throws CoreExceptio try { IValue result = convertCdtToRascal(tu, false); - ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationUnit", "", loc == null ? "" : loc.getPath()); + ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationunit", "", loc == null ? "" : loc.getPath()); return ((IConstructor) result).asWithKeywordParameters().setParameter("decl", tuDecl); } catch (NullPointerException e) { @@ -650,7 +651,7 @@ public IValue convertCdtToRascal(IASTTranslationUnit translationUnit, boolean to stack.iterator().forEachRemaining(it -> err(it.toString())); ISourceLocation file = locs.forNode(translationUnit); - ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationUnit", "", file.getPath()); + ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationunit", "", file.getPath()); return ast.asWithKeywordParameters().setParameter("decl", tuDecl); } @@ -823,7 +824,7 @@ public int visit(IASTTranslationUnit tu) { boolean isMacroExpansion = isMacroExpansion(tu); IListWriter declarations = vf.listWriter(); ISourceLocation tuLoc = locs.forNode(tu); - ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationUnit", "", tuLoc.getPath()); + ISourceLocation tuDecl = URIUtil.correctLocation("cpp+translationunit", "", tuLoc.getPath()); monitor.jobStart("ClaiR AST marshalling"); declLoop: for (IASTDeclaration declaration : tu.getDeclarations()) { diff --git a/src/lang/cpp/internal/RunTests.java b/src/lang/cpp/internal/RunTests.java deleted file mode 100644 index c43d9cc..0000000 --- a/src/lang/cpp/internal/RunTests.java +++ /dev/null @@ -1,12 +0,0 @@ -package lang.cpp.internal; - -import org.junit.runner.RunWith; -import org.rascalmpl.test.infrastructure.RascalJUnitTestPrefix; -import org.rascalmpl.test.infrastructure.RascalJUnitTestRunner; - -@RunWith(RascalJUnitTestRunner.class) -@RascalJUnitTestPrefix("lang::cpp") -public class RunTests { - // nothing goes here. The test runner picks up all the Rascal source files from the - // src folder automaticall and starts loading and running their tests. -}