Skip to content

Commit 1e7c96e

Browse files
author
Dipto Pandit (dipandit)
committed
fix spell multiple run issue
1 parent 8ec9e89 commit 1e7c96e

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/adapter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { Log } from 'vscode-test-adapter-util';
55
import { loadSnort3Tests, snort3Test, runTest } from './snort3Test';
66
import {myStatusBarItem, buildtool} from './main';
77
import * as path from 'path';
8-
import * as PromisePool from 'es6-promise-pool';
98

109
class jobQueue {
1110
private jobdata = new Array<TestInfo|TestSuiteInfo>();
@@ -212,7 +211,8 @@ export class Snort3TestAdapter implements TestAdapter {
212211
}
213212
else return;
214213
}
215-
var test_pool = new PromisePool.default(testJobProducer, buildtool.get_concurrency());
214+
const PromisePool = require('es6-promise-pool');
215+
var test_pool = new PromisePool(testJobProducer, buildtool.get_concurrency());
216216
myStatusBarItem.text=`$(beaker~spin)`;
217217
test_pool.start().then(()=>{
218218
myStatusBarItem.text=`$(beaker)`;

src/snort3Test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ class snort3SpellCheck implements snort3Test {
4040
return new Promise((resolve)=>{
4141
testStatesEmitter.fire(<TestEvent>{ type: 'test', test: this.id, state: 'running' });
4242

43+
if(fs.existsSync(this.testpath+'/'+this.out_file))
44+
fs.unlinkSync(this.testpath+'/'+this.out_file);
45+
4346
let find_args:string = ' -name';
4447
if(this.type === 'source') find_args += ' *.cc -o -name *.[ch]';
4548
else find_args += ' *.txt ! -name *CMakeLists.txt ! -name *config_changes.txt';
@@ -64,7 +67,11 @@ class snort3SpellCheck implements snort3Test {
6467
if(!diff.pid || diff.signal) testStatesEmitter.fire(<TestEvent>{ type: 'test', test: this.id, state: 'errored' });
6568
else if (diff.status)
6669
testStatesEmitter.fire(<TestEvent>{ type: 'test', test: this.id, state: 'failed', tooltip:diff.stdout.toString() });
67-
else testStatesEmitter.fire(<TestEvent>{ type: 'test', test: this.id, state: 'passed' })
70+
else
71+
{
72+
testStatesEmitter.fire(<TestEvent>{ type: 'test', test: this.id, state: 'passed' });
73+
fs.unlink(this.testpath+'/'+this.out_file,()=>{});
74+
}
6875
resolve();
6976
});
7077

0 commit comments

Comments
 (0)