Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions .github/workflows/win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ jobs:

- name: Set up environment
run: |
echo "::set-env name=CRYSTAL_PATH::src"
echo "::set-env name=CRYSTAL_PATH::$(pwd)\src"
echo "::set-env name=LIB::${env:LIB};$(pwd)\libs"
echo "::set-env name=TERM::dumb"
echo "::set-env name=LLVM_CONFIG::$(pwd)\llvm\bin\llvm-config.exe"
Expand All @@ -168,21 +168,29 @@ jobs:
- name: Re-build Crystal
run: |
.\crystal-cross.exe build src/compiler/crystal.cr -Di_know_what_im_doing -Dwithout_playground --link-flags=/F10000000
mv crystal.exe bin/

- name: Gather Crystal executable
- name: Gather Crystal binaries
run: |
mkdir crystal
cp crystal.exe crystal/
cp bin/crystal.exe crystal/
cp libs/* crystal/
- name: Upload Crystal executable
- name: Upload Crystal binaries
uses: actions/upload-artifact@v1
with:
name: crystal
path: crystal

- name: Build stdlib specs executable
run: |
.\crystal.exe build spec/std_spec.cr --exclude-warnings spec/std -Dwithout_openssl -Di_know_what_im_doing
bin\crystal.exe build spec/std_spec.cr --exclude-warnings spec/std --exclude-warnings spec/compiler -Dwithout_openssl -Di_know_what_im_doing
- name: Run stdlib specs
run: |
.\std_spec.exe

- name: Build compiler specs executable
run: |
bin\crystal.exe build spec/compiler_spec.cr --exclude-warnings spec/std --exclude-warnings spec/compiler -Dwithout_playground -Di_know_what_im_doing
- name: Run compiler specs
run: |
.\compiler_spec.exe
2 changes: 1 addition & 1 deletion spec/compiler/codegen/extern_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ describe "Codegen: extern struct" do
), &.to_i.should eq(30))
end

it "codegens proc that takes and returns an extern struct with sret" do
pending_win32 "codegens proc that takes and returns an extern struct with sret" do
test_c(
%(
struct Struct {
Expand Down
4 changes: 2 additions & 2 deletions spec/compiler/codegen/lib_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ describe "Code gen: lib" do
it "call to void function" do
run("
lib LibC
fun srandom(x : UInt32) : Void
fun srand(x : UInt32) : Void
end

def foo
LibC.srandom(0_u32)
LibC.srand(0_u32)
end

foo
Expand Down
10 changes: 5 additions & 5 deletions spec/compiler/codegen/special_vars_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require "../../spec_helper"

describe "Codegen: special vars" do
["$~", "$?"].each do |name|
it "codegens #{name}" do
pending_win32 "codegens #{name}" do
run(%(
class Object; def not_nil!; self; end; end

Expand All @@ -15,7 +15,7 @@ describe "Codegen: special vars" do
)).to_string.should eq("hey")
end

it "codegens #{name} with nilable (1)" do
pending_win32 "codegens #{name} with nilable (1)" do
run(%(
require "prelude"

Expand All @@ -35,7 +35,7 @@ describe "Codegen: special vars" do
)).to_string.should eq("ouch")
end

it "codegens #{name} with nilable (2)" do
pending_win32 "codegens #{name} with nilable (2)" do
run(%(
require "prelude"

Expand Down Expand Up @@ -74,7 +74,7 @@ describe "Codegen: special vars" do
)).to_string.should eq("hey")
end

it "works lazily" do
pending_win32 "works lazily" do
run(%(
require "prelude"

Expand Down Expand Up @@ -145,7 +145,7 @@ describe "Codegen: special vars" do
)).to_string.should eq("hey")
end

it "codegens after block" do
pending_win32 "codegens after block" do
run(%(
require "prelude"

Expand Down
2 changes: 1 addition & 1 deletion spec/compiler/codegen/thread_local_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require "../../spec_helper"

{% if !flag?(:openbsd) %}
describe "Codegen: thread local" do
it "works with class variables" do
pending_win32 "works with class variables" do
run(%(
require "prelude"

Expand Down
2 changes: 1 addition & 1 deletion spec/compiler/compiler_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe "Compiler" do

it "treats all arguments post-filename as program arguments" do
with_tempfile "args_test" do |path|
`bin/crystal '#{compiler_datapath}/args_test' -Dother_flag -- bar '#{path}'`
`bin/crystal #{Process.quote(File.join(compiler_datapath, "args_test"))} -Dother_flag -- bar #{Process.quote(path)}`

File.read(path).should eq(<<-FILE)
["-Dother_flag", "--", "bar"]
Expand Down
12 changes: 6 additions & 6 deletions spec/compiler/crystal/tools/doc/project_info_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe Crystal::Doc::ProjectInfo do
it "git tagged version" do
run_git "init"
run_git "add shard.yml"
run_git "commit -m 'Initial commit' --no-gpg-sign"
run_git "commit -m \"Initial commit\" --no-gpg-sign"
run_git "tag v3.0"

assert_with_defaults(ProjectInfo.new(nil, nil), ProjectInfo.new("foo", "3.0", refname: "v3.0"))
Expand All @@ -61,7 +61,7 @@ describe Crystal::Doc::ProjectInfo do
it "git tagged version dirty" do
run_git "init"
run_git "add shard.yml"
run_git "commit -m 'Initial commit' --no-gpg-sign"
run_git "commit -m \"Initial commit\" --no-gpg-sign"
run_git "tag v3.0"
File.write("foo.txt", "bar")

Expand All @@ -73,7 +73,7 @@ describe Crystal::Doc::ProjectInfo do
it "git non-tagged commit" do
run_git "init"
run_git "add shard.yml"
run_git "commit -m 'Initial commit' --no-gpg-sign"
run_git "commit -m \"Initial commit\" --no-gpg-sign"
commit_sha = `git rev-parse HEAD`.chomp

assert_with_defaults(ProjectInfo.new(nil, nil), ProjectInfo.new("foo", "master", refname: commit_sha))
Expand All @@ -85,7 +85,7 @@ describe Crystal::Doc::ProjectInfo do
it "git non-tagged commit dirty" do
run_git "init"
run_git "add shard.yml"
run_git "commit -m 'Initial commit' --no-gpg-sign"
run_git "commit -m \"Initial commit\" --no-gpg-sign"
File.write("foo.txt", "bar")

assert_with_defaults(ProjectInfo.new(nil, nil), ProjectInfo.new("foo", "master-dev", refname: nil))
Expand All @@ -109,7 +109,7 @@ describe Crystal::Doc::ProjectInfo do
File.write("foo.txt", "bar")
run_git "init"
run_git "add foo.txt"
run_git "commit -m 'Remove shard.yml' --no-gpg-sign"
run_git "commit -m \"Remove shard.yml\" --no-gpg-sign"
run_git "tag v4.0"

assert_with_defaults(ProjectInfo.new(nil, nil), ProjectInfo.new(nil, "4.0", refname: "v4.0"))
Expand All @@ -130,7 +130,7 @@ describe Crystal::Doc::ProjectInfo do
# Non-tagged commit
File.write("file.txt", "foo")
run_git "add file.txt"
run_git "commit -m 'Initial commit' --no-gpg-sign"
run_git "commit -m \"Initial commit\" --no-gpg-sign"
ProjectInfo.find_git_version.should eq "master"

# Other branch
Expand Down
34 changes: 17 additions & 17 deletions spec/compiler/crystal/tools/format_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ describe Crystal::Command::FormatCommand do
format_command = Crystal::Command::FormatCommand.new([] of String, color: false, stdin: stdin, stdout: stdout, stderr: stderr)
format_command.run
format_command.status_code.should eq(0)
stdout.to_s.should contain("Format ./format.cr")
stdout.to_s.should_not contain("Format ./not_format.cr")
stdout.to_s.should contain("Format #{Path[".", "format.cr"]}")
stdout.to_s.should_not contain("Format #{Path[".", "not_format.cr"]}")
stderr.to_s.empty?.should be_true

File.read(File.join(path, "format.cr")).should eq("if true\n 1\nend\n")
Expand All @@ -124,19 +124,19 @@ describe Crystal::Command::FormatCommand do
format_command = Crystal::Command::FormatCommand.new(["dir"], color: false, stdin: stdin, stdout: stdout, stderr: stderr)
format_command.run
format_command.status_code.should eq(0)
stdout.to_s.should contain("Format ./dir/format.cr")
stdout.to_s.should_not contain("Format ./dir/not_format.cr")
stdout.to_s.should contain("Format #{Path[".", "dir", "format.cr"]}")
stdout.to_s.should_not contain("Format #{Path[".", "dir", "not_format.cr"]}")
stderr.to_s.empty?.should be_true

{stdout, stderr}.each &.clear

format_command = Crystal::Command::FormatCommand.new([] of String, color: false, stdin: stdin, stdout: stdout, stderr: stderr)
format_command.run
format_command.status_code.should eq(0)
stdout.to_s.should contain("Format ./format.cr")
stdout.to_s.should_not contain("Format ./not_format.cr")
stdout.to_s.should_not contain("Format ./dir/format.cr")
stdout.to_s.should_not contain("Format ./dir/not_format.cr")
stdout.to_s.should contain("Format #{Path[".", "format.cr"]}")
stdout.to_s.should_not contain("Format #{Path[".", "not_format.cr"]}")
stdout.to_s.should_not contain("Format #{Path[".", "dir", "format.cr"]}")
stdout.to_s.should_not contain("Format #{Path[".", "dir", "not_format.cr"]}")
stderr.to_s.empty?.should be_true

File.read(File.join(path, "format.cr")).should eq("if true\n 1\nend\n")
Expand All @@ -160,9 +160,9 @@ describe Crystal::Command::FormatCommand do
format_command = Crystal::Command::FormatCommand.new([] of String, color: false, stdin: stdin, stdout: stdout, stderr: stderr)
format_command.run
format_command.status_code.should eq(1)
stdout.to_s.should contain("Format ./format.cr")
stderr.to_s.should contain("syntax error in './syntax_error.cr:1:3': unexpected token: EOF")
stderr.to_s.should contain("file './invalid_byte_sequence_error.cr' is not a valid Crystal source file: Unexpected byte 0xff at position 1, malformed UTF-8")
stdout.to_s.should contain("Format #{Path[".", "format.cr"]}")
stderr.to_s.should contain("syntax error in '#{Path[".", "syntax_error.cr"]}:1:3': unexpected token: EOF")
stderr.to_s.should contain("file '#{Path[".", "invalid_byte_sequence_error.cr"]}' is not a valid Crystal source file: Unexpected byte 0xff at position 1, malformed UTF-8")

File.read(File.join(path, "format.cr")).should eq("if true\n 1\nend\n")
end
Expand All @@ -182,7 +182,7 @@ describe Crystal::Command::FormatCommand do
format_command = BuggyFormatCommand.new([] of String, color: false, stdin: stdin, stdout: stdout, stderr: stderr)
format_command.run
format_command.status_code.should eq(1)
stderr.to_s.should contain("there's a bug formatting './empty.cr', to show more information, please run:\n\n $ crystal tool format --show-backtrace './empty.cr'")
stderr.to_s.should contain("there's a bug formatting '#{Path[".", "empty.cr"]}', to show more information, please run:\n\n $ crystal tool format --show-backtrace '#{Path[".", "empty.cr"]}'")
end
end
end
Expand All @@ -201,7 +201,7 @@ describe Crystal::Command::FormatCommand do
format_command.run
format_command.status_code.should eq(1)
stderr.to_s.should contain("format command test")
stderr.to_s.should contain("couldn't format './empty.cr', please report a bug including the contents of it: https://github.com/crystal-lang/crystal/issues")
stderr.to_s.should contain("couldn't format '#{Path[".", "empty.cr"]}', please report a bug including the contents of it: https://github.com/crystal-lang/crystal/issues")
end
end
end
Expand All @@ -224,9 +224,9 @@ describe Crystal::Command::FormatCommand do
format_command.status_code.should eq(1)
stdout.to_s.empty?.should be_true
stderr.to_s.should_not contain("not_format.cr")
stderr.to_s.should contain("formatting './format.cr' produced changes")
stderr.to_s.should contain("syntax error in './syntax_error.cr:1:3': unexpected token: EOF")
stderr.to_s.should contain("file './invalid_byte_sequence_error.cr' is not a valid Crystal source file: Unexpected byte 0xff at position 1, malformed UTF-8")
stderr.to_s.should contain("formatting '#{Path[".", "format.cr"]}' produced changes")
stderr.to_s.should contain("syntax error in '#{Path[".", "syntax_error.cr"]}:1:3': unexpected token: EOF")
stderr.to_s.should contain("file '#{Path[".", "invalid_byte_sequence_error.cr"]}' is not a valid Crystal source file: Unexpected byte 0xff at position 1, malformed UTF-8")
end
end
end
Expand Down Expand Up @@ -286,7 +286,7 @@ describe Crystal::Command::FormatCommand do
format_command.run
format_command.status_code.should eq(1)
stdout.to_s.empty?.should be_true
stderr.to_s.should contain("formatting './format.cr' produced changes")
stderr.to_s.should contain("formatting '#{Path[".", "format.cr"]}' produced changes")
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/compiler/crystal/tools/init_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ module Crystal
config.expanded_dir.should eq ::Path[Dir.current, "foo", "bar"]
end

it "DIR (relative to home)" do
pending_win32 "DIR (relative to home)" do
path = ::Path["~", "foo"].to_s
config = Crystal::Init.parse_args(["lib", path])
config.name.should eq "foo"
Expand Down
2 changes: 2 additions & 0 deletions spec/compiler/crystal/tools/playground_spec.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{% skip_file if flag?(:without_playground) %}

require "../../../spec_helper"

private def instrument(source)
Expand Down
4 changes: 2 additions & 2 deletions spec/compiler/crystal_path/crystal_path_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require "../../support/env"
private def assert_finds(search, results, relative_to = nil, path = __DIR__, file = __FILE__, line = __LINE__)
it "finds #{search.inspect}", file, line do
crystal_path = Crystal::CrystalPath.new(path)
results = results.map { |result| File.join(__DIR__, result) }
results = results.map { |result| ::Path[__DIR__, result].normalize.to_s }
Dir.cd(__DIR__) do
matches = crystal_path.find search, relative_to: relative_to
matches.should eq(results), file: file, line: line
Expand Down Expand Up @@ -112,7 +112,7 @@ describe Crystal::CrystalPath do
end

it "overrides path with environment variable" do
with_env("CRYSTAL_PATH": "foo:bar") do
with_env("CRYSTAL_PATH": "foo#{Process::PATH_DELIMITER}bar") do
crystal_path = Crystal::CrystalPath.new
crystal_path.entries.should eq(%w(foo bar))
end
Expand Down
6 changes: 3 additions & 3 deletions spec/compiler/semantic/generic_class_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ describe "Semantic: generic class" do
"use a more specific type"
end

it "errors on too nested generic instance" do
pending_win32 "errors on too nested generic instance" do
assert_error %(
class Foo(T)
end
Expand All @@ -493,7 +493,7 @@ describe "Semantic: generic class" do
"generic type too nested"
end

it "errors on too nested generic instance, with union type" do
pending_win32 "errors on too nested generic instance, with union type" do
assert_error %(
class Foo(T)
end
Expand All @@ -507,7 +507,7 @@ describe "Semantic: generic class" do
"generic type too nested"
end

it "errors on too nested tuple instance" do
pending_win32 "errors on too nested tuple instance" do
assert_error %(
def foo
{typeof(foo)}
Expand Down
2 changes: 1 addition & 1 deletion spec/compiler/semantic/primitives_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ describe "Semantic: primitives" do
"method marked as Primitive must have an empty body"
end

it "types va_arg primitive" do
pending_win32 "types va_arg primitive" do
assert_type(%(
struct VaList
@[Primitive(:va_arg)]
Expand Down
4 changes: 2 additions & 2 deletions spec/std/exception/call_stack_spec.cr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require "../spec_helper"

describe "Backtrace" do
it "prints file line:colunm" do
pending_win32 "prints file line:colunm" do
source_file = datapath("backtrace_sample")

# CallStack tries to make files relative to the current dir,
Expand Down Expand Up @@ -34,7 +34,7 @@ describe "Backtrace" do
error.to_s.should contain("IndexError")
end

it "prints crash backtrace to stderr" do
pending_win32 "prints crash backtrace to stderr" do
sample = datapath("crash_backtrace_sample")

_, output, error = compile_and_run_file(sample)
Expand Down
2 changes: 1 addition & 1 deletion spec/std/io/file_descriptor_spec.cr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require "../spec_helper"

describe IO::FileDescriptor do
it "reopen STDIN with the right mode" do
pending_win32 "reopen STDIN with the right mode" do
code = %q(puts "#{STDIN.blocking} #{STDIN.info.type}")
compile_source(code) do |binpath|
`#{Process.quote(binpath)} < #{Process.quote(binpath)}`.chomp.should eq("true File")
Expand Down
Loading