-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into better-switch-errors
# Conflicts: # DMCompiler/DMStandard/DefaultPragmaConfig.dm # OpenDreamShared/Compiler/CompilerError.cs
- Loading branch information
Showing
267 changed files
with
12,919 additions
and
8,517 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Test tgstation-server Integration | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
concurrency: | ||
group: "tgs-${{ github.head_ref || github.run_id }}-${{ github.event_name }}" | ||
cancel-in-progress: true | ||
|
||
env: | ||
OD_DOTNET_VERSION: 7 | ||
TGS_DOTNET_VERSION: 8 | ||
TGS_REFERENCE: V6 # This will break after the V6 branch gets deleted during the TGS6 release cycle. When it does, change this to `dev` | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu-latest, windows-latest ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Disable ptrace_scope | ||
if: matrix.os == 'ubuntu-latest' | ||
run: echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope | ||
|
||
- name: Install gdb | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y gdb | ||
- name: Setup dotnet | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: | | ||
${{ env.TGS_DOTNET_VERSION }}.0.x | ||
${{ env.OD_DOTNET_VERSION }}.0.x | ||
- name: Checkout OpenDream | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
fetch-tags: true | ||
submodules: true | ||
|
||
- name: Pull engine updates | ||
uses: space-wizards/[email protected] | ||
|
||
- name: Update Engine Submodules | ||
run: | | ||
cd RobustToolbox/ | ||
git submodule update --init --recursive | ||
- name: Checkout TGS | ||
run: | | ||
cd .. | ||
git clone https://github.com/tgstation/tgstation-server --depth 1 --branch ${{ env.TGS_REFERENCE }} | ||
- name: Build TGS Integration Tests | ||
run: | | ||
cd ../tgstation-server | ||
dotnet build -c ReleaseNoWindows -p:TGS_HOST_NO_WEBPANEL=true tests/Tgstation.Server.Tests/Tgstation.Server.Tests.csproj | ||
- name: Run TGS OpenDream Tests | ||
shell: bash | ||
run: | | ||
cd ../tgstation-server/tests/Tgstation.Server.Tests | ||
export TGS_TEST_OD_EXCLUSIVE=true | ||
export TGS_TEST_OD_ENGINE_VERSION=$GITHUB_SHA | ||
export TGS_TEST_OD_GIT_DIRECTORY="../../../../../../${{ github.event.repository.name }}" | ||
export TGS_TEST_DATABASE_TYPE=Sqlite | ||
export TGS_TEST_CONNECTION_STRING="Data Source=TGS.sqlite3;Mode=ReadWriteCreate" | ||
dotnet test -c ReleaseNoWindows --no-build --filter Name=TestOpenDreamExclusiveTgsOperation --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" --settings ../../build/ci.runsettings --results-directory ../../TestResults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
[Dd]ebugPublic/ | ||
[Rr]elease/ | ||
[Rr]eleases/ | ||
release/ | ||
x64/ | ||
x86/ | ||
bld/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
|
||
// Issue #1336 | ||
#define JSON(e) json_decode(json_encode(e)) | ||
#define TEST(v) ASSERT(JSON(v) == v) | ||
|
||
// These two do not support nested lists at the moment | ||
/proc/list_test(list/l) | ||
var/n = length(l) | ||
var/lj = JSON(l) | ||
ASSERT(length(lj) == n) | ||
|
||
if(!n) return | ||
var/c = 0 | ||
for (var/i in 1 to n) | ||
c += lj[i] == l[i] | ||
ASSERT(c == n) | ||
|
||
/proc/list_assoc_test(list/l) | ||
var/n = length(l) | ||
var/lj = JSON(l) | ||
ASSERT(length(lj) == n) | ||
|
||
if(!n) return | ||
var/kc = 0 | ||
var/vc = 0 | ||
for (var/i in 1 to n) | ||
kc += lj[i] == l[i] | ||
vc += lj[lj[i]] == l[l[i]] | ||
ASSERT(kc == n) | ||
ASSERT(vc == n) | ||
|
||
/proc/RunTest() | ||
TEST(0.0) | ||
TEST(5) | ||
ASSERT(isnan(JSON(1.#IND))) | ||
TEST(-1.#INF) | ||
TEST(1.#INF) | ||
|
||
list_test(list()) | ||
list_test(list(1)) | ||
list_test(list(1,2,3,4,5)) | ||
|
||
list_assoc_test(list("c" = 5)) | ||
list_assoc_test(list("a" = 1, "b" = 2)) | ||
list_assoc_test(list("a" = 1, "b" = 2, "c" = 5)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// NaN != NaN in BYOND | ||
#define isnan(x) ( (x) != (x) ) | ||
|
||
/proc/RunTest() | ||
ASSERT(text2num(null) == null) | ||
ASSERT(text2num("") == null) | ||
ASSERT(text2num(".") == null) | ||
ASSERT(text2num("-") == null) | ||
ASSERT(text2num("+") == null) | ||
|
||
ASSERT(text2num("12") == 12) | ||
ASSERT(text2num("+12") == 12) | ||
ASSERT(text2num("-12") == -12) | ||
ASSERT(text2num("0") == 0) | ||
ASSERT(text2num("1.0") == 1) | ||
ASSERT(text2num("1.2344") == 1.2344) | ||
ASSERT(text2num("0.0") == 0) | ||
ASSERT(text2num(".4") == 0.4) | ||
|
||
ASSERT(text2num("Z", 36) == 35) | ||
ASSERT(text2num("A", 16) == 10) | ||
ASSERT(text2num("z", 36) == 35) | ||
ASSERT(text2num("a", 16) == 10) | ||
|
||
ASSERT(text2num("F.A", 16) == 15.625) | ||
ASSERT(text2num("f.a", 16) == 15.625) | ||
ASSERT(text2num("F.A", 15) == null) | ||
ASSERT(text2num("Z.0", 36) == 35) | ||
|
||
ASSERT(text2num("F..A", 16) == 15) | ||
ASSERT(text2num("4 2") == 4) | ||
|
||
ASSERT(text2num("0xA") == 10) | ||
ASSERT(text2num("0xA", 16) == 10) | ||
ASSERT(text2num("0xA", 15) == 0) | ||
ASSERT(text2num("0xA", 36) == 1198) | ||
|
||
ASSERT(isnan(text2num("nan"))) | ||
ASSERT(isnan(text2num(" -nansomething"))) |
7 changes: 7 additions & 0 deletions
7
Content.Tests/DMProject/Tests/Expression/Constants/resource.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
/proc/RunTest() | ||
var/resource = 'data/test.txt' | ||
ASSERT(file2text(resource) == "Test resource file's content") | ||
|
||
// Compile-time resources always use a forward slash | ||
// file() does not | ||
ASSERT("['data/test.txt']" == "data/test.txt") | ||
ASSERT("['data\\test.txt']" == "data/test.txt") | ||
ASSERT("[file("data/test.txt")]" == "data/test.txt") | ||
ASSERT("[file("data\\test.txt")]" == "data\\test.txt") // Note the backslash here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/datum | ||
var/composite_expr = 4 * sin(3 + cos(2)) | ||
var/sintest = sin(45) | ||
var/costest = cos(123) | ||
var/tantest = tan(123) | ||
var/sqrttest = sqrt(123) | ||
var/arcsintest = arcsin(sin(45)) | ||
var/arccostest = arccos(cos(123)) | ||
var/arctantest = arctan(tan(69)) | ||
var/log_test = log(10) | ||
var/log10_test = log(10, 100) | ||
var/arctan2_test = arctan(1, 3) | ||
var/abs_test = abs(-213) | ||
|
||
#define EPSILON 4e-6 | ||
#define APX_EQUAL(a, b) ASSERT(abs(a - b) < EPSILON) | ||
|
||
/proc/RunTest() | ||
var/break_const_eval = null | ||
var/datum/d = new /datum | ||
|
||
APX_EQUAL(initial(d.composite_expr), 4 * sin(3 + cos(break_const_eval || 2))) | ||
APX_EQUAL(d.composite_expr, 4 * sin(3 + cos(break_const_eval || 2))) | ||
|
||
APX_EQUAL(d.sintest, sin(break_const_eval || 45)) | ||
APX_EQUAL(d.sintest, 0.707106769084930419921875) | ||
|
||
APX_EQUAL(d.costest, cos(break_const_eval || 123)) | ||
APX_EQUAL(d.costest, -0.544639050960540771484375) | ||
|
||
APX_EQUAL(d.tantest, tan(break_const_eval || 123)) | ||
APX_EQUAL(d.tantest, -1.539865016937255859375) | ||
|
||
APX_EQUAL(d.sqrttest, sqrt(break_const_eval || 123)) | ||
APX_EQUAL(d.sqrttest, 11.0905361175537109375) | ||
|
||
APX_EQUAL(d.arcsintest, arcsin(sin(break_const_eval || 45))) | ||
APX_EQUAL(d.arcsintest, 45) | ||
|
||
APX_EQUAL(d.arccostest, arccos(cos(break_const_eval || 123))) | ||
APX_EQUAL(d.arccostest, 123) | ||
|
||
APX_EQUAL(d.arctantest, arctan(tan(break_const_eval || 69))) | ||
APX_EQUAL(d.arctantest, 69) | ||
|
||
APX_EQUAL(d.log_test, log(break_const_eval || 10)) | ||
APX_EQUAL(d.log_test, 2.302585124969482421875) | ||
|
||
APX_EQUAL(d.log10_test, log(break_const_eval || 10, 100)) | ||
APX_EQUAL(d.log10_test, 2) | ||
|
||
APX_EQUAL(d.arctan2_test, arctan(break_const_eval || 1, 3)) | ||
APX_EQUAL(d.arctan2_test, 71.5650482177734375) | ||
|
||
APX_EQUAL(d.abs_test, abs(break_const_eval || -213)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/proc/RunTest() | ||
var/list/L = list("a", "b", "c") | ||
|
||
ASSERT(L.Find("b") == 2) | ||
|
||
ASSERT(L.Find("b", 1) == 2) | ||
ASSERT(L.Find("b", 2) == 2) | ||
ASSERT(L.Find("b", 3) == 0) | ||
|
||
ASSERT(L.Find("b", 1, 0) == 2) | ||
ASSERT(L.Find("b", 2, 0) == 2) | ||
ASSERT(L.Find("b", 3, 0) == 0) | ||
|
||
ASSERT(L.Find("b", 1, 1) == 0) | ||
ASSERT(L.Find("b", 1, 2) == 2) | ||
ASSERT(L.Find("b", 1, 3) == 2) | ||
|
||
ASSERT(L.Find("b", new /datum) == 2) | ||
ASSERT(L.Find("b", "c") == 2) | ||
ASSERT(L.Find("b", 1, new /datum) == 2) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/proc/RunTest() | ||
ASSERT(arctan(0) == 0) | ||
ASSERT(arctan(1) == 45) | ||
ASSERT(arctan(sqrt(3)) == 60) | ||
ASSERT(round(arctan(3, 4)) == round(53.1301)) //that float precision tho | ||
ASSERT(arctan(-1, 1) == 135) | ||
ASSERT(arctan(0, -5) == -90) |
Oops, something went wrong.