Skip to content

Commit

Permalink
Disable specs that break on MinGW-w64 (#15116)
Browse files Browse the repository at this point in the history
These specs do not have straightforward workarounds when run under MSYS2.
  • Loading branch information
HertzDevil authored Oct 23, 2024
1 parent b847563 commit 2e8715d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 25 deletions.
53 changes: 29 additions & 24 deletions spec/compiler/codegen/pointer_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -492,28 +492,33 @@ describe "Code gen: pointer" do
)).to_b.should be_true
end

it "takes pointerof lib external var" do
test_c(
%(
int external_var = 0;
),
%(
lib LibFoo
$external_var : Int32
end
LibFoo.external_var = 1
ptr = pointerof(LibFoo.external_var)
x = ptr.value
ptr.value = 10
y = ptr.value
ptr.value = 100
z = LibFoo.external_var
x + y + z
), &.to_i.should eq(111))
end
# FIXME: `$external_var` implies __declspec(dllimport), but we only have an
# object file, so MinGW-w64 fails linking (actually MSVC also emits an
# LNK4217 linker warning)
{% unless flag?(:win32) && flag?(:gnu) %}
it "takes pointerof lib external var" do
test_c(
%(
int external_var = 0;
),
%(
lib LibFoo
$external_var : Int32
end
LibFoo.external_var = 1
ptr = pointerof(LibFoo.external_var)
x = ptr.value
ptr.value = 10
y = ptr.value
ptr.value = 100
z = LibFoo.external_var
x + y + z
), &.to_i.should eq(111))
end
{% end %}
end
2 changes: 1 addition & 1 deletion spec/compiler/codegen/thread_local_spec.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% skip_file if flag?(:openbsd) %}
{% skip_file if flag?(:openbsd) || (flag?(:win32) && flag?(:gnu)) %}

require "../../spec_helper"

Expand Down
8 changes: 8 additions & 0 deletions spec/std/kernel_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ describe "PROGRAM_NAME" do
pending! "Example is broken in Nix shell (#12332)"
end

# MSYS2: gcc/ld doesn't support unicode paths
# https://github.com/msys2/MINGW-packages/issues/17812
{% if flag?(:windows) %}
if ENV["MSYSTEM"]?
pending! "Example is broken in MSYS2 shell"
end
{% end %}

File.write(source_file, "File.basename(PROGRAM_NAME).inspect(STDOUT)")

compile_file(source_file, bin_name: "×‽😂") do |executable_file|
Expand Down

0 comments on commit 2e8715d

Please sign in to comment.