зеркало из https://github.com/github/codeql.git
Use the TestPaths helper to lookup files.
This commit is contained in:
Родитель
a773532d07
Коммит
63854e36b4
|
@ -12,6 +12,7 @@ import com.semmle.jcorn.SyntaxError;
|
|||
import com.semmle.js.ast.AST2JSON;
|
||||
import com.semmle.js.ast.Program;
|
||||
import com.semmle.util.io.WholeIO;
|
||||
import com.semmle.util.tests.TestPaths;
|
||||
import java.io.File;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map.Entry;
|
||||
|
@ -54,7 +55,7 @@ public abstract class ASTMatchingTests {
|
|||
}
|
||||
}
|
||||
|
||||
private static final File BABYLON_BASE = new File("parser-tests/babylon").getAbsoluteFile();
|
||||
private static final File BABYLON_BASE = TestPaths.get("parser-tests/babylon").toAbsolutePath().toFile();
|
||||
|
||||
protected void babylonTest(String dir) {
|
||||
babylonTest(dir, new Options().esnext(true));
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.semmle.js.ast.AST2JSON;
|
|||
import com.semmle.js.ast.Program;
|
||||
import com.semmle.util.files.FileUtil;
|
||||
import com.semmle.util.io.WholeIO;
|
||||
import com.semmle.util.tests.TestPaths;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -25,7 +26,7 @@ import org.junit.runners.Parameterized.Parameters;
|
|||
*/
|
||||
@RunWith(Parameterized.class)
|
||||
public class JSXTests extends ASTMatchingTests {
|
||||
private static final File BASE = new File("parser-tests/jcorn-jsx").getAbsoluteFile();
|
||||
private static final File BASE = TestPaths.get("parser-tests/jcorn-jsx").toAbsolutePath().toFile();
|
||||
|
||||
@Parameters(name = "{0}")
|
||||
public static Iterable<Object[]> tests() {
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.semmle.js.extractor.test;
|
|||
import com.semmle.jcorn.Options;
|
||||
import com.semmle.jcorn.Parser;
|
||||
import com.semmle.util.io.WholeIO;
|
||||
import com.semmle.util.tests.TestPaths;
|
||||
import java.io.File;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import org.junit.Test;
|
||||
|
@ -11,7 +12,7 @@ public class RobustnessTests {
|
|||
|
||||
@Test
|
||||
public void letLookheadTest() {
|
||||
File test = new File("parser-tests/robustness/letLookahead.js");
|
||||
File test = TestPaths.get("parser-tests/robustness/letLookahead.js").toFile();
|
||||
String src = new WholeIO(StandardCharsets.UTF_8.name()).strictread(test);
|
||||
new Parser(new Options(), src, 0).parse();
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import com.semmle.util.extraction.ExtractorOutputConfig;
|
|||
import com.semmle.util.io.WholeIO;
|
||||
import com.semmle.util.process.Env;
|
||||
import com.semmle.util.srcarchive.DummySourceArchive;
|
||||
import com.semmle.util.tests.TestPaths;
|
||||
import com.semmle.util.trap.ITrapWriterFactory;
|
||||
import com.semmle.util.trap.TrapWriter;
|
||||
import com.semmle.util.trap.pathtransformers.ProjectLayoutTransformer;
|
||||
|
@ -35,7 +36,7 @@ import org.junit.runners.Parameterized.Parameters;
|
|||
|
||||
@RunWith(Parameterized.class)
|
||||
public class TrapTests {
|
||||
private static final File BASE = new File("tests").getAbsoluteFile();
|
||||
private static final File BASE = TestPaths.get("tests").toAbsolutePath().toFile();
|
||||
|
||||
@Parameters(name = "{0}:{1}")
|
||||
public static Iterable<Object[]> tests() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче