summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-08-21 10:40:41 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-08-21 10:40:41 +0200
commit0bc4b0d50369c493d5f994bf463931554ebb3c7f (patch)
treec9aca20aa5541db794341689663b692ee744c5d9 /test
parent2481a432611bd9f6c17d2eebdea7951a8fb7a50b (diff)
downloadffi-efl-0bc4b0d50369c493d5f994bf463931554ebb3c7f.zip
ffi-efl-0bc4b0d50369c493d5f994bf463931554ebb3c7f.tar.gz
remove Efl::PREFIX, Efl::PACKAGE_*
Diffstat (limited to 'test')
-rw-r--r--test/test_elementary.rb11
-rw-r--r--test/tests/test_bg.rb6
2 files changed, 10 insertions, 7 deletions
diff --git a/test/test_elementary.rb b/test/test_elementary.rb
index ffe542c..62cc2a1 100644
--- a/test/test_elementary.rb
+++ b/test/test_elementary.rb
@@ -5,6 +5,12 @@ require 'efl/elementary'
require 'efl/edje'
require 'efl'
#
+PREFIX=`pkg-config --variable=prefix ecore`.strip
+if PREFIX.empty?
+ puts "unable to determine Efl::PREFIX using pkg-config, images will not be available"
+end
+PACKAGE_DATA_DIR = File.join PREFIX, 'share', 'elementary'
+
Dir.glob( File.join File.dirname(__FILE__), 'tests', '*.rb').each do |f|
load f
end
@@ -207,7 +213,7 @@ class TestWin < Elm::ElmWin
if Tests.respond_to? m
# TODO dosen't work ?????
icon = Elm::ElmIcon.new self
- icon.file = "#{Efl::PACKAGE_DATA_DIR}/elementary/images/icon_00.png", nil
+ icon.file = "#{PACKAGE_DATA_DIR}/images/icon_00.png", nil
icon.scale = true, true
end
it = @li.item_append l, nil, icon, method(:try_test), FFI::MemoryPointer.from_string(m.to_s)
@@ -257,9 +263,6 @@ end
#
Elm.init
#
-#Native.elm_app_compile_bin_dir_set PACKAGE_BIN_DIR
-#Native.elm_app_compile_lib_dir_set PACKAGE_LIB_DIR
-#Native.elm_app_compile_data_dir_set PACKAGE_DATA_DIR
Native.elm_app_info_set elm_main, 'elementary', 'images/logo.png'
#
Elm.run
diff --git a/test/tests/test_bg.rb b/test/tests/test_bg.rb
index 7f613eb..0591511 100644
--- a/test/tests/test_bg.rb
+++ b/test/tests/test_bg.rb
@@ -23,7 +23,7 @@ module Tests
end
def image_bg
@bg = Elm::ElmBg.new self do |bg|
- bg.file = "#{Efl::PACKAGE_DATA_DIR}/elementary/images/plant_01.jpg", nil
+ bg.file = "#{PACKAGE_DATA_DIR}/images/plant_01.jpg", nil
bg.size_hint_weight_expand
self.resize_object_add bg
bg.show
@@ -37,7 +37,7 @@ module Tests
bx.show
end
@o_bg = Elm::ElmBg.new self do |bg|
- bg.file = "#{Efl::PACKAGE_DATA_DIR}/elementary/images/plant_01.jpg", nil
+ bg.file = "#{PACKAGE_DATA_DIR}/images/plant_01.jpg", nil
bg.size_hint_weight_expand
bg.size_hint_align_fill
@bx.pack_end bg
@@ -115,7 +115,7 @@ module Tests
def cb_overlay_changed data, evas_obj, event_info
if Elm::ElmCheck.new(evas_obj).state
over = @o_bg.parent_widget.evas.edje_object_add
- over.file = File.join(Efl::PACKAGE_DATA_DIR,'elementary/objects/test.edj'), "bg_overlay"
+ over.file = "#{PACKAGE_DATA_DIR}/objects/test.edj", "bg_overlay"
@o_bg.overlay = over
else
@o_bg.overlay = FFI::Pointer::NULL