mirror of
https://github.com/pissang/claygl.git
synced 2026-01-18 16:22:29 +00:00
* wip: upgrade to webgl2 * update shaders to version 300 * fix index for texture must be constant in webgl 2 * remove npot * fix naming conflicts of using texture previously * fix wrong internal format in float textures. * fix depth texture format * fix texture enabled define * fix instancing * fix some cases * fix some case use extension * fix frag depth * tweak * generate mimap for NPOT texture * remove debugger code * fix alchemyao case * fix ssr case * not generate mipmap in compositor by default.
Unit Tests
Install
Pre-requisite
The unit tests are built on electron-mocha.
node version
>= 6.x as the tests is written in ES2015.
Install dependencies
npm install
Electron
Installation of electron in China may fail as its host is blocked for well known reason.
Yon can export an evironment variable to change electron's mirror to taobao.
export ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/
Integration Tests
Compare spec's paiting result with pre-generated fixtures.
Test Flow with Coverage
- build with test/rollup.config.js, generate dist/clay.src.js, with inline sourcemap
- run istanbul instrument, instrument clay.src.js with code coverage wrappers and generate dist/clay.js
- run specs
- generate coverage-final.json and lcov.info with a customized mocha reporter (test/reporter/istanbul-reporter)
- generate html coverage reports with remap-istanbul based on coverage-final.json and sourcemap
- delete dist/clay.src.js
Generate Fixtures
npm run gen:fixture
Generate fixture for specs matching the pattern:
npm run gen:texture -- -g "texture anistropic"
Fixture test report
npm run test:fixture
A html report named fixture-report.html will be generated in coverage folder.
The report template is test/reporter/fixture-tmpl.html.
Commands
- run, watch and debug in electron
npm run tdd
- run test
npm test
- run tests matching patterns
npm test -- -- -g "texture anistropic"
npm run tdd -- -g "texture anistropic"
- run fixture tests (compare failed integration tests)
npm run test:fixture
- run test with coverage
npm test:cov
- debug
npm run debug