Skip to content

Commit 4a7912d

Browse files
authored
Merge pull request #70 from ylatuya/unit_tests
Create generator integration tests and fix generation issues
2 parents 8035b6b + 300791f commit 4a7912d

File tree

249 files changed

+30519
-473
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

249 files changed

+30519
-473
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ jobs:
77
config:
88
- { os: ubuntu-latest, arch: x64, name: ubuntu-x64 }
99
- { os: macos-latest, arch: x64, name: macos-x64 }
10-
- { os: windows-latest, arch: x64, name: windows-x64 }
10+
# Disable Windows until gobject-introspeciton build is fixed
11+
# - { os: windows-latest, arch: x64, name: windows-x64 }
1112
runs-on: ${{ matrix.config.os }}
1213
steps:
1314
- uses: actions/checkout@v2
@@ -22,11 +23,22 @@ jobs:
2223
run: dotnet format Source/gtk-sharp.sln --verify-no-changes --no-restore
2324
- name: Install Deps
2425
run: pip3 install meson ninja
26+
- name: Install Windows Deps
27+
if: matrix.config.os == 'windows-latest'
28+
run: choco install winflexbison3 pkgconfiglite -y --allow-empty-checksum
29+
- name: Install macOS Deps
30+
if: matrix.config.os == 'macos-latest'
31+
run: |
32+
brew update
33+
brew install bison
34+
echo "/usr/local/opt/bison/bin" >> $GITHUB_PATH
2535
- name: Configure
26-
run: meson builddir
36+
run: meson setup builddir --buildtype=release --prefix=${GITHUB_WORKSPACE}/build_prefix
2737
- name: Build
2838
run: meson compile -C builddir
2939
- name: Install
3040
run: meson install -C builddir
3141
- name: Build dotnet
3242
run: dotnet build Source/gtk-sharp.sln /p:Platform="Any CPU"
43+
- name: Test
44+
run: dotnet test Source/gtk-sharp.sln /p:Platform="Any CPU"

Source/.editorconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ root = true
33

44
[**/generated/*.cs]
55
generated_code = true
6+
[**/generated/*/*.cs]
7+
generated_code = true
68

79
# C# files
810
[*.cs]

Source/atk/Atk.metadata

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<attr path="/api/namespace/object[@cname='AtkObject']/virtual_method[@cname='ref_state_set']/return-type" name="owned">true</attr>
3030
<attr path="/api/namespace/object[@cname='AtkObjectFactory']/virtual_method" name="override_in">declaring_class</attr>
3131
<attr path="/api/namespace/object[@cname='AtkRelation']/constructor[@cname='atk_relation_new']/*/*[@name='targets']" name="array">1</attr>
32+
<attr path="/api/namespace/object[@cname='AtkRelation']/constructor[@cname='atk_relation_new']/*/*[@name='targets']" name="array_length_param_index">1</attr>
3233
<attr path="/api/namespace/object[@cname='AtkRelation']/method[@name='GetTarget']/return-type" name="element_type">AtkObject*</attr>
3334
<attr path="/api/namespace/object[@cname='AtkUtil']/virtual_method" name="override_in">declaring_class</attr>
3435
<attr path="/api/namespace/object[@cname='AtkUtil']/virtual_method[@name='AddGlobalEventListener']" name="hidden">1</attr>

Source/atk/generated/Atk_Relation.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public partial class Relation : GLib.Object {
1414
public Relation (IntPtr raw) : base(raw) {}
1515

1616
[DllImport("atk-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
17-
static extern IntPtr atk_relation_new(IntPtr[] targets, int n_targets, int relationship);
17+
static extern IntPtr atk_relation_new([MarshalAs(UnmanagedType.LPArray, SizeParamIndex=1)]IntPtr[] targets, int n_targets, int relationship);
1818

1919
public Relation (Atk.Object[] targets, Atk.RelationType relationship) : base (IntPtr.Zero)
2020
{
@@ -24,11 +24,11 @@ public Relation (Atk.Object[] targets, Atk.RelationType relationship) : base (In
2424
CreateNativeObject (names.ToArray (), vals.ToArray ());
2525
return;
2626
}
27-
int cnt_targets = targets == null ? 0 : targets.Length;
28-
IntPtr[] native_targets = new IntPtr [cnt_targets];
29-
for (int i = 0; i < cnt_targets; i++)
27+
int n_targets = (targets == null ? 0 : targets.Length);
28+
IntPtr[] native_targets = new IntPtr [n_targets];
29+
for (int i = 0; i < n_targets; i++)
3030
native_targets [i] = targets[i] == null ? IntPtr.Zero : targets[i].Handle;
31-
Raw = atk_relation_new(native_targets, (targets == null ? 0 : targets.Length), (int) relationship);
31+
Raw = atk_relation_new(native_targets, n_targets, (int) relationship);
3232
}
3333

3434
[DllImport("atk-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]

Source/atk/generated/atk-api.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2777,7 +2777,7 @@
27772777
</method>
27782778
<constructor cname="atk_relation_new">
27792779
<parameters>
2780-
<parameter type="AtkObject**" name="targets" array="1" />
2780+
<parameter type="AtkObject**" name="targets" array="1" array_length_param_index="1" />
27812781
<parameter type="gint" name="n_targets" />
27822782
<parameter type="AtkRelationType" name="relationship" />
27832783
</parameters>

Source/bindinator/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2012-216 Andreia Gaita
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)