Skip to content

Commit 2b9ba74

Browse files
committed
Add a test case for mig tool on darwon platforms
1 parent c439304 commit 2b9ba74

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

test/fixtures/mig_test_rpc.defs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include <mach/std_types.defs>
2+
#include <mach/mach_types.defs>
3+
4+
subsystem mig_test_ipc 1;
5+
6+
routine mig_test_call(
7+
server_port : mach_port_t;
8+
out returnvalue : int);

test/test_mig.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
require 'rake_compiler_dock'
2+
require 'test/unit'
3+
4+
class TestMigCompile < Test::Unit::TestCase
5+
TEST_PLATFORM = ENV["TEST_PLATFORM"] || 'arm64-darwin'
6+
7+
def test_mig_compile
8+
omit "only on darwin platform" unless TEST_PLATFORM =~ /darwin/
9+
10+
RakeCompilerDock::Starter.sh "mig -header tmp/mig_test_rpc.h -user tmp/mig_test_rpc.c -sheader /dev/null -server /dev/null -I. test/fixtures/mig_test_rpc.defs ", platform: TEST_PLATFORM, verbose: false
11+
12+
h_file = File.read("tmp/mig_test_rpc.h")
13+
assert_match /Request_mig_test_call/, h_file
14+
15+
c_file = File.read("tmp/mig_test_rpc.c")
16+
assert_match /Reply__mig_test_call/, c_file
17+
end
18+
end

0 commit comments

Comments
 (0)