Commit 256f5253 authored by mlachner's avatar mlachner
Browse files

Update JS related documentation

git-svn-id: https://svn.sosy-lab.org/software/cpachecker/branches/report-js-build@37044 4712c6d2-40bb-43ae-aa4b-fec3f1bdfe4c
parent 5be0d317
Pipeline #281259759 failed with stages
in 20 minutes and 42 seconds
......@@ -153,6 +153,16 @@ just run `scripts/cpa.sh -debug ...` and point your debugger to TCP port 5005
of the respective machine.
JavaScript Development
-----------------------
The JS files can be found in the directory `src/org/sosy_lab/cpachecker/core/counterexample`. We use Node.js as environment for our files.
All necessary third party libraries that we rely on can be installed via `npm run install`.
Our JS code is postprocessed with [webpack](https://webpack.js.org/). Webpack bundles our JS and CSS code as well as the third party libraries and puts the resulting files in the `build` directory. This can be done via the `npm run build` command, which should be executed every time changes to the JS related files are made. **Note that none of the raw files are actually used in the report generating, so any changes will not take effect unless the bundled files are updated.**
During development, we also have a small development server that can be started via `npm run start`. This server automatically opens an example report file in the browser and enables live updates for any changes to the JS code. Since a fully rendered HTML file is necessary for this server, the example file was created by CPAchecker and can be found under `development_data/index.html`. Therefore, changes to the `report.html` file will not be updated automatically. It is important to keep this file up to date by hand after any changes to the `report.html` file.
Releasing a New Version
-----------------------
......
......@@ -54,7 +54,7 @@ This is the configuration file for your `Karma/Jasmine` and it houses informatio
**2. 'test' directory:**
There is a directory titled `test` in the testing directory.
There is a directory titled `test` in the testing directory.
It houses all `test case` files for Unit testing.
......@@ -62,7 +62,7 @@ It houses all `test case` files for Unit testing.
At first the javascript loads all the scripts in the the `report.html` to the `testreport.html` and then we start testing our functions using Jasmine/Karma.
We are using PhantomJS browser for Unit testing application.
We will use all available browsers out of `Google Chrome`, `Chromium` and `Firefox` that are installed locally in headless mode for Unit testing application. Make sure that at least one of these is installed on your machine.
For more information regarding configuration you can browse `karma.conf.js`.
......@@ -73,10 +73,15 @@ Run the below commands in your terminal for Unit testing:
1. `npm install`
At first you have to install all dependencies and third party libraries to run the test cases.
This command is not needed everytime you run the tests, it is required for the first time.
This command is not needed every time you run the tests, it is required for the first time.
2. `npm test`
This command first compiles the application, then simultaneously re-compiles and runs the karma test-runner.
2. `npm run build`
Next, you will need to bundle all necessary `.js` and `.css` of our source code and all third party libraries into single files.
The tests assume that these bundles files are available and will not work with only the raw files.
This command is not needed for every test run either, but should be used every time any changes to the JS-related source files are made.
3. `npm test`
This command first compiles the application, then simultaneously re-compiles and runs the karma test-runner.
Test-runner output appears in the terminal window.
We can update our app and our tests in real-time, keeping a weather eye on the console for broken tests during development by setting up `karma.conf.js` file ( Set variable `autoWatch : true` and `singleRun : false` ).
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment