mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-29 13:07:10 +00:00

This PR adds tests for #2219 by changing the `compilation_on_android_ubuntu.yml` workflow. The first run will take about two hours, since LLDB is built from scratch. Later, the build is cached and the whole job should not take more than three minutes. Core of the PR is an integration test that boots up vscode and lets it debug a test WASM file.
43 lines
868 B
TypeScript
43 lines
868 B
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);
|
|
}
|
|
});
|
|
});
|
|
}
|