Skip to content
This repository has been archived by the owner on Jul 23, 2019. It is now read-only.

set up the benchmark on xray-core #62

Merged
merged 4 commits into from
Apr 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ before_install:
script:
- script/build
- script/test
- script/bench

cache:
cargo: true
Expand Down
34 changes: 20 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,31 +28,37 @@ Later versions may work, but you should ideally run the build with the same vers

You can install Rust via [`rustup`](https://www.rustup.rs/). We currently build correctly on Rust 1.24.1, but frequently build on the nightly channel in development to enable formatting of generated bindings. The nightly channel should not be *required* however, and if it is, that's a bug.

### Build the Cargo workspace
### Run the build script

This repository contains several components in top-level folders prefixed with `xray_*`. To build all of the rust components, simply run this in the root of the repository:
This repository contains several components in top-level folders prefixed with `xray_*`. To build all of the components, simply run this in the root of the repository:

```sh
cargo build
script/build
```

### Install the Electron app's dependencies

You'll need to install the Electron's app's dependencies with npm by running this:

To build a release version (which will be much faster):

```sh
# Move to this subdirectory of the repository:
cd xray_electron

# Install and build dependencies:
npm install
script/build --release
```

### Launch via xray_cli
## Running

We currently *only* support launching the application via the CLI. For this to work, you need to set the `XRAY_SRC_PATH` environment variable to the location of your repository. The CLI also currently *requires* an argument:

```sh
XRAY_SRC_PATH=. cargo run -p xray_cli .
XRAY_SRC_PATH=. script/xray .
```

That assumes you built with `--release`. To run the debug version, use `xray_debug` instead:

```sh
XRAY_SRC_PATH=. script/xray_debug .
```

## Running tests and benchmarks

* All tests: `script/test`
* Rust tests: `cargo test` in the root of the repository or a Rust subfolder.
* Front-end tests: `cd xray_electron && npm test`
* Benchmarks: `cargo bench`
Loading