Update README with new instructions on how to run the gentest script (#1502)
Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1502 We should change this if we are moving away from using Ruby Reviewed By: yungsters, NickGerleman Differential Revision: D51957351 fbshipit-source-id: fddb0b3348db2b93c661c919a61150c81906a61a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e61eb0178c
commit
e1b59d63a7
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
Yoga is an embeddable and performant flexbox layout engine with bindings for multiple languages.
|
Yoga is an embeddable and performant flexbox layout engine with bindings for multiple languages.
|
||||||
|
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
Yoga's main implementation targets C++ 20 with accompanying build logic in CMake. A wrapper is provided to build the main library and run unit tests.
|
Yoga's main implementation targets C++ 20 with accompanying build logic in CMake. A wrapper is provided to build the main library and run unit tests.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
@@ -14,8 +14,6 @@ While not required, this script will use [ninja](https://ninja-build.org/) if it
|
|||||||
|
|
||||||
Yoga is additionally part of the [vcpkg](https://github.com/Microsoft/vcpkg/) collection of ports maintained by Microsoft and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
|
Yoga is additionally part of the [vcpkg](https://github.com/Microsoft/vcpkg/) collection of ports maintained by Microsoft and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Adding Tests
|
## Adding Tests
|
||||||
|
|
||||||
Many of Yoga's tests are automatically generated, using HTML fixtures describing node structure. These are rendered in Chrome to generate an expected layout result for the tree. New fixtures can be added to `gentest/fixtures`.
|
Many of Yoga's tests are automatically generated, using HTML fixtures describing node structure. These are rendered in Chrome to generate an expected layout result for the tree. New fixtures can be added to `gentest/fixtures`.
|
||||||
@@ -27,9 +25,10 @@ Many of Yoga's tests are automatically generated, using HTML fixtures describing
|
|||||||
```
|
```
|
||||||
|
|
||||||
To generate new tests from added fixtures:
|
To generate new tests from added fixtures:
|
||||||
1. Run `bundle install` in the `gentest` directory to install dependencies of the test generator.
|
|
||||||
2. Run `ruby gentest.rb` in the `gentest` directory.
|
|
||||||
|
|
||||||
|
1. Ensure you have [yarn](https://yarnpkg.com/) installed.
|
||||||
|
2. Run `yarn install` to install dependencies for the test generator.
|
||||||
|
3. Run `yarn gentest` in the `yoga` directory.
|
||||||
|
|
||||||
## Debugging
|
## Debugging
|
||||||
|
|
||||||
|
@@ -5,7 +5,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"lint:fix": "eslint . --fix",
|
"lint:fix": "eslint . --fix",
|
||||||
"tsc": "yarn workspaces run tsc"
|
"tsc": "yarn workspaces run tsc",
|
||||||
|
"gentest": "node --loader=babel-register-esm gentest/gentest-driver.ts"
|
||||||
},
|
},
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"javascript",
|
"javascript",
|
||||||
@@ -15,6 +16,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@typescript-eslint/eslint-plugin": "^5.30.5",
|
"@typescript-eslint/eslint-plugin": "^5.30.5",
|
||||||
"@typescript-eslint/parser": "^5.30.5",
|
"@typescript-eslint/parser": "^5.30.5",
|
||||||
|
"babel-register-esm": "^1.2.5",
|
||||||
"eslint": "^8.30.0",
|
"eslint": "^8.30.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.5.0",
|
||||||
"eslint-plugin-jest": "^27.1.7",
|
"eslint-plugin-jest": "^27.1.7",
|
||||||
|
Reference in New Issue
Block a user