quicktex/tests/run_tests.cpp

44 lines
1.5 KiB
C++
Raw Normal View History

2021-04-08 06:26:28 +00:00
/* Quicktex Texture Compression Library
2021-03-04 10:21:16 +00:00
Copyright (C) 2021 Andrew Cassidy <drewcassidy@me.com>
Partially derived from rgbcx.h written by Richard Geldreich <richgel99@gmail.com>
and licenced under the public domain
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
2021-03-08 10:23:04 +00:00
// This file allows for easy debugging in CLion or other IDEs that dont natively support cross-debugging between Python and C++
2021-03-04 10:21:16 +00:00
2021-03-08 10:23:04 +00:00
#include <pybind11/embed.h>
2021-03-11 10:18:40 +00:00
#include <array>
#include <string>
2021-03-04 10:21:16 +00:00
namespace py = pybind11;
2021-04-05 09:44:56 +00:00
using namespace pybind11::literals;
2021-03-06 22:18:08 +00:00
2021-03-08 10:23:04 +00:00
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
2021-03-07 09:39:51 +00:00
2021-03-08 10:23:04 +00:00
int main() {
py::scoped_interpreter guard{};
2021-03-07 09:39:51 +00:00
2021-03-08 10:23:04 +00:00
py::module_ site = py::module_::import("site");
2021-03-07 09:39:51 +00:00
2021-03-08 10:23:04 +00:00
site.attr("addsitedir")(CUSTOM_SYS_PATH);
2021-03-06 22:18:08 +00:00
2021-03-10 09:15:04 +00:00
py::module_ nose = py::module_::import("nose");
2021-04-05 09:44:56 +00:00
py::module_ tests = py::module_::import("tests");
py::list argv(1);
nose.attr("runmodule")("name"_a = "tests.test_bc1", "exit"_a = false);
2021-03-08 10:23:04 +00:00
}