stevedlawrence commented on code in PR #1452:
URL: https://github.com/apache/daffodil-vscode/pull/1452#discussion_r2417067466
##########
src/tests/suite/daffodil.test.ts:
##########
@@ -166,72 +175,76 @@ suite('Daffodfil', () => {
})
})
- suite('getDaffodilVersion', () => {
- test('getDaffodilVersion returns same version as file', () => {
- var daffodilVersion = daffodil.getDaffodilVersion(packageFile)
- assert.strictEqual(daffodilVersion, '0.0.0')
- })
- })
-
- suite('non-debug specific commands', () => {
- const nonDebugSpecificCmds = [
- 'extension.dfdl-debug.debugEditorContents',
- 'extension.dfdl-debug.runEditorContents',
- 'extension.dfdl-debug.debugLastEditorContents',
- 'extension.dfdl-debug.executeTDML',
- ]
-
- // This breaks when the omega-edit tests run for some reason
- // test('Available by default', () => {
- // nonDebugSpecificCmds.forEach(async (cmd) => {
- // assert.strictEqual(
- // (await vscode.commands.getCommands()).includes(cmd),
- // true
- // )
- // })
- // })
-
- test('Not available when inDebugMode', () => {
- vscode.commands.executeCommand('setContext', 'inDebugMode', true)
-
- nonDebugSpecificCmds.forEach(async (cmd) => {
- assert.strictEqual(
- (await vscode.commands.getCommands()).includes(cmd),
- false
- )
- })
+ suite('daffodilScalaVersions', () => {
+ test('daffodilScalaVersions returns the same versions as file', () => {
+ var daffodilScalaVersions =
daffodil.getDaffodilScalaVersions(packageFile)
+ assert.strictEqual(daffodilScalaVersions['<=3.10.0,<3.11.0'], '2.12')
+ assert.strictEqual(daffodilScalaVersions['>=3.11.0,<4.0.0'], '2.13')
+ assert.strictEqual(daffodilScalaVersions['>=4.0.0'], '3')
})
})
- suite('debug specific commands', () => {
- const debugSpecificCmds = [
- 'extension.dfdl-debug.toggleFormatting',
- 'infoset.display',
- 'infoset.diff',
- 'infoset.save',
- ]
-
- test('Not available by default', () => {
- debugSpecificCmds.forEach(async (cmd) => {
- assert.strictEqual(
- (await vscode.commands.getCommands()).includes(cmd),
- false
- )
- })
- })
-
- // This breaks when the omega-edit tests run for some reason
- // test('Available when inDebugMode', () => {
- // vscode.commands.executeCommand('setContext', 'inDebugMode', true)
-
- // debugSpecificCmds.forEach(async (cmd) => {
- // assert.strictEqual(
- // (await vscode.commands.getCommands()).includes(cmd),
- // true
- // )
- // })
- // })
- })
+ // This breaks when the omega-edit tests run for some reason
+ // suite('non-debug specific commands', () => {
+ // const nonDebugSpecificCmds = [
+ // 'extension.dfdl-debug.debugEditorContents',
+ // 'extension.dfdl-debug.runEditorContents',
+ // 'extension.dfdl-debug.debugLastEditorContents',
+ // 'extension.dfdl-debug.executeTDML',
+ // ]
+
+ // test('Available by default', () => {
+ // nonDebugSpecificCmds.forEach(async (cmd) => {
+ // assert.strictEqual(
+ // (await vscode.commands.getCommands()).includes(cmd),
+ // true
+ // )
+ // })
+ // })
+
+ // test('Not available when inDebugMode', () => {
+ // vscode.commands.executeCommand('setContext', 'inDebugMode', true)
+
+ // nonDebugSpecificCmds.forEach(async (cmd) => {
+ // assert.strictEqual(
+ // (await vscode.commands.getCommands()).includes(cmd),
+ // false
+ // )
+ // })
+ // })
+ // })
+
+ // This breaks when the omega-edit tests run for some reason
+ // suite('debug specific commands', () => {
+ // const debugSpecificCmds = [
+ // 'extension.dfdl-debug.toggleFormatting',
+ // 'infoset.display',
+ // 'infoset.diff',
+ // 'infoset.save',
+ // ]
+
+ // // This breaks when the omega-edit tests run for some reason
+ // test('Not available by default', () => {
+ // debugSpecificCmds.forEach(async (cmd) => {
+ // assert.strictEqual(
+ // (await vscode.commands.getCommands()).includes(cmd),
+ // false
+ // )
+ // })
+ // })
+
+ // // This breaks when the omega-edit tests run for some reason
+ // test('Available when inDebugMode', () => {
+ // vscode.commands.executeCommand('setContext', 'inDebugMode', true)
+
+ // debugSpecificCmds.forEach(async (cmd) => {
+ // assert.strictEqual(
+ // (await vscode.commands.getCommands()).includes(cmd),
+ // true
+ // )
+ // })
+ // })
+ // })
Review Comment:
Did this change break a number of tests, or was this just reorganization of
already broken tests?
##########
build.sbt:
##########
@@ -221,3 +183,134 @@ lazy val xjcSettings =
cachedFun(Set(daffodilLibJar)).toSeq
}
)
+
+lazy val `daffodil-debugger` = project
+ .in(file("."))
+ .settings(commonSettings, ratSettings)
+ .settings(publish / skip := true)
+ .aggregate(debuggers.projectRefs: _*)
+
+/** Since using projectMatrix, there will be a debugger, debugger2_12 and
debugger3 target. The debugger target is for
+ * Daffodil 3.11.0 and Scala 2.13. The debugger2_12 target is for Daffodil
3.10.0 and Scala 2.12. The debugger3 target
+ * is for Daffodil 4.0.0 and Scala 3. (only availabe when using JDK 17+)
+ *
+ * When running something like "sbt test" that will run all targets. To use a
single target do one of: sbt
+ * debugger/test OR sbt debugger2_12/test OR sbt debugger3/test. Based on
which version of the debugger you are
+ * targeting.
+ */
+lazy val debuggers = {
+ val debugger = (projectMatrix in (file("debugger")))
+ .enablePlugins(BuildInfoPlugin, JavaAppPackaging, UniversalPlugin,
ClasspathJarPlugin, SbtXjcPlugin)
+ .settings(commonSettings)
+ .settings(xjcSettings)
+ .settings(
+ name := "daffodil-debugger",
+ scalacOptions ++= buildScalacOptions(scalaBinaryVersion.value),
+ javacOptions ++= buildJavacOptions(scalaBinaryVersion.value),
+ libraryDependencies ++= Seq(
+ /* NOTE: To support Java 8:
+ * logback-classic can not go above version 1.2.11.
+ * com.microsoft.java.debug.core can not go above version 0.34.0.
+ * jansi can not go above version 1.18.
+ */
+ // scala-steward:off
+ "ch.qos.logback" % "logback-classic" % "1.2.11",
+ "com.microsoft.java" % "com.microsoft.java.debug.core" % "0.34.0",
+ "org.fusesource.jansi" % "jansi" % "1.18",
+ // scala-steward:on
+ "co.fs2" %% "fs2-io" % "3.12.0",
+ "com.monovore" %% "decline-effect" % "2.5.0",
+ "org.typelevel" %% "log4cats-slf4j" % "2.7.1",
+ "org.scalameta" %% "munit" % "1.1.1" % Test
+ ),
+ buildInfoPackage := "org.apache.daffodil.debugger.dap",
+ buildInfoKeys := Seq[BuildInfoKey](
+ name,
+ version,
+ scalaVersion,
+ sbtVersion
+ ),
+ packageName := s"${name.value}-${scalaBinaryVersion.value}",
+ // This allowed for having common code between scala 2.12 and 2.13 so
its not duplicated
+ Compile / unmanagedSourceDirectories ++= {
+ val v = scalaBinaryVersion.value
+ if (v == "2.12" || v == "2.13")
+ Seq((Compile / sourceDirectory).value / "scala-2")
+ else
+ Nil
+ }
Review Comment:
I don't think this is needed. I'm pretty sure SBT already adds "scala-2" as
a source directory for 2.12 and 2.13 builds.
##########
package.json:
##########
@@ -685,8 +689,18 @@
},
"dfdlDebugger": {
"type": "object",
- "description": "Configuration for debugger. Settings are
logging (level and file)",
+ "description": "Configuration for debugger. Settings are
version (any valid Daffodil version), timeout and logging (level and file)",
"properties": {
+ "version": {
+ "type": "string",
+ "default": "3.11.0",
Review Comment:
It would be nice if this was the only place where 3.11.0 as the default. I
think it appears in a few other places, making it harder to update what th
default is.
##########
package.json:
##########
@@ -685,8 +689,18 @@
},
"dfdlDebugger": {
"type": "object",
- "description": "Configuration for debugger. Settings are
logging (level and file)",
+ "description": "Configuration for debugger. Settings are
version (any valid Daffodil version), timeout and logging (level and file)",
"properties": {
+ "version": {
+ "type": "string",
+ "default": "3.11.0",
+ "description": "Debugger version to use. Any Daffodil
version is valid"
Review Comment:
Suggest we call this "Daffodil version to use".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]