@@ -73,6 +73,40 @@ class JmhTests extends ScalaCliSuite with JmhSuite with BspSuite {
73
73
}
74
74
}
75
75
76
+ test(s " setup-ide + bsp ( $testMessage) " ) {
77
+ val inputs = simpleBenchmarkingInputs(directiveString)
78
+ inputs.fromRoot { root =>
79
+ os.proc(TestUtil .cli, " setup-ide" , " --power" , extraOptions, " ." , jmhOptions)
80
+ .call(cwd = root)
81
+ val ideOptionsPath = root / Constants .workspaceDirName / " ide-options-v2.json"
82
+ expect(ideOptionsPath.toNIO.toFile.exists())
83
+ val ideLauncherOptsPath = root / Constants .workspaceDirName / " ide-launcher-options.json"
84
+ expect(ideLauncherOptsPath.toNIO.toFile.exists())
85
+ val ideEnvsPath = root / Constants .workspaceDirName / " ide-envs.json"
86
+ expect(ideEnvsPath.toNIO.toFile.exists())
87
+ val jsonOptions = List (
88
+ " --json-options" ,
89
+ ideOptionsPath.toString,
90
+ " --json-launcher-options" ,
91
+ ideLauncherOptsPath.toString,
92
+ " --envs-file" ,
93
+ ideEnvsPath.toString
94
+ )
95
+ withBsp(inputs, Seq (" ." ), bspOptions = jsonOptions, reuseRoot = Some (root)) {
96
+ (_, _, remoteServer) =>
97
+ async {
98
+ val buildTargetsResp = await(remoteServer.workspaceBuildTargets().asScala)
99
+ val targets = buildTargetsResp.getTargets.asScala.map(_.getId).toSeq
100
+ expect(targets.length == 2 )
101
+
102
+ val compileResult =
103
+ await(remoteServer.buildTargetCompile(new b.CompileParams (targets.asJava)).asScala)
104
+ expect(compileResult.getStatusCode == b.StatusCode .OK )
105
+ }
106
+ }
107
+ }
108
+ }
109
+
76
110
test(s " package ( $testMessage) " ) {
77
111
// TODO make package with --jmh build an artifact that actually runs benchmarks
78
112
val expectedMessage = " Placeholder main method"
0 commit comments