Skip to content

Commit 5b71f9d

Browse files
committed
Remove prebuilt jsons
1 parent 04fb56f commit 5b71f9d

File tree

11 files changed

+9
-39785
lines changed

11 files changed

+9
-39785
lines changed

usvm-dataflow-ts/src/test/kotlin/org/usvm/dataflow/ts/test/EtsTypeInferenceTest.kt

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import org.jacodb.ets.dto.EtsFileDto
3333
import org.jacodb.ets.dto.convertToEtsFile
3434
import org.jacodb.ets.model.EtsFile
3535
import org.jacodb.ets.model.EtsScene
36-
import org.junit.jupiter.api.Disabled
36+
import org.jacodb.ets.utils.loadEtsFileAutoConvert
3737
import org.junit.jupiter.api.Test
3838
import org.junit.jupiter.api.TestFactory
3939
import org.junit.jupiter.api.condition.EnabledIf
@@ -46,7 +46,6 @@ import org.usvm.dataflow.ts.infer.TypeInferenceResult
4646
import org.usvm.dataflow.ts.infer.annotation.EtsTypeAnnotator
4747
import org.usvm.dataflow.ts.infer.createApplicationGraph
4848
import org.usvm.dataflow.ts.infer.dto.toType
49-
import org.usvm.dataflow.ts.loadEtsFileFromResource
5049
import org.usvm.dataflow.ts.loadEtsProjectFromResources
5150
import org.usvm.dataflow.ts.testFactory
5251
import org.usvm.dataflow.ts.util.EtsTraits
@@ -66,14 +65,14 @@ class EtsTypeInferenceTest {
6665

6766
companion object {
6867
private fun load(path: String): EtsFile {
69-
return loadEtsFileFromResource("/$path")
68+
return loadEtsFileAutoConvert(getResourcePath(path))
7069
}
7170
}
7271

7372
@Test
7473
fun `type inference for microphone`() {
7574
val name = "microphone"
76-
val file = load("ir/$name.ts.json")
75+
val file = load("/ts/$name.ts")
7776
val project = EtsScene(listOf(file))
7877
val graph = createApplicationGraph(project)
7978

@@ -112,7 +111,7 @@ class EtsTypeInferenceTest {
112111
@Test
113112
fun `type inference for types`() {
114113
val name = "types"
115-
val file = load("ir/$name.ts.json")
114+
val file = load("/ts/$name.ts")
116115
val project = EtsScene(listOf(file))
117116
val graph = createApplicationGraph(project)
118117

@@ -131,7 +130,7 @@ class EtsTypeInferenceTest {
131130
@Test
132131
fun `type inference for data`() {
133132
val name = "data"
134-
val file = load("ir/$name.ts.json")
133+
val file = load("/ts/$name.ts")
135134
val project = EtsScene(listOf(file))
136135
val graph = createApplicationGraph(project)
137136

@@ -150,7 +149,7 @@ class EtsTypeInferenceTest {
150149
@Test
151150
fun `type inference for call`() {
152151
val name = "call"
153-
val file = load("ir/$name.ts.json")
152+
val file = load("/ts/$name.ts")
154153
val project = EtsScene(listOf(file))
155154
val graph = createApplicationGraph(project)
156155

@@ -169,27 +168,7 @@ class EtsTypeInferenceTest {
169168
@Test
170169
fun `type inference for nested_init`() {
171170
val name = "nested_init"
172-
val file = load("ir/$name.ts.json")
173-
val project = EtsScene(listOf(file))
174-
val graph = createApplicationGraph(project)
175-
176-
val entrypoints = project.projectClasses
177-
.flatMap { it.methods }
178-
.filter { it.name.startsWith("entrypoint") }
179-
println("entrypoints: (${entrypoints.size})")
180-
entrypoints.forEach {
181-
println(" ${it.signature.enclosingClass.name}::${it.name}")
182-
}
183-
184-
val manager = TypeInferenceManager(EtsTraits(), graph)
185-
manager.analyze(entrypoints)
186-
}
187-
188-
@Disabled("EtsIR-ABC is outdated")
189-
@Test
190-
fun `type inference for cast ABC`() {
191-
val name = "cast"
192-
val file = load("abcir/$name.abc.json")
171+
val file = load("/ts/$name.ts")
193172
val project = EtsScene(listOf(file))
194173
val graph = createApplicationGraph(project)
195174

@@ -314,7 +293,7 @@ class EtsTypeInferenceTest {
314293
@Test
315294
fun `test if guesser does anything`() {
316295
val name = "testcases"
317-
val file = load("ir/$name.ts.json")
296+
val file = load("/ts/$name.ts")
318297
val project = EtsScene(listOf(file))
319298
val graph = createApplicationGraph(project)
320299

@@ -347,7 +326,7 @@ class EtsTypeInferenceTest {
347326

348327
@TestFactory
349328
fun `type inference on testcases`() = testFactory {
350-
val file = load("ir/testcases.ts.json")
329+
val file = load("/ts/testcases.ts")
351330
val project = EtsScene(listOf(file))
352331
val graph = createApplicationGraph(project)
353332

0 commit comments

Comments
 (0)