Merge branch 'master' into filedecoratorplugin

pull/2668/head
Aniket 2 years ago committed by GitHub
commit 9ef7ddac9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      libs/remix-tests/src/run.ts

@ -64,7 +64,7 @@ commander
// If path is for a file, file name must have `_test.sol` suffix // If path is for a file, file name must have `_test.sol` suffix
if (!isDirectory && !testsPath.endsWith('_test.sol')) { if (!isDirectory && !testsPath.endsWith('_test.sol')) {
log.error('Test filename should end with "_test.sol"') log.error('Test filename should end with "_test.sol"')
process.exit() process.exit(1)
} }
// Console message // Console message
@ -85,7 +85,7 @@ commander
const compString = releases ? releases[compVersion] : null const compString = releases ? releases[compVersion] : null
if (!compString) { if (!compString) {
log.error(`No compiler found in releases with version ${compVersion}`) log.error(`No compiler found in releases with version ${compVersion}`)
process.exit() process.exit(1)
} else { } else {
compilerConfig.currentCompilerUrl = compString.replace('soljson-', '').replace('.js', '') compilerConfig.currentCompilerUrl = compString.replace('soljson-', '').replace('.js', '')
log.info(`Compiler version set to ${compVersion}. Latest version is ${latestRelease}`) log.info(`Compiler version set to ${compVersion}. Latest version is ${latestRelease}`)
@ -105,7 +105,7 @@ commander
if (commander.runs) { if (commander.runs) {
if (!commander.optimize) { if (!commander.optimize) {
log.error('Optimization should be enabled for runs') log.error('Optimization should be enabled for runs')
process.exit() process.exit(1)
} }
compilerConfig.runs = commander.runs compilerConfig.runs = commander.runs
log.info(`Runs set to ${compilerConfig.runs}`) log.info(`Runs set to ${compilerConfig.runs}`)
@ -116,12 +116,14 @@ commander
await provider.init() await provider.init()
web3.setProvider(provider) web3.setProvider(provider)
extend(web3) extend(web3)
runTestFiles(path.resolve(testsPath), isDirectory, web3, compilerConfig) runTestFiles(path.resolve(testsPath), isDirectory, web3, compilerConfig, (error) => {
if (error) process.exit(1)
})
}) })
if (!process.argv.slice(2).length) { if (!process.argv.slice(2).length) {
log.error('Please specify a file or directory path') log.error('Please specify a file or directory path')
process.exit() process.exit(1)
} }
commander.parse(process.argv) commander.parse(process.argv)

Loading…
Cancel
Save