forked from runtimeverification/k
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathKompileModuleTest.java
More file actions
31 lines (26 loc) · 1.2 KB
/
KompileModuleTest.java
File metadata and controls
31 lines (26 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) 2014-2019 K Team. All Rights Reserved.
package org.kframework.kompile;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.util.Modules;
import org.junit.Test;
import org.kframework.kdep.KDepFrontEnd;
import org.kframework.main.FrontEnd;
import org.kframework.utils.BaseTestCase;
import static org.junit.Assert.*;
public class KompileModuleTest extends BaseTestCase {
@Test
public void testCreateInjection() {
String[] argv = new String[] { "test.k", "--backend", "test" };
Injector injector = Guice.createInjector(Modules.override(KompileFrontEnd.getModules()).with(new DefinitionSpecificTestModule(), new TestModule()));
prepInjector(injector, "-kompile", argv);
assertTrue(injector.getInstance(FrontEnd.class) instanceof KompileFrontEnd);
}
@Test
public void testKDep() {
String[] argv = new String[] { "test.k" };
Injector injector = Guice.createInjector(Modules.override(KDepFrontEnd.getModules()).with(new DefinitionSpecificTestModule(), new TestModule()));
prepInjector(injector, "-kdep", argv);
assertTrue(injector.getInstance(FrontEnd.class) instanceof KDepFrontEnd);
}
}