From 8214b686cea3f6ad57d7da49a44d33185fdeb098 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 18 Jul 2019 00:15:30 +0200 Subject: Refactor DenoDir (#2636) * rename `ModuleMetaData` to `SourceFile` and remove TS specific functionality * add `TsCompiler` struct encapsulating processing of TypeScript files * move `SourceMapGetter` trait implementation to `//cli/compiler.rs` * add low-level `DiskCache` API for general purpose caches and use it in `DenoDir` and `TsCompiler` for filesystem access * don't use hash-like filenames for compiled modules, instead use metadata file for storing compilation hash * add `SourceFileCache` for in-process caching of loaded files for fast subsequent access * define `SourceFileFetcher` trait encapsulating loading of local and remote files and implement it for `DenoDir` * define `use_cache` and `no_fetch` flags on `DenoDir` instead of using in fetch methods --- tools/deno_dir_test.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'tools/deno_dir_test.py') diff --git a/tools/deno_dir_test.py b/tools/deno_dir_test.py index ce5cffa90..042475a81 100755 --- a/tools/deno_dir_test.py +++ b/tools/deno_dir_test.py @@ -28,17 +28,23 @@ class TestDenoDir(DenoTestCase): self.run_deno() assert not os.path.isdir(deno_dir) + # TODO(bartlomieju): reenable or rewrite these tests + # now all cache directories are lazily created # Run deno with DENO_DIR env flag - self.run_deno(deno_dir) - assert os.path.isdir(deno_dir) - assert os.path.isdir(os.path.join(deno_dir, "deps")) - assert os.path.isdir(os.path.join(deno_dir, "gen")) - rmtree(deno_dir) + # self.run_deno(deno_dir) + # assert os.path.isdir(deno_dir) + # assert os.path.isdir(os.path.join(deno_dir, "deps")) + # assert os.path.isdir(os.path.join(deno_dir, "gen")) + # rmtree(deno_dir) def run_deno(self, deno_dir=None): - cmd = [self.deno_exe, "run", "tests/002_hello.ts"] + cmd = [ + self.deno_exe, "run", + "http://localhost:4545/tests/subdir/print_hello.ts" + ] deno_dir_env = {"DENO_DIR": deno_dir} if deno_dir is not None else None res = run_output(cmd, quiet=True, env=deno_dir_env) + print res.code, res.out, res.err self.assertEqual(res.code, 0) -- cgit v1.2.3