- Temporarily disable the deque test for the VS Code extension, as the Rust formatter seems to malfunction after a recent VS Code update. - Add configuration for iwasm host managed heap size, allowing users to flexibly `malloc` memory. This also fixes the current bug that when default size is 0, it can't run and debug. - Apply coding style formatting for WAMR IDE source code and add a format check for it in CI. - Update document and some screenshots.
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
/*
|
|
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
|
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
*/
|
|
|
|
import * as path from 'path';
|
|
import * as Mocha from 'mocha';
|
|
import * as glob from 'glob';
|
|
|
|
export function run(): Promise<void> {
|
|
// Create the mocha test
|
|
const mocha = new Mocha({
|
|
ui: 'tdd',
|
|
});
|
|
|
|
const testsRoot = path.resolve(__dirname, '..');
|
|
|
|
return new Promise((c, e) => {
|
|
glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {
|
|
if (err) {
|
|
return e(err);
|
|
}
|
|
|
|
// Add files to the test suite
|
|
files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
|
|
|
|
try {
|
|
// Run the mocha test
|
|
mocha.run(failures => {
|
|
if (failures > 0) {
|
|
e(new Error(`${failures} tests failed.`));
|
|
} else {
|
|
c();
|
|
}
|
|
});
|
|
} catch (err) {
|
|
console.error(err);
|
|
e(err);
|
|
}
|
|
});
|
|
});
|
|
}
|