This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/blenloader/tests/blendfile_loading_base_test.h
Campbell Barton c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00

46 lines
1.5 KiB
C++

/* SPDX-License-Identifier: GPL-2.0-or-later
* Copyright 2019 Blender Foundation. */
#pragma once
#include "DEG_depsgraph.h"
#include "testing/testing.h"
struct BlendFileData;
struct Depsgraph;
class BlendfileLoadingBaseTest : public testing::Test {
protected:
struct BlendFileData *bfile = nullptr;
struct Depsgraph *depsgraph = nullptr;
public:
/* Sets up Blender just enough to not crash on loading
* a blendfile and constructing a depsgraph. */
static void SetUpTestCase();
static void TearDownTestCase();
protected:
/* Frees the depsgraph & blendfile. */
virtual void TearDown();
/* Loads a blend file from the lib/tests directory from SVN.
* Returns 'ok' flag (true=good, false=bad) and sets this->bfile.
* Fails the test if the file cannot be loaded (still returns though).
* Requires the CLI argument --test-asset-dir to point to ../../lib/tests.
*
* WARNING: only files saved with Blender 2.80+ can be loaded. Since Blender
* is only partially initialized (most importantly, without window manager),
* the space types are not registered, so any versioning code that handles
* those will SEGFAULT.
*/
bool blendfile_load(const char *filepath);
/* Free bfile if it is not nullptr. */
void blendfile_free();
/* Create a depsgraph. Assumes a blend file has been loaded to this->bfile. */
virtual void depsgraph_create(eEvaluationMode depsgraph_evaluation_mode);
/* Free the depsgraph if it's not nullptr. */
virtual void depsgraph_free();
};