Skip to content

Commit

Permalink
Merge pull request #437 from ethereumjs/test-cleanup
Browse files Browse the repository at this point in the history
Test cleanup
  • Loading branch information
holgerd77 committed Feb 12, 2019
2 parents 57293c6 + ed5041f commit 1e6c92d
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 152 deletions.
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', {})
])
}

0 comments on commit 1e6c92d

Please sign in to comment.