mirror of
https://github.com/overte-org/overte.git
synced 2025-08-11 09:20:48 +02:00
Remove old tests, doesn't build on Windows
This commit is contained in:
parent
f241ede316
commit
64c0364b2e
11 changed files with 0 additions and 153 deletions
|
@ -8,25 +8,6 @@ macro (setup_testcase_dependencies)
|
||||||
link_hifi_libraries(shared test-utils script-engine networking octree avatars entities model-networking material-networking model-serializers graphics gpu ktx shaders hfm image procedural)
|
link_hifi_libraries(shared test-utils script-engine networking octree avatars entities model-networking material-networking model-serializers graphics gpu ktx shaders hfm image procedural)
|
||||||
|
|
||||||
package_libraries_for_deployment()
|
package_libraries_for_deployment()
|
||||||
|
|
||||||
|
|
||||||
# The test system is a bit unusual in how it works, and generates targets on its own.
|
|
||||||
# This macro will be called for each of them, so we want to add stuff only to the
|
|
||||||
# right targets.
|
|
||||||
if("${TARGET_NAME}" STREQUAL "script-engine-ScriptEngineTests")
|
|
||||||
|
|
||||||
# We're going with a symlink here for ease of development -- can change the test
|
|
||||||
# without recompiling. We probably never are going to package the tests, or use
|
|
||||||
# them outside of development.
|
|
||||||
#
|
|
||||||
# Symlinks should also work fine on Windows. They're a supported feature, though
|
|
||||||
# a very rarely used one.
|
|
||||||
add_custom_command(TARGET "${TARGET_NAME}" POST_BUILD
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E create_symlink
|
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/tests"
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/tests"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
endmacro ()
|
endmacro ()
|
||||||
|
|
||||||
setup_hifi_testcase(Network)
|
setup_hifi_testcase(Network)
|
||||||
|
|
|
@ -333,42 +333,3 @@ void ScriptEngineTests::testQuat() {
|
||||||
sm->run();
|
sm->run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ScriptEngineTests::scriptTest() {
|
|
||||||
return;
|
|
||||||
|
|
||||||
QSharedPointer<ScriptEngines> ac = DependencyManager::get<ScriptEngines>();
|
|
||||||
QVERIFY(!ac.isNull());
|
|
||||||
|
|
||||||
|
|
||||||
QDir testScriptsDir("tests");
|
|
||||||
QStringList testScripts = testScriptsDir.entryList(QStringList() << "*.js", QDir::Files);
|
|
||||||
testScripts.sort();
|
|
||||||
|
|
||||||
for(QString scriptFilename : testScripts) {
|
|
||||||
scriptFilename = "tests/" + scriptFilename;
|
|
||||||
qInfo() << "Running test script: " << scriptFilename;
|
|
||||||
|
|
||||||
QString scriptSource;
|
|
||||||
|
|
||||||
{
|
|
||||||
QFile scriptFile(scriptFilename);
|
|
||||||
scriptFile.open(QIODevice::ReadOnly);
|
|
||||||
QTextStream scriptStream(&scriptFile);
|
|
||||||
scriptSource.append(scriptStream.readAll());
|
|
||||||
|
|
||||||
// Scripts keep on running until Script.stop() is called. For our tests here,
|
|
||||||
// that's not desirable, so we append an automatic stop at the end of every
|
|
||||||
// script.
|
|
||||||
scriptSource.append("\nScript.stop(true);\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//qDebug() << "Source: " << scriptSource;
|
|
||||||
|
|
||||||
ScriptManagerPointer sm = makeManager(scriptSource, scriptFilename);
|
|
||||||
sm->run();
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO: Add a test for Script.require(JSON)
|
|
||||||
}
|
|
||||||
|
|
|
@ -54,7 +54,6 @@ class ScriptEngineTests : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private slots:
|
private slots:
|
||||||
void initTestCase();
|
void initTestCase();
|
||||||
void scriptTest();
|
|
||||||
void testTrivial();
|
void testTrivial();
|
||||||
void testSyntaxError();
|
void testSyntaxError();
|
||||||
void testRuntimeError();
|
void testRuntimeError();
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
print("Script.require: " + JSON.stringify(Script.require));
|
|
||||||
print("Script.require.cache: " + JSON.stringify(Script.require.cache));
|
|
||||||
print(JSON.stringify("Script.require.test_prop before defining: " + Script.require.test_prop));
|
|
||||||
Script.require.test_prop = "test property";
|
|
||||||
print(JSON.stringify("Script.require.test_prop after defining: " + Script.require.test_prop));
|
|
||||||
print("Before require");
|
|
||||||
// TODO: find correct local path for the test module
|
|
||||||
requireTest = Script.require("http://oaktown.pl/scripts/004b_require_module.js");
|
|
||||||
print("After require");
|
|
||||||
requireTest.moduleFunction1();
|
|
||||||
requireTest.moduleFunction2();
|
|
|
@ -1,9 +0,0 @@
|
||||||
print("Print inside module script");
|
|
||||||
module.exports = {
|
|
||||||
moduleFunction1: function () {
|
|
||||||
print("moduleFunction1 works");
|
|
||||||
},
|
|
||||||
moduleFunction2: function () {
|
|
||||||
print("moduleFunction2 works");
|
|
||||||
}
|
|
||||||
};
|
|
|
@ -1,13 +0,0 @@
|
||||||
"use strict";
|
|
||||||
|
|
||||||
Script.include("./005b_included.js");
|
|
||||||
|
|
||||||
//var requireTest = Script.require("http://oaktown.pl/scripts/004b_require_module.js");
|
|
||||||
|
|
||||||
var testObject = new TestObject();
|
|
||||||
|
|
||||||
function functionInMainFile () {
|
|
||||||
print("In main file");
|
|
||||||
}
|
|
||||||
|
|
||||||
functionInInclude();
|
|
|
@ -1,23 +0,0 @@
|
||||||
"use strict";
|
|
||||||
|
|
||||||
function functionInInclude() {
|
|
||||||
print("Function in include");
|
|
||||||
functionInMainFile();
|
|
||||||
}
|
|
||||||
|
|
||||||
var TestObject = function(shouldUseEditTabletApp) {
|
|
||||||
var requireTest = Script.require("http://oaktown.pl/scripts/004b_require_module.js");
|
|
||||||
|
|
||||||
var onEvent = function(data) {
|
|
||||||
that.thatFunction();
|
|
||||||
}
|
|
||||||
var that = {};
|
|
||||||
that.thatFunction = function() {
|
|
||||||
functionInMainFile();
|
|
||||||
}
|
|
||||||
Script.update.connect(onEvent);
|
|
||||||
}
|
|
||||||
|
|
||||||
functionInMainFile();
|
|
||||||
|
|
||||||
//Script.setInterval(functionInInclude, 1000);
|
|
|
@ -1,12 +0,0 @@
|
||||||
//
|
|
||||||
// Copyright 2023 Overte e.V.
|
|
||||||
//
|
|
||||||
// Distributed under the Apache License, Version 2.0.
|
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
//
|
|
||||||
|
|
||||||
var v = 1;
|
|
||||||
for (v = 1; v < 30; v++){
|
|
||||||
print(v);
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
//
|
|
||||||
// Copyright 2023 Overte e.V.
|
|
||||||
//
|
|
||||||
// Distributed under the Apache License, Version 2.0.
|
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
//
|
|
||||||
|
|
||||||
console.log("I'm testing!");
|
|
|
@ -1,16 +0,0 @@
|
||||||
//
|
|
||||||
// Copyright 2023 Overte e.V.
|
|
||||||
//
|
|
||||||
// Distributed under the Apache License, Version 2.0.
|
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
//
|
|
||||||
|
|
||||||
print(JSON.stringify(this));
|
|
||||||
var v1 = { x: 1, y: 0, z: 3 };
|
|
||||||
var v2 = { x: 1, y: 0, z: 1 };
|
|
||||||
print(JSON.stringify(Vec3.sum(v1,v2)));
|
|
||||||
console.log("Test message");
|
|
||||||
print(JSON.stringify(TREE_SCALE));
|
|
||||||
print(JSON.stringify(Vec3.sum(v1,v2)));
|
|
||||||
print(JSON.stringify(TREE_SCALE));
|
|
|
@ -1 +0,0 @@
|
||||||
foo();
|
|
Loading…
Reference in a new issue