Skip to content

Commit

Permalink
Modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyjor committed Sep 26, 2024
1 parent 4b8513c commit 066b6a9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
9 changes: 5 additions & 4 deletions test/projects/SmokeTest/src/SmokeTest.jl
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
module SmokeTest
using JulGame
function run(SMOKETESTDIR, Test)
JulGame.MAIN = JulGame.Main(Float64(1.0))
MAIN.testMode = true
MAIN.testLength = 10.0
MAIN.currentTestTime = 0.0
JulGame.PIXELS_PER_UNIT = 16

scene = SceneBuilderModule.Scene("scene.json", SMOKETESTDIR)
try
SceneBuilderModule.load_and_prepare_scene(;this=scene, globals=[Test])
SceneBuilderModule.load_and_prepare_scene(;this=SceneBuilderModule.Scene("scene.json", SMOKETESTDIR), globals=[Test])
catch e
@error e
Base.show_backtrace(stderr, catch_backtrace())
return -1
end

return 0
end
end
end # module
29 changes: 14 additions & 15 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
using JulGame
using Test

ROOTDIR = joinpath(@__DIR__, "..")
EXAMPLEGAMEDIR = joinpath(ROOTDIR, "examples")
SMOKETESTDIR = joinpath(@__DIR__, "projects", "SmokeTest")
PROFILINGTESTDIR = joinpath(@__DIR__, "projects", "ProfilingTest")
include(joinpath(SMOKETESTDIR, "src", "SmokeTest.jl"))
include(joinpath(PROFILINGTESTDIR, "Platformer", "src", "Platformer.jl"))
# include(joinpath(PROFILINGTESTDIR, "Platformer", "src", "Platformer.jl"))

@testset "All tests" begin
cd(joinpath(@__DIR__, "projects", "ProfilingTest", "Platformer", "src"))
@testset "Platformer" begin
@test run_platformer() == 0
end
# cd(joinpath(@__DIR__, "projects", "ProfilingTest", "Platformer", "src"))
# @testset "Platformer" begin
# @test run_platformer() == 0
# end

include("math/mathtests.jl")
#include("math/mathtests.jl")

cd(joinpath(SMOKETESTDIR, "src"))
@test run(SMOKETESTDIR, Test) == 0
@test SmokeTest.run(SMOKETESTDIR, Test) == 0

if !Sys.islinux()
cd(joinpath(ROOTDIR, "src", "editor", "JulGameEditor", "src"))
include(joinpath(ROOTDIR, "src", "editor", "JulGameEditor", "src", "../Editor.jl"))
@testset "Editor" begin
@test Editor.run(true) == 0
end
end
# if !Sys.islinux()
# cd(joinpath(ROOTDIR, "src", "editor", "JulGameEditor", "src"))
# include(joinpath(ROOTDIR, "src", "editor", "JulGameEditor", "src", "../Editor.jl"))
# @testset "Editor" begin
# @test Editor.run(true) == 0
# end
# end
end

0 comments on commit 066b6a9

Please sign in to comment.