diff --git a/src/components/builder.ts b/src/components/builder.ts index e1cc2322d..68463924f 100644 --- a/src/components/builder.ts +++ b/src/components/builder.ts @@ -237,10 +237,9 @@ export class Builder { * the io handling is performed in {@link monitorProcess}. * * @param step The {@link Step} to be executed. - * @param cwd The current working directory. * @returns The process environment passed to the spawned process. */ - private spawnProcess(step: Step, cwd?: string): ProcessEnv { + private spawnProcess(step: Step): ProcessEnv { const configuration = vscode.workspace.getConfiguration('latex-workshop', step.rootFile ? vscode.Uri.file(step.rootFile) : undefined) if (step.index === 0 || configuration.get('latex.build.clearLog.everyRecipeStep.enabled') as boolean) { logger.clearCompilerMessage() @@ -268,13 +267,9 @@ export class Builder { this.process = cs.spawn(step.command, args, {cwd: path.dirname(step.rootFile), env}) } } else if (!step.isExternal) { + let cwd = path.dirname(step.rootFile) if (step.command === 'latexmk' && step.rootFile === lw.manager.localRootFile && lw.manager.rootDir) { cwd = lw.manager.rootDir - if (step.args && !step.args.includes('-cd')) { - step.args.push('-cd') - } - } else { - cwd = path.dirname(step.rootFile) } logger.log(`cwd: ${cwd}`) this.process = cs.spawn(step.command, step.args, {cwd, env}) diff --git a/test/fixtures/armory/subfile_subsub.tex b/test/fixtures/armory/subfile_subsub.tex index f88dbcbcb..412e3833e 100644 --- a/test/fixtures/armory/subfile_subsub.tex +++ b/test/fixtures/armory/subfile_subsub.tex @@ -1,5 +1,5 @@ \documentclass[../main.tex]{subfiles} \begin{document} sub sub -\input{./subsub/infile} +\input{./sub/subsub/infile} \end{document} diff --git a/test/suites/01_build.test.ts b/test/suites/01_build.test.ts index 46f144a82..2750a5adb 100644 --- a/test/suites/01_build.test.ts +++ b/test/suites/01_build.test.ts @@ -186,7 +186,7 @@ suite('Build TeX files test suite', () => { {src: 'subfile_subsub.tex', dst: 'sub/s.tex'}, {src: 'plain.tex', dst: 'sub/subsub/infile.tex'} ]) - await test.assert.build(fixture, 'sub/s.tex', 'sub/out/s.pdf') + await test.assert.build(fixture, 'sub/s.tex', 'out/s.pdf') }) test.run(suiteName, fixtureName, 'basic build with makeindex', async () => { @@ -201,7 +201,7 @@ suite('Build TeX files test suite', () => { {src: 'subfile_base.tex', dst: 'main.tex'}, {src: 'makeindex_subfile.tex', dst: 'sub/s.tex'} ]) - await test.assert.build(fixture, 'sub/s.tex', 'sub/out/s.pdf') + await test.assert.build(fixture, 'sub/s.tex', 'out/s.pdf') }) test.run(suiteName, fixtureName, 'test q/.../ with spaces in outdir on Windows', async () => { diff --git a/test/suites/04_intellisense.test.ts b/test/suites/04_intellisense.test.ts index 7a8cc297c..9e2cbe3d5 100644 --- a/test/suites/04_intellisense.test.ts +++ b/test/suites/04_intellisense.test.ts @@ -227,7 +227,7 @@ suite('Intellisense test suite', () => { assert.ok(!snippet.value.includes('${1:')) }) - test.only(suiteName, fixtureName, 'command intellisense with config `intellisense.command.user`', async () => { + test.run(suiteName, fixtureName, 'command intellisense with config `intellisense.command.user`', async () => { await vscode.workspace.getConfiguration('latex-workshop').update('intellisense.command.user', {'mycommand[]{}': 'notsamecommand[${2:option}]{$TM_SELECTED_TEXT$1}', 'parbox{}{}': 'defchanged', 'overline{}': ''}) await test.load(fixture, [ {src: 'intellisense/base.tex', dst: 'main.tex'}, @@ -309,24 +309,7 @@ suite('Intellisense test suite', () => { assert.ok(labels.includes('sec:1')) assert.ok(labels.includes('sec:2')) assert.ok(labels.includes('alt-sec:1')) - }, undefined, undefined, true) - - test.run(suiteName, fixtureName, 'reference intellisense with `xr` package', async () => { - await test.load(fixture, [ - {src: 'intellisense/xr_base.tex', dst: 'main.tex'}, - {src: 'intellisense/xr_sub.tex', dst: 'sub.tex'}, - {src: 'intellisense/xr_dup.tex', dst: 'dup.tex'} - ]) - const result = await test.open(fixture, 'main.tex') - const items = test.suggest(result.doc, new vscode.Position(6, 5)) - assert.ok(items) - assert.ok(items.length > 0) - - const labels = items.map(item => item.label.toString()) - assert.ok(labels.includes('sec:1')) - assert.ok(labels.includes('sec:2')) - assert.ok(labels.includes('alt-sec:1')) - }, undefined, undefined, true) + }) test.run(suiteName, fixtureName, 'environment intellisense', async () => { await test.load(fixture, [ diff --git a/test/suites/utils.ts b/test/suites/utils.ts index a463e4a58..94e594641 100644 --- a/test/suites/utils.ts +++ b/test/suites/utils.ts @@ -41,7 +41,7 @@ export function run(suiteName: string, fixtureName: string, testName: string, cb } testCounter++ - const testFunction = (process.env['LATEXWORKSHOP_CLI'] || !runonly) ? test : test.only + const testFunction = (process.env['LATEXWORKSHOP_CLI'] || !runonly) ? test : test.run const counterString = testCounter.toLocaleString('en-US', {minimumIntegerDigits: 3, useGrouping: false}) testFunction(`[${counterString}] ${suiteName}: ${testName}`, async () => {