Skip to content

Commit

Permalink
Document Ruby Tests (#145)
Browse files Browse the repository at this point in the history
Add install prerequisites and test subsection Ruby Tests

Signed-off-by: Lucas Fernando <[email protected]>
Co-authored-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
  • Loading branch information
luccosta and chapulina authored Aug 3, 2020
1 parent 68f1418 commit c513cde
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,20 @@ The optional Eigen component of Ignition Math requires:
sudo apt-get install libeigen3-dev
```
The optional Ruby tests of Ignition Math require:
* [Ruby](https://www.ruby-lang.org/). Refer to the [Ruby Documentation](https://www.ruby-lang.org/downloads/) for installation instructions. On Ubuntu systems `apt-get` can be used to install Ubuntu Package `ruby-dev`:
```
sudo apt-get install ruby-dev
```
* [Swig](http://www.swig.org/). Refer to the [Swig Documentation](http://www.swig.org/download.html) for installation instructions. On Ubuntu systems `apt-get` can be used to install Swig:
```
sudo apt-get install swig
```
### Building from source
1. Clone the repository
Expand Down Expand Up @@ -162,6 +176,28 @@ Follow these steps to run tests and static code analysis in your clone of this r
make codecheck
```
## Ruby Tests
### Usage
The C++ classes are available in Ruby code by interface files (`.i`) used by swig to build a C++ extension module.
The interfaces and Ruby test codes are in the `src` folder. To use a C++ class in Ruby you need to:
1. Create an interface file describing the class as in Swig and Ruby reference at [The Ruby-to-C/C++ Mapping](http://www.swig.org/Doc1.3/Ruby.html#Ruby_nn11)
2. Include the interface file in `/src/ing_math.i`
3. Create the Ruby file and import the class as in Swig and Ruby reference at [C++ Classes](http://www.swig.org/Doc1.3/Ruby.html#Ruby_nn18)
### Tests
`make test` already runs all tests, including the ones made in Ruby, but you can run a Ruby test individually using
```
ctest -R Ruby_TEST.rb
```
# Folder Structure
Refer to the following table for information about important directories and files in this repository.
Expand Down

0 comments on commit c513cde

Please sign in to comment.