diff --git a/test/runtests.jl b/test/runtests.jl index f956e3ef..a4b25207 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -30,64 +30,62 @@ using Test, PerformanceTestTools end end -# TODO enable the VSCode-related tests +module VSCodeServer + using TypedSyntax -# module VSCodeServer -# using TypedSyntax - -# struct InlineDisplay -# is_repl::Bool -# end -# const INLAY_HINTS_ENABLED = Ref(true) -# const DIAGNOSTICS_ENABLED = Ref(true) + struct InlineDisplay + is_repl::Bool + end + const INLAY_HINTS_ENABLED = Ref(true) + const DIAGNOSTICS_ENABLED = Ref(true) -# inlay_hints = [] -# diagnostics = [] + inlay_hints = [] + diagnostics = [] -# function Base.display(d::InlineDisplay, x) -# if x isa Dict{String, Vector{TypedSyntax.InlayHint}} -# push!(inlay_hints, x) -# elseif eltype(x) == TypedSyntax.Diagnostic -# push!(diagnostics, x) -# end -# return nothing -# end + function Base.display(d::InlineDisplay, x) + if x isa Dict{String, Vector{TypedSyntax.InlayHint}} + push!(inlay_hints, x) + elseif eltype(x) == TypedSyntax.Diagnostic + push!(diagnostics, x) + end + return nothing + end -# function reset_test_containers() -# empty!(inlay_hints) -# empty!(diagnostics) -# end -# end -# module TestVSCodeExt # stops modules defined in test files from overwriting stuff from previous test -# using Test, PerformanceTestTools, ..VSCodeServer -# @testset "runtests.jl VSCodeExt" begin -# @testset "test_Cthulhu.jl" begin -# include("test_Cthulhu.jl") -# end + function reset_test_containers() + empty!(inlay_hints) + empty!(diagnostics) + end +end +module TestVSCodeExt # stops modules defined in test files from overwriting stuff from previous test +using Test, PerformanceTestTools, ..VSCodeServer +@testset "runtests.jl VSCodeExt" begin + @testset "test_Cthulhu.jl" begin + include("test_Cthulhu.jl") + end -# @testset "test_codeview.jl" begin -# include("test_codeview.jl") -# include("test_codeview_vscode.jl") -# end + @testset "test_codeview.jl" begin + include("test_codeview.jl") + include("test_codeview_vscode.jl") + end -# # TODO enable these tests -# if false -# @testset "test_irshow.jl" begin -# include("test_irshow.jl") -# end -# else -# @info "skipped test_irshow.jl" -# end -# if false -# @testset "test_terminal.jl" begin -# include("test_terminal.jl") -# end -# else -# @info "skipped test_terminal.jl" -# end + # TODO enable these tests + if false + @testset "test_irshow.jl" begin + include("test_irshow.jl") + end + else + @info "skipped test_irshow.jl" + end + if false + @testset "test_terminal.jl" begin + include("test_terminal.jl") + end + else + @info "skipped test_terminal.jl" + end -# @testset "test_AbstractInterpreter.jl" begin -# include("test_AbstractInterpreter.jl") -# end -# end -# end + @testset "test_AbstractInterpreter.jl" begin + include("test_AbstractInterpreter.jl") + end +end +end diff --git a/test/test_codeview_vscode.jl b/test/test_codeview_vscode.jl index 8ef87974..5256a42d 100644 --- a/test/test_codeview_vscode.jl +++ b/test/test_codeview_vscode.jl @@ -36,7 +36,7 @@ include("test_vscode_example_functions.jl") fake_terminal() do term, in, out, _ t = @async begin - @test_nowarn descend(fib, (Int,); terminal=term, iswarn, hide_type_stable, inlay_types_vscode, diagnostics_vscode) + descend(fib, (Int,); terminal=term, iswarn, hide_type_stable, inlay_types_vscode, diagnostics_vscode) end write(in, 'q') wait(t) @@ -85,7 +85,7 @@ include("test_vscode_example_functions.jl") fake_terminal() do term, in, out, _ t = @async begin - @test_nowarn descend(fVSCode, (Int,); terminal=term, iswarn, hide_type_stable, inlay_types_vscode, diagnostics_vscode) + descend(fVSCode, (Int,); terminal=term, iswarn, hide_type_stable, inlay_types_vscode, diagnostics_vscode) end write(in, 'q') wait(t) @@ -180,7 +180,7 @@ include("test_vscode_example_functions.jl") fake_terminal() do term, in, out, _ t = @async begin - @test_nowarn descend(fibcall, (Float64,); terminal=term, iswarn, hide_type_stable, inlay_types_vscode, diagnostics_vscode) + descend(fibcall, (Float64,); terminal=term, iswarn, hide_type_stable, inlay_types_vscode, diagnostics_vscode) end write(in, 'q') wait(t) @@ -232,7 +232,7 @@ include("test_vscode_example_functions.jl") fake_terminal() do term, in, out, _ t = @async begin - @test_nowarn descend(fibcall, (Int,); terminal=term, iswarn, hide_type_stable, inlay_types_vscode, diagnostics_vscode) + descend(fibcall, (Int,); terminal=term, iswarn, hide_type_stable, inlay_types_vscode, diagnostics_vscode) end write(in, 'q') wait(t)