diff options
| author | Rémi Verschelde | 2017-01-08 14:08:18 +0100 |
|---|---|---|
| committer | Rémi Verschelde | 2017-01-12 19:15:30 +0100 |
| commit | ff490e42da1afcdedd5e8b9ba8607e6cef6413cb (patch) | |
| tree | 2299d50c5c81633f96ff959c0e9c060ecf5646b3 /main/tests/test_python.cpp | |
| parent | b1fc41a3011d91b3625419e86d27085fb165b573 (diff) | |
| download | godot-ff490e42da1afcdedd5e8b9ba8607e6cef6413cb.tar.gz godot-ff490e42da1afcdedd5e8b9ba8607e6cef6413cb.tar.zst godot-ff490e42da1afcdedd5e8b9ba8607e6cef6413cb.zip | |
Diffstat (limited to 'main/tests/test_python.cpp')
| -rw-r--r-- | main/tests/test_python.cpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/main/tests/test_python.cpp b/main/tests/test_python.cpp new file mode 100644 index 000000000..f4a3d7a3a --- /dev/null +++ b/main/tests/test_python.cpp @@ -0,0 +1,56 @@ +/*************************************************************************/ +/* test_python.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ +#include "test_python.h" + +#ifdef PYTHON_ENABLED + +#include "Python.h" +#include "print_string.h" + +namespace TestPython { + +void test() { + + print_line("testing python"); + PyRun_SimpleString("import engine\n"); + PyRun_SimpleString("def test(self):\n\tprint(\"noway\")\n"); + PyRun_SimpleString("a=engine.ObjectPtr()\n"); + PyRun_SimpleString("a.noway(22,'hello')\n"); + PyRun_SimpleString("a.normalize()\n"); + PyRun_SimpleString("class Moch(engine.ObjectPtr):\n\tdef mooch(self):\n\t\tprint('muchi')\n"); + PyRun_SimpleString("b=Moch();\n"); + PyRun_SimpleString("b.mooch();\n"); + PyRun_SimpleString("b.meis();\n"); + + +} + +} + +#endif |
