Skip to content

Commit

Permalink
ARROW-943: [GLib] Support running unit tests with source archive
Browse files Browse the repository at this point in the history
Author: Kouhei Sutou <[email protected]>

Closes #635 from kou/glib-dist-test and squashes the following commits:

2c30729 [Kouhei Sutou] [GLib] Support running unit tests with source archive
  • Loading branch information
kou authored and wesm committed May 5, 2017
1 parent bcf073c commit 9a48773
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 2 deletions.
1 change: 1 addition & 0 deletions c_glib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ SUBDIRS = \

EXTRA_DIST = \
README.md \
test \
version

arrow_glib_docdir = ${datarootdir}/doc/arrow-glib
Expand Down
50 changes: 49 additions & 1 deletion c_glib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ You need to install Arrow C++ before you install Arrow GLib. See Arrow
C++ document about how to install Arrow C++.

You need [GTK-Doc](https://www.gtk.org/gtk-doc/) and
[GObject Introspection](https://wiki.gnome.org/action/show/Projects/GObjectIntrospection)
[GObject Introspection](https://wiki.gnome.org/Projects/GObjectIntrospection)
to build Arrow GLib. You can install them by the followings:

On Debian GNU/Linux or Ubuntu:
Expand Down Expand Up @@ -206,3 +206,51 @@ based bindings. Here are languages that support GObject Introspection:
See also
[Projects/GObjectIntrospection/Users - GNOME Wiki!](https://wiki.gnome.org/Projects/GObjectIntrospection/Users)
for other languages.

## How to run test

Arrow GLib has unit tests. You can confirm that you install Apache
GLib correctly by running unit tests.

You need to install the followings to run unit tests:

* [Ruby](https://www.ruby-lang.org/)
* [gobject-introspection gem](https://rubygems.org/gems/gobject-introspection)
* [test-unit gem](https://rubygems.org/gems/test-unit)

You can install them by the followings:

On Debian GNU/Linux or Ubuntu:

```text
% sudo apt install -y -V ruby-dev
% sudo gem install gobject-introspection test-unit
```

On CentOS 7 or later:

```text
% sudo yum install -y git
% git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
% git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
% echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
% echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
% exec ${SHELL} --login
% sudo yum install -y gcc make patch openssl-devel readline-devel zlib-devel
% rbenv install 2.4.1
% rbenv global 2.4.1
% gem install gobject-introspection test-unit
```

On macOS with [Homebrew](https://brew.sh/):

```text
% gem install gobject-introspection test-unit
```

Now, you can run unit tests by the followings:

```text
% cd c_glib
% test/run-test.sh
```
2 changes: 1 addition & 1 deletion c_glib/test/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ lib_dir="${base_dir}/arrow-glib/.libs"

LD_LIBRARY_PATH="${lib_dir}:${LD_LIBRARY_PATH}"

if [ "${NO_MAKE}" != "yes" ]; then
if [ -f "Makefile" -a "${NO_MAKE}" != "yes" ]; then
make -j8 > /dev/null || exit $?
fi

Expand Down

0 comments on commit 9a48773

Please sign in to comment.