Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test cleanup #437

Merged
merged 4 commits into from Feb 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions docs/developer.md
Expand Up @@ -11,10 +11,6 @@ or the associated YouTube video introduction to [core development with Ethereumj

#### Running different Test Types

Running all the tests:

`npm test`

Running the State tests:

`node ./tests/tester -s`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -18,7 +18,7 @@
"testBlockchain": "npm run build:dist && node --stack-size=1500 ./tests/tester -b --fork='Constantinople' --dist --excludeDir='GeneralStateTests'",
"testBlockchainGeneralStateTests": "npm run build:dist && node --stack-size=1500 ./tests/tester -b --dist --dir='GeneralStateTests'",
"testAPI": "tape ./tests/api/*.js",
"test": "node ./tests/tester -a",
"test": "echo \"[INFO] Generic test cmd not used. See package.json for more specific test run cmds.\"",
"lint": "standard",
"prepublishOnly": "npm run lint && npm run build:dist && npm run testBuildIntegrity",
"build:dist": "babel lib/ -d dist/",
Expand Down
2 changes: 1 addition & 1 deletion tests/hooked.js → tests/api/hooked.js
@@ -1,5 +1,5 @@
const tape = require('tape')
const createHookedVm = require('../lib/hooked')
const createHookedVm = require('../../lib/hooked')

tape('hooked-vm', function (test) {
var contractAddressHex = '0x1234000000000000000000000000000000001234'
Expand Down
15 changes: 15 additions & 0 deletions tests/api/stateManager.js
Expand Up @@ -105,4 +105,19 @@ tape('StateManager', (t) => {

st.end()
})

t.test('should generate the genesis state correctly', async (st) => {
const genesisData = require('ethereumjs-testing').getSingleFile('BasicTests/genesishashestest.json')
const stateManager = new StateManager()

const generateCanonicalGenesis = promisify((...args) => stateManager.generateCanonicalGenesis(...args))
const getStateRoot = promisify((...args) => stateManager.getStateRoot(...args))

await generateCanonicalGenesis()
let stateRoot = await getStateRoot()

st.equal(stateRoot.toString('hex'), genesisData.genesis_state_root)

st.end()
})
})
113 changes: 0 additions & 113 deletions tests/constantinopleSstoreTest.js

This file was deleted.

19 changes: 0 additions & 19 deletions tests/genesishashes.js

This file was deleted.

14 changes: 0 additions & 14 deletions tests/tester.js
@@ -1,7 +1,6 @@
#!/usr/bin/env node

const argv = require('minimist')(process.argv.slice(2))
const async = require('async')
const tape = require('tape')
const testing = require('ethereumjs-testing')
const FORK_CONFIG = argv.fork || 'Byzantium'
Expand Down Expand Up @@ -115,8 +114,6 @@ if (argv.r) {
runTests('VMTests', argv)
} else if (argv.b) {
runTests('BlockchainTests', argv)
} else if (argv.a) {
runAll()
}

// randomized tests
Expand Down Expand Up @@ -244,14 +241,3 @@ function runTests (name, runnerArgs, cb) {
})
}
}

function runAll () {
require('./tester.js')
require('./genesishashes.js')
require('./constantinopleSstoreTest.js')
async.series([
// runTests.bind(this, 'VMTests', {}), // VM tests disabled since we don't support Frontier gas costs
runTests.bind(this, 'GeneralStateTests', {}),
runTests.bind(this, 'BlockchainTests', {})
])
}