mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Add WASM FunC autotests (#673)
* feat: func wasm autotests * fixes necessary for func wasm autotests --------- Co-authored-by: krigga <krigga7@gmail.com>
This commit is contained in:
parent
8d919a5db9
commit
8b0d6a2665
6 changed files with 172 additions and 3 deletions
27
crypto/func/auto-tests/legacy_tester.js
Normal file
27
crypto/func/auto-tests/legacy_tester.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
const fs = require('fs/promises');
|
||||
const { compileWasm, compileFile } = require('./wasm_tests_common');
|
||||
|
||||
async function main() {
|
||||
const tests = JSON.parse((await fs.readFile('../legacy_tests.json')).toString('utf-8'))
|
||||
|
||||
for (const [filename, hashstr] of tests) {
|
||||
if (filename.includes('storage-provider')) continue;
|
||||
|
||||
const mod = await compileWasm()
|
||||
|
||||
const response = await compileFile(mod, filename);
|
||||
|
||||
if (response.status !== 'ok') {
|
||||
console.error(response);
|
||||
throw new Error('Could not compile ' + filename);
|
||||
}
|
||||
|
||||
if (BigInt('0x' + response.codeHashHex) !== BigInt(hashstr)) {
|
||||
throw new Error('Compilation result is different for ' + filename);
|
||||
}
|
||||
|
||||
console.log(filename, 'ok');
|
||||
}
|
||||
}
|
||||
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue