Unit tests: Don't use OpenShot.h header

- To prevent slow compiles of unit tests, replace all of the
  '#include "OpenShot.h"' invocations with includes of the
  individual headers actually needed by each test file.

Revert "Unit tests: Don't use OpenShot.h header"

This reverts commit e5cc4f8bf91fc60697996023a86dc618637f6161.

Unit tests: Don't use OpenShot.h header

- To prevent slow compiles of unit tests, replace all of the
  '#include "OpenShot.h"' invocations with includes of the
  individual headers actually needed by each test file.
This commit is contained in:
FeRD (Frank Dana)
2020-12-26 06:03:30 -05:00
parent 5cfe52b9f7
commit ed77db81d2
15 changed files with 83 additions and 20 deletions

View File

@@ -28,12 +28,17 @@
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <memory>
#include "UnitTest++.h"
// Prevent name clashes with juce::UnitTest
#define DONT_SET_USING_JUCE_NAMESPACE 1
#include "OpenShot.h"
#include "CacheDisk.h"
#include "CacheMemory.h"
#include "Json.h"
#include <QDir>
using namespace openshot;
TEST(Cache_Default_Constructor)

View File

@@ -28,6 +28,9 @@
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <sstream>
#include <memory>
#include "UnitTest++.h"
// Work around older versions of UnitTest++ without REQUIRE
@@ -37,7 +40,11 @@
// Prevent name clashes with juce::UnitTest
#define DONT_SET_USING_JUCE_NAMESPACE 1
#include "OpenShot.h"
#include "Clip.h"
#include "Frame.h"
#include "Fraction.h"
#include "Timeline.h"
#include "Json.h"
using namespace openshot;
@@ -255,4 +262,3 @@ TEST(Verify_Parent_Timeline)
}
} // SUITE

View File

@@ -28,10 +28,15 @@
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <string>
#include <vector>
#include "UnitTest++.h"
// Prevent name clashes with juce::UnitTest
#define DONT_SET_USING_JUCE_NAMESPACE 1
#include "OpenShot.h"
#include "Color.h"
#include "KeyFrame.h"
#include "Json.h"
SUITE(Color) {

View File

@@ -31,9 +31,8 @@
#include "UnitTest++.h"
// Prevent name clashes with juce::UnitTest
#define DONT_SET_USING_JUCE_NAMESPACE 1
#include "OpenShot.h"
#include "Coordinate.h"
using namespace std;
using namespace openshot;
TEST(Coordinate_Default_Constructor)

View File

@@ -28,11 +28,16 @@
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <memory>
#include "UnitTest++.h"
// Prevent name clashes with juce::UnitTest
#define DONT_SET_USING_JUCE_NAMESPACE 1
#include "OpenShot.h"
#include "DummyReader.h"
#include "CacheMemory.h"
#include "Fraction.h"
#include "Frame.h"
using namespace std;
using namespace openshot;
@@ -146,4 +151,4 @@ TEST (DummyReader_Invalid_Fake_Frame) {
// Clean up
cache.Clear();
r.Close();
}
}

View File

@@ -28,10 +28,16 @@
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <sstream>
#include <memory>
#include "UnitTest++.h"
// Prevent name clashes with juce::UnitTest
#define DONT_SET_USING_JUCE_NAMESPACE 1
#include "OpenShot.h"
#include "FFmpegReader.h"
#include "Frame.h"
#include "Timeline.h"
#include "Json.h"
using namespace std;
using namespace openshot;
@@ -272,4 +278,3 @@ TEST(Verify_Parent_Timeline)
}
} // SUITE(FFmpegReader)

View File

@@ -28,10 +28,16 @@
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <sstream>
#include <memory>
#include "UnitTest++.h"
// Prevent name clashes with juce::UnitTest
#define DONT_SET_USING_JUCE_NAMESPACE 1
#include "OpenShot.h"
#include "FFmpegWriter.h"
#include "FFmpegReader.h"
#include "Fraction.h"
#include "Frame.h"
using namespace std;
using namespace openshot;

View File

@@ -31,7 +31,7 @@
#include "UnitTest++.h"
// Prevent name clashes with juce::UnitTest
#define DONT_SET_USING_JUCE_NAMESPACE 1
#include "OpenShot.h"
#include "Fraction.h"
using namespace std;
using namespace openshot;

View File

@@ -29,10 +29,15 @@
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <sstream>
#include <memory>
#include "UnitTest++.h"
// Prevent name clashes with juce::UnitTest
#define DONT_SET_USING_JUCE_NAMESPACE 1
#include "OpenShot.h"
#include "Frame.h"
#include "Clip.h"
#include "Fraction.h"
#include <QImage>

View File

@@ -28,15 +28,22 @@
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <sstream>
#include <memory>
#include "UnitTest++.h"
// Prevent name clashes with juce::UnitTest
#define DONT_SET_USING_JUCE_NAMESPACE 1
#include "OpenShot.h"
#ifdef USE_IMAGEMAGICK
#include "ImageWriter.h"
#include "ImageReader.h"
#include "FFmpegReader.h"
#include "Frame.h"
using namespace std;
using namespace openshot;
#ifdef USE_IMAGEMAGICK
SUITE(ImageWriter)
{

View File

@@ -31,7 +31,10 @@
#include "UnitTest++.h"
// Prevent name clashes with juce::UnitTest
#define DONT_SET_USING_JUCE_NAMESPACE 1
#include "OpenShot.h"
#include "KeyFrame.h"
#include "Coordinate.h"
#include "Fraction.h"
#include "Point.h"
using namespace std;
using namespace openshot;

View File

@@ -31,7 +31,10 @@
#include "UnitTest++.h"
// Prevent name clashes with juce::UnitTest
#define DONT_SET_USING_JUCE_NAMESPACE 1
#include "OpenShot.h"
#include "Point.h"
#include "Enums.h"
#include "Coordinate.h"
#include "Json.h"
SUITE(POINT) {

View File

@@ -28,10 +28,15 @@
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <memory>
#include "UnitTest++.h"
// Prevent name clashes with juce::UnitTest
#define DONT_SET_USING_JUCE_NAMESPACE 1
#include "OpenShot.h"
#include "ReaderBase.h"
#include "CacheBase.h"
#include "Frame.h"
#include "Json.h"
using namespace std;
using namespace openshot;

View File

@@ -31,7 +31,7 @@
#include "UnitTest++.h"
// Prevent name clashes with juce::UnitTest
#define DONT_SET_USING_JUCE_NAMESPACE 1
#include "OpenShot.h"
#include "Settings.h"
using namespace std;
using namespace openshot;

View File

@@ -28,10 +28,19 @@
* along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
*/
#include <sstream>
#include <memory>
#include <list>
#include "UnitTest++.h"
// Prevent name clashes with juce::UnitTest
#define DONT_SET_USING_JUCE_NAMESPACE 1
#include "OpenShot.h"
#include "Timeline.h"
#include "Clip.h"
#include "Frame.h"
#include "Fraction.h"
#include "effects/Blur.h"
#include "effects/Negate.h"
using namespace std;
using namespace openshot;