From ce23114f2ccf7f1ded673026baeabca3d5b1a4e3 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 22 Jan 2017 15:43:56 +0100 Subject: [PATCH] Add test for Store::create() --- libimagruby/test/test_store.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 libimagruby/test/test_store.rb diff --git a/libimagruby/test/test_store.rb b/libimagruby/test/test_store.rb new file mode 100644 index 00000000..0a00247a --- /dev/null +++ b/libimagruby/test/test_store.rb @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby + +require 'fiddle' + +INIT_FN = 'imag_ruby_initialize' + +for targ in %w(debug) + begin + lib = Fiddle::dlopen "../target/#{targ}/liblibimagruby.so" + Fiddle::Function::new(lib[INIT_FN], [], Fiddle::TYPE_VOIDP).call + break; + rescue Fiddle::DLError + end +end + +color = true +verbose = true +debug = true + +Imag.init_logger debug, verbose, color + +store_handle = RStoreHandle::new(false, "/tmp/store") +id = RStoreId::new_baseless("test") +test_handle = store_handle.create(id) + +Imag.info "Created #{test_handle.location.to_str} from Ruby" +