asm-js / validator

A reference validator for asm.js.
Apache License 2.0
1.78k stars 148 forks source link

Add validator #103

Closed alexanderGugel closed 9 years ago

alexanderGugel commented 9 years ago

101

npm test wasn't doing anything for me:

npm test

> asm.js@0.0.3 test /Users/alexandergugel/repos/asm.js
> nodeunit

Files required.
Usage: nodeunit [options] testmodule1.js testfolder [...] 
Options:

  --config FILE     the path to a JSON file with options
  --reporter FILE   optional path to a reporter file to customize the output
  --list-reporters  list available build-in reporters
  -t name,          specify a test to run
  -f fullname,      specify a specific test to run. fullname is built so: "outerGroup - .. - innerGroup - testName"
  -h, --help        display this help and exit
  -v, --version     output version information and exit
npm ERR! Test failed.  See above for more details.

I added a few rough tests for the command line utility (copied over from validate-asm).

Please let me know what you think.

Thanks.

dead-claudia commented 9 years ago

See about changing that commit name. It's a little misleading IMHO.

alexanderGugel commented 9 years ago

agree

sunfishcode commented 9 years ago

When I install the asm.js module in a node tree, running "npm test asm.js" runs the asm.js tests. Does this not work for you?

alexanderGugel commented 9 years ago

No :disappointed:

➜  asm.js git:(master) npm test asm.js > err 
/Users/alexandergugel/repos/asm.js/node_modules/nodeunit/lib/utils.js:14
    Script = process.binding('evals').Script || process.binding('evals').NodeS
                     ^
Error: No such module: evals
    at Error (native)
    at Object.<anonymous> (/Users/alexandergugel/repos/asm.js/node_modules/nodeunit/lib/utils.js:14:22)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/alexandergugel/repos/asm.js/node_modules/nodeunit/lib/nodeunit.js:13:13)
    at Module._compile (module.js:460:26)
npm ERR! Test failed.  See above for more details.

I'm on Node v0.12.0.

sunfishcode commented 9 years ago

It looks like your nodeunit is an older version which is lacking https://github.com/caolan/nodeunit/commit/5ba1a94e92339ecdca322465abd741fb82974a40. I've now submitted https://github.com/dherman/asm.js/commit/4dad3abef2f6ee7914f063f1e62689db362fc31c to update the asm.js package to depend on a newer version in order to fix this.

alexanderGugel commented 9 years ago

Wonderful, works now. I added nodeunit to the test script again.

sunfishcode commented 9 years ago

Looks good.