Skip to content

Commit

Permalink
Merge branch 'master' into compilergb
Browse files Browse the repository at this point in the history
  • Loading branch information
ike709 authored Jan 28, 2025
2 parents 9f817bd + d12f5ef commit 477b924
Show file tree
Hide file tree
Showing 264 changed files with 4,175 additions and 1,606 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.100
dotnet-version: 9.0.100
- name: Install dependencies
run: dotnet restore
- name: Build
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
tar -czvf output_tools/OpenDreamServer_TOOLS_${{ matrix.os == 'windows-latest' && 'win-x64' || 'linux-x64' }}.tar.gz -C output_tools OpenDreamServer_${{ matrix.os == 'windows-latest' && 'win-x64' || 'linux-x64' }}
- name: Upload artifact
if: github.event_name == 'push'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.os }}
path: |
Expand All @@ -73,7 +73,7 @@ jobs:
if: github.event_name == 'push'
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Publish latest release
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/compiler-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,14 @@ jobs:
run: |
cd main/
git submodule update --init --recursive
- name: Pull engine updates
uses: space-wizards/[email protected]
- name: Update Engine Submodules
run: |
cd main/RobustToolbox/
git submodule update --init --recursive
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.100
dotnet-version: 9.0.100
- name: Install compiler dependencies
run: dotnet restore main/DMCompiler/DMCompiler.csproj
- name: Install disassembler dependencies
Expand All @@ -38,6 +36,10 @@ jobs:
run: dotnet build main/DMDisassembler/DMDisassembler.csproj --property WarningLevel=0 --configuration Release --no-restore /m
- name: Compile TestGame
run: main\bin\DMCompiler\DMCompiler.exe main\TestGame\environment.dme --suppress-unimplemented
- name: Compile TestGame in directory
run: |
cd main\TestGame\
..\bin\DMCompiler\DMCompiler.exe environment.dme --suppress-unimplemented
- name: Checkout /tg/station Master
uses: actions/checkout@v2
with:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ name: Lint
on:
pull_request:
branches: [master]
types: [opened, synchronize, reopened, ready_for_review]

jobs:
lint:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

steps:
Expand All @@ -16,7 +18,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.100
dotnet-version: 9.0.100
- name: Setup Resharper
run: dotnet tool install -g JetBrains.ReSharper.GlobalTools
- name: Run Linter
Expand Down
10 changes: 10 additions & 0 deletions Content.IntegrationTests/DMProject/Tests/atom_appearance.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/obj/thingtocopy
name = "hello"
desc = "this is a thing"

/proc/test_appearance()
var/obj/thingtocopy/T = new()
var/obj/otherthing = new()
otherthing.appearance = T.appearance
ASSERT(otherthing.name == T.name)
ASSERT(otherthing.desc == T.desc)
16 changes: 16 additions & 0 deletions Content.IntegrationTests/DMProject/Tests/filter_initial.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/obj/blurry
filters = filter(type="blur", size=2)

/obj/veryblurry
filters = list(type="blur", size=4)

/obj/notatallblurry
filters = list()

/proc/test_filter_init()
var/obj/veryblurry/VB = new()
ASSERT(length(VB.filters) == 1)
var/obj/blurry/B = new()
ASSERT(length(B.filters) == 1)
var/obj/notatallblurry/NAB = new()
ASSERT(length(NAB.filters) == 0)
Binary file added Content.IntegrationTests/DMProject/Tests/icons.dmi
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
plane = 123
icon_state = "subclass"

/proc/RunTest()
/proc/test_images()
ASSERT(image('icons.dmi', "mob") != null)

var/image/test = new /image/subclass
ASSERT(test.plane == 123)
ASSERT(test.icon_state == "subclass")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
out += dir
ASSERT(out == 14)

/proc/RunTest()
/proc/test_nonlocal_var()
var/mob/m = new
m.dodir()
13 changes: 13 additions & 0 deletions Content.IntegrationTests/DMProject/Tests/string_interpolation.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/obj/blombo
name = "Blombo"
gender = FEMALE

/obj/blorpo
name = "Blorpo"
gender = MALE

/proc/test_string_interpolation()
var/obj/blombo/b = new
var/obj/blorpo/b2 = new
var/result_text = "[b]? Nobody likes \him. \He is awful! Unlike [b2]. \He is pretty cool!"
ASSERT(result_text == "Blombo? Nobody likes her. She is awful! Unlike Blorpo. He is pretty cool!")
5 changes: 5 additions & 0 deletions Content.IntegrationTests/DMProject/code.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,9 @@
test_color_matrix()
test_range()
test_verb_duplicate()
test_appearance()
test_nonlocal_var()
test_images()
test_filter_init()
test_string_interpolation()
world.log << "IntegrationTests successful, /world/New() exiting..."
5 changes: 5 additions & 0 deletions Content.IntegrationTests/DMProject/environment.dme
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#include "code.dm"
#include "Tests/atom_appearance.dm"
#include "Tests/block.dm"
#include "Tests/color_matrix.dm"
#include "Tests/range.dm"
#include "Tests/verb_duplicate.dm"
#include "Tests/nonlocal_var.dm"
#include "Tests/image.dm"
#include "Tests/filter_initial.dm"
#include "Tests/string_interpolation.dm"
#include "map.dmm"
#include "interface.dmf"
1 change: 1 addition & 0 deletions Content.Tests/ContentUnitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Reflection;
using OpenDreamClient;
using OpenDreamRuntime;
using OpenDreamRuntime.Map;
using OpenDreamRuntime.Rendering;
using OpenDreamShared;
using OpenDreamShared.Rendering;
Expand Down

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions Content.Tests/DMProject/Broken Tests/Procs/Arglist/initial.dm

This file was deleted.

15 changes: 0 additions & 15 deletions Content.Tests/DMProject/Broken Tests/Tree/pathop_lhs.dm

This file was deleted.

6 changes: 6 additions & 0 deletions Content.Tests/DMProject/BrokenTests/Const/ConstProc.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
var/const/ConstProc1_a = rgb(0,0,255)

/proc/RunTest()
var/const/ConstProc1_b = rgb(0,0,255)
ASSERT(ConstProc1_a == "#0000ff")
ASSERT(ConstProc1_b == "#0000ff")
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// COMPILE ERROR
// COMPILE ERROR OD0011

var/a = 1 / 0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// COMPILE ERROR
// COMPILE ERROR OD0011

var/static/a = 1 / 0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// COMPILE ERROR
// COMPILE ERROR OD0011

/proc/one()
return 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// COMPILE ERROR
// COMPILE ERROR OD0011

var/const/a = 0
var/b = 1 / a
Expand Down
7 changes: 5 additions & 2 deletions Content.Tests/DMProject/Tests/Builtins/__IMPLIED_TYPE__.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@


/datum/test/var/bar = "foobar"
/datum/test
/proc/RunTest()
var/datum/test/D = __IMPLIED_TYPE__
ASSERT(D.bar == "foobar")
ASSERT(D == /datum/test)
D = ArgumentTest(__IMPLIED_TYPE__)

/proc/ArgumentTest(some_argument)
ASSERT(some_argument == /datum/test)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

/proc/RunTest()
var/a = 1#INF
var/b = -1#INF
var/c = -1#IND
ASSERT("[a]" == "inf")
ASSERT("[b]" == "-inf")
ASSERT("[c]" == "nan")
7 changes: 7 additions & 0 deletions Content.Tests/DMProject/Tests/Expression/String/raw2.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

//# issue 380

/proc/RunTest()
var/a = @(ZZZ)
asdfZZZ
ASSERT(a == "asdf")
7 changes: 7 additions & 0 deletions Content.Tests/DMProject/Tests/Expression/String/raw3.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

//# issue 380

/proc/RunTest()
var/a = @(ZZQ)
asdfZZQ
ASSERT(a == "asdf")
11 changes: 11 additions & 0 deletions Content.Tests/DMProject/Tests/Expression/proccall_keyword_param.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

//# issue 655
//# issue 265

/datum/proc/nullproc(null, temp)
ASSERT(isnull(null))
ASSERT(temp == 2)

/proc/RunTest()
var/datum/D = new
D.nullproc(1,2)
2 changes: 0 additions & 2 deletions Content.Tests/DMProject/Tests/Image/Image.dm

This file was deleted.

8 changes: 8 additions & 0 deletions Content.Tests/DMProject/Tests/List/ListAppendSelf.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/proc/RunTest()
var/L1 = list(1, 2)
L1 += L1
ASSERT(L1 ~= list(1, 2, 1, 2))

var/L2 = list(a=1, b=2)
L2 += L2
ASSERT(L2 ~= list(a=1, b=2, "a", "b"))
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUNTIME ERROR

/proc/ListNullArg2(a[5][3])
ASSERT(a[1].len == 3)
ASSERT(a[1].len == 3) // a should be null

/proc/RunTest()
ListNullArg2()
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUNTIME ERROR

/proc/ListNullArg1(a[5])
ASSERT(a.len == 5)
ASSERT(a.len == 5) // a should be null

/proc/RunTest()
ListNullArg1()
18 changes: 9 additions & 9 deletions Content.Tests/DMProject/Tests/Operators/Division.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,39 @@
var/list/expected = list(
1,
"Error",
10,
"Error",
"Error", // index 5
"Error",
"Error",
"Error",
"Error",
"Error", // index 10
"Error",
"Error",
"Error",
"Error",
"Error", // index 15
"Error",
"Error",
"Error",
"Error",
"Error", // index 20
"Error",
"Error",
"Error",
"Error",
"Error",
"Error",
"Error",
0,
0,
0,
0, // index 25
0,
0,
0,
0,
0, // index 30
0,
0,
0,
0,
"Error",
"Error",
"Error", // index 35
"Error",
"Error",
"Error",
Expand Down Expand Up @@ -128,4 +128,4 @@
"Error"
)

test_binary_operator(/proc/divide, expected)
test_binary_operator(/proc/divide, expected)
Loading

0 comments on commit 477b924

Please sign in to comment.