From 27ad4d05e58eea4b12d8509a43251b8214c67e0e Mon Sep 17 00:00:00 2001 From: Marten Lohstroh Date: Thu, 25 Jan 2024 23:29:45 -0800 Subject: [PATCH] Updated known-good --- lingua-franca | 2 +- package-lock.json | 18 +- test/known-good/Cpp/src/PreambleImport.html | 128 +++++++++ test/known-good/Cpp/src/PreambleTest.html | 297 +++++++++++++++++++- 4 files changed, 421 insertions(+), 24 deletions(-) create mode 100644 test/known-good/Cpp/src/PreambleImport.html diff --git a/lingua-franca b/lingua-franca index e2e36ea95..cdff920e4 160000 --- a/lingua-franca +++ b/lingua-franca @@ -1 +1 @@ -Subproject commit e2e36ea95ced2569633ad8fb7de05d9fa0ad7207 +Subproject commit cdff920e4be85ec456882313f269fc7e0939f701 diff --git a/package-lock.json b/package-lock.json index 371fd2cba..f6bb98b2e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "@types/rimraf": "^3.0.2", "@types/vscode": "^1.49.0", "@types/which": "^2.0.1", - "@vscode/test-electron": "^2.1.3", + "@vscode/test-electron": "^2.3.9", "@vscode/vsce": "^2.21.0", "chai": "^4.3.4", "chai-spies": "^1.0.0", @@ -246,15 +246,15 @@ "license": "MIT" }, "node_modules/@vscode/test-electron": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.2.tgz", - "integrity": "sha512-CRfQIs5Wi5Ok5SUCC3PTvRRXa74LD43cSXHC8EuNlmHHEPaJa/AGrv76brcA1hVSxrdja9tiYwp95Lq8kwY0tw==", + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.9.tgz", + "integrity": "sha512-z3eiChaCQXMqBnk2aHHSEkobmC2VRalFQN0ApOAtydL172zXGxTwGrRtviT5HnUB+Q+G3vtEYFtuQkYqBzYgMA==", "dev": true, "dependencies": { "http-proxy-agent": "^4.0.1", "https-proxy-agent": "^5.0.0", "jszip": "^3.10.1", - "semver": "^7.3.8" + "semver": "^7.5.2" }, "engines": { "node": ">=16" @@ -4231,15 +4231,15 @@ "dev": true }, "@vscode/test-electron": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.2.tgz", - "integrity": "sha512-CRfQIs5Wi5Ok5SUCC3PTvRRXa74LD43cSXHC8EuNlmHHEPaJa/AGrv76brcA1hVSxrdja9tiYwp95Lq8kwY0tw==", + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.9.tgz", + "integrity": "sha512-z3eiChaCQXMqBnk2aHHSEkobmC2VRalFQN0ApOAtydL172zXGxTwGrRtviT5HnUB+Q+G3vtEYFtuQkYqBzYgMA==", "dev": true, "requires": { "http-proxy-agent": "^4.0.1", "https-proxy-agent": "^5.0.0", "jszip": "^3.10.1", - "semver": "^7.3.8" + "semver": "^7.5.2" }, "dependencies": { "agent-base": { diff --git a/test/known-good/Cpp/src/PreambleImport.html b/test/known-good/Cpp/src/PreambleImport.html new file mode 100644 index 000000000..5b3b3137d --- /dev/null +++ b/test/known-good/Cpp/src/PreambleImport.html @@ -0,0 +1,128 @@ + +// This tests checks if the preamble of an imported reactor is included correctly even if the reactor is not used. + + + +target + + + + + +Cpp + + + + + + + +import + + + + + +PreambleFoo + + + + + +from + + + + + +" + + +PreambleTest.lf + + +" + + + + + + + +main + + + + + +reactor + + + { + + + + + + +reaction + + +( + + +startup + + +) { + + += + + + + + + +std + + +:: + + +cout + + + << foo() << + + +std + + +:: + + +endl + + +; + + + + + + += + + +} + + + +} + + + + + + diff --git a/test/known-good/Cpp/src/PreambleTest.html b/test/known-good/Cpp/src/PreambleTest.html index cfaec75c7..5e872a010 100644 --- a/test/known-good/Cpp/src/PreambleTest.html +++ b/test/known-good/Cpp/src/PreambleTest.html @@ -12,6 +12,143 @@ + +// This is used to test for nested unused imports in PreambleImport.lf + + + +import + + + + + +Imported + + + + + +from + + + + + +" + + +lib/Imported.lf + + +" + + + + + + + +public + + + + + +preamble + + + { + + += + + + + int foo(); + + + += + + +} + + + + + + + +private + + + + + +preamble + + + { + + += + + + + int foo() { + + + + return + + +42 + + +; + + + + } + + + += + + +} + + + + + + + +// This is a dummy reactor to test importing of preambles in PreambleImport.lf + + + +reactor + + + + + +PreambleFoo + + + { + + + +} + + + + + + main @@ -154,13 +291,7 @@ + - - - -42 - - -; + foo(); @@ -247,13 +378,7 @@ schedule -({add_42( - - -42 - - -), +({add_42(foo()), " @@ -402,6 +527,150 @@ ; + + if ( + + +value + + +. + + +foo + + + + + += + + += + + + + + +84 + + + && + + +value + + +. + + +bar + + + + + += + + += + + + + + +" + + +baz + + +" + + +) { + + + + + + +std + + +:: + + +cout + + + << + + +" + + +Success! + + +\n + + +" + + +; + + + + } else { + + + + + + +std + + +:: + + +cout + + + << + + +" + + +Error! + + +\n + + +" + + +; + + + + exit( + + +1 + + +); + + + + } + +