summaryrefslogtreecommitdiff
path: root/src/tests/efl_mono/meson.build
blob: 445c823caa09babab1b94c24af8a27b26d0933c7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
eo_files = [
    'dummy_child.eo',
    'dummy_numberwrapper.eo',
    'dummy_test_object.eo',
    'dummy_test_iface.eo',
    'dummy_inherit_helper.eo',
    'dummy_inherit_iface.eo',
    'dummy_part_holder.eo',
    'dummy_event_manager.eo',
    'dummy_constructible_object.eo',
]

eo_file_targets = []

foreach eo_file : eo_files
  eo_file_targets += custom_target('eolian_gen_' + eo_file,
    input : eo_file,
    output : [eo_file + '.h'],
    command : eolian_gen + [ '-I', meson.current_source_dir(), eolian_include_directories,
                           '-o', 'h:' + join_paths(meson.current_build_dir(), eo_file + '.h'),
                           '-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'),
                           '-gch', '@INPUT@'])
endforeach



efl_mono_native_test = library('efl_mono_native_test',
    eo_file_targets + [
        'libefl_mono_native_test.h',
        'dummy_child.c',
        'dummy_inherit_helper.c',
        'dummy_interfaces.c',
        'dummy_numberwrapper.c',
        'dummy_part_holder.c',
        'dummy_test_object.c',
        'dummy_event_manager.c',
        'dummy_constructible_object.c',
    ],
    dependencies : [ecore, eo, efl],
)

eo_file_targets = []

foreach mono_gen_file : eo_files
  eo_file_targets += custom_target('eolian_mono_gen_'+mono_gen_file.underscorify()+'',
    input : mono_gen_file,
    output : [mono_gen_file + '.cs'],
    command : [eolian_mono_gen, beta_option, '-I', meson.current_source_dir(), eolian_include_directories,
                                '--dllimport', 'efl_mono_native_test',
                                '-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'),
                                '@INPUT@'])
endforeach

efl_mono_test = library('efl_mono_test',
    eo_file_targets,
    link_with : [efl_mono],
    cs_args : extra_cs_args
)

efl_mono_src = [
     'Main.cs',
     'TestUtils.cs',
     'EinaTestData.cs',
     'StructHelpers.cs',
     'BasicDirection.cs',
     'Eina.cs',
     'Eldbus.cs',
     'Eo.cs',
     'EoPromises.cs',
     'EoConstruction.cs',
     'Errors.cs',
     'Events.cs',
     'FunctionPointers.cs',
     'FunctionPointerMarshalling.cs',
     'Model.cs',
     'Parts.cs',
     'Promises.cs',
     'Strbuf.cs',
     'Strings.cs',
     'Structs.cs',
     'Value.cs',
     'ValueEolian.cs',
     'Inheritance.cs',
]

efl_mono_suite = executable('efl-mono-suite',
  efl_mono_src,
  link_with : [efl_mono, efl_mono_test],
  cs_args : extra_cs_args
)

env_mono = environment()
env_mono.set('MONO_PATH', efl_mono_test_suite_path )

if (cs_is_dotnet)
copy_prog = find_program(['cp', 'copy'])

configure_file(input : 'efl-mono-suite.runtimeconfig.json',
               output : 'efl-mono-suite.runtimeconfig.json',
               copy : true)

custom_target('copy_efl_mono_dll',
              build_by_default : true,
              input : efl_mono,
              output : efl_mono.full_path().split('/')[-1],
              command : [copy_prog, '@INPUT@', '@OUTPUT@'])

custom_target('copy_efl_mono_lib_dll',
              build_by_default : true,
              input : efl_mono_lib,
              output : efl_mono_lib.full_path().split('/')[-1],
              command : [copy_prog, '@INPUT@', '@OUTPUT@'])
endif

config_libs = ['eina', 'ecore', 'eo', 'efl', 'evas', 'eldbus', 'elementary', 'efl_mono']
load_lib = efl_mono_test_suite_path + ':'

foreach config : config_libs
  lib = get_variable(config+'_lib')
  path = lib.full_path().split('/')
  repaired_path = ''
  prev = ''

  foreach p : path
    repaired_path += prev
    prev = p+'/'
  endforeach

  load_lib += repaired_path+':'
endforeach

env_mono.set('LD_LIBRARY_PATH', load_lib)

test('efl-mono-suite',
  efl_mono_suite,
  env : env_mono
)