Skip to content

Commit

Permalink
[Truffle] Add C extension test that creates a module - simple API call.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed Apr 25, 2016
1 parent 66ba6d0 commit 2d5cc3a
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/truffle/cexts/module/.jruby-cext-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
src: ext/module/*.c
out: lib/module/module.su
5 changes: 5 additions & 0 deletions test/truffle/cexts/module/bin/module
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env ruby

require 'module'

puts defined?(ModuleExtension)
1 change: 1 addition & 0 deletions test/truffle/cexts/module/expected.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
constant
2 changes: 2 additions & 0 deletions test/truffle/cexts/module/ext/module/extconf.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require 'mkmf'
create_makefile('module')
7 changes: 7 additions & 0 deletions test/truffle/cexts/module/ext/module/module.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <stdio.h>

#include <ruby.h>

void Init_module() {
rb_define_module("ModuleExtension");
}
1 change: 1 addition & 0 deletions test/truffle/cexts/module/lib/module.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require 'module/module'
Empty file.

0 comments on commit 2d5cc3a

Please sign in to comment.