kopia lustrzana https://github.com/jameshball/osci-render
Add test suite
rodzic
d3b032cbf5
commit
8ed20f50b9
|
@ -3,6 +3,7 @@ on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- release
|
- release
|
||||||
|
- 3d-audio
|
||||||
jobs:
|
jobs:
|
||||||
build-linux:
|
build-linux:
|
||||||
name: Build Linux
|
name: Build Linux
|
||||||
|
@ -18,6 +19,8 @@ jobs:
|
||||||
- name: "Run script"
|
- name: "Run script"
|
||||||
run: |
|
run: |
|
||||||
export OS="linux"
|
export OS="linux"
|
||||||
|
./ci/setup-env.sh
|
||||||
|
./ci/test.sh
|
||||||
./ci/build.sh
|
./ci/build.sh
|
||||||
shell: bash
|
shell: bash
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
|
@ -40,6 +43,8 @@ jobs:
|
||||||
- name: "Run script"
|
- name: "Run script"
|
||||||
run: |
|
run: |
|
||||||
export OS="mac"
|
export OS="mac"
|
||||||
|
./ci/setup-env.sh
|
||||||
|
./ci/test.sh
|
||||||
./ci/build.sh
|
./ci/build.sh
|
||||||
shell: bash
|
shell: bash
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
|
@ -62,6 +67,8 @@ jobs:
|
||||||
- name: "Run script"
|
- name: "Run script"
|
||||||
run: |
|
run: |
|
||||||
export OS="win"
|
export OS="win"
|
||||||
|
./ci/setup-env.sh
|
||||||
|
./ci/test.sh
|
||||||
./ci/build.sh
|
./ci/build.sh
|
||||||
shell: bash
|
shell: bash
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
#include <JuceHeader.h>
|
||||||
|
|
||||||
|
class MyTest : public juce::UnitTest {
|
||||||
|
public:
|
||||||
|
MyTest() : juce::UnitTest("Foobar testing") {}
|
||||||
|
|
||||||
|
void runTest() override {
|
||||||
|
beginTest("Part 1");
|
||||||
|
|
||||||
|
expect(true);
|
||||||
|
|
||||||
|
beginTest("Part 2");
|
||||||
|
|
||||||
|
expect(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class MyTest2 : public juce::UnitTest {
|
||||||
|
public:
|
||||||
|
MyTest2() : juce::UnitTest("Foobar testing 2") {}
|
||||||
|
|
||||||
|
void runTest() override {
|
||||||
|
beginTest("Part A");
|
||||||
|
|
||||||
|
expect(true);
|
||||||
|
|
||||||
|
beginTest("Part B");
|
||||||
|
|
||||||
|
expect(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
static MyTest2 test2;
|
||||||
|
|
||||||
|
int main(int argc, char* argv[]) {
|
||||||
|
juce::UnitTestRunner runner;
|
||||||
|
|
||||||
|
runner.runAllTests();
|
||||||
|
|
||||||
|
for (int i = 0; i < runner.getNumResults(); ++i) {
|
||||||
|
const juce::UnitTestRunner::TestResult* result = runner.getResult(i);
|
||||||
|
if (result->failures > 0) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
44
ci/build.sh
44
ci/build.sh
|
@ -2,50 +2,6 @@
|
||||||
|
|
||||||
PLUGIN="osci-render"
|
PLUGIN="osci-render"
|
||||||
|
|
||||||
# linux specific stiff
|
|
||||||
if [ $OS = "linux" ]; then
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install clang git ladspa-sdk freeglut3-dev g++ libasound2-dev libcurl4-openssl-dev libfreetype6-dev libjack-jackd2-dev libx11-dev libxcomposite-dev libxcursor-dev libxinerama-dev libxrandr-dev mesa-common-dev webkit2gtk-4.0 juce-tools xvfb
|
|
||||||
fi
|
|
||||||
|
|
||||||
ROOT=$(cd "$(dirname "$0")/.."; pwd)
|
|
||||||
cd "$ROOT"
|
|
||||||
echo "$ROOT"
|
|
||||||
rm -Rf bin
|
|
||||||
mkdir bin
|
|
||||||
|
|
||||||
BRANCH=${GITHUB_REF##*/}
|
|
||||||
echo "$BRANCH"
|
|
||||||
|
|
||||||
cd "$ROOT/ci"
|
|
||||||
rm -Rf bin
|
|
||||||
mkdir bin
|
|
||||||
|
|
||||||
# Get the Projucer
|
|
||||||
cd "$ROOT/ci/bin"
|
|
||||||
PROJUCER_OS=$OS
|
|
||||||
if [ "$OS" = "win" ]; then
|
|
||||||
PROJUCER_OS="windows"
|
|
||||||
elif [ "$OS" = "mac" ]; then
|
|
||||||
PROJUCER_OS="osx"
|
|
||||||
fi
|
|
||||||
|
|
||||||
curl -s -S -L "https://api.juce.com/api/v1/download/juce/latest/$PROJUCER_OS" -o Projucer.zip
|
|
||||||
unzip Projucer.zip
|
|
||||||
|
|
||||||
# Set Projucer path based on OS
|
|
||||||
if [ "$OS" = "mac" ]; then
|
|
||||||
PROJUCER_PATH="$ROOT/ci/bin/JUCE/Projucer.app/Contents/MacOS/Projucer"
|
|
||||||
elif [ "$OS" = "linux" ]; then
|
|
||||||
PROJUCER_PATH="$ROOT/ci/bin/JUCE/Projucer"
|
|
||||||
else
|
|
||||||
PROJUCER_PATH="$ROOT/ci/bin/JUCE/Projucer.exe"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set global path
|
|
||||||
GLOBAL_PATH_COMMAND="$PROJUCER_PATH --set-global-search-path $PROJUCER_OS 'defaultJuceModulePath' '$ROOT/ci/bin/JUCE/modules'"
|
|
||||||
eval "$GLOBAL_PATH_COMMAND"
|
|
||||||
|
|
||||||
# Resave jucer file
|
# Resave jucer file
|
||||||
RESAVE_COMMAND="$PROJUCER_PATH --resave '$ROOT/$PLUGIN.jucer'"
|
RESAVE_COMMAND="$PROJUCER_PATH --resave '$ROOT/$PLUGIN.jucer'"
|
||||||
eval "$RESAVE_COMMAND"
|
eval "$RESAVE_COMMAND"
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
# linux specific stiff
|
||||||
|
if [ $OS = "linux" ]; then
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install clang git ladspa-sdk freeglut3-dev g++ libasound2-dev libcurl4-openssl-dev libfreetype6-dev libjack-jackd2-dev libx11-dev libxcomposite-dev libxcursor-dev libxinerama-dev libxrandr-dev mesa-common-dev webkit2gtk-4.0 juce-tools xvfb
|
||||||
|
fi
|
||||||
|
|
||||||
|
ROOT=$(cd "$(dirname "$0")/.."; pwd)
|
||||||
|
cd "$ROOT"
|
||||||
|
echo "$ROOT"
|
||||||
|
rm -Rf bin
|
||||||
|
mkdir bin
|
||||||
|
|
||||||
|
BRANCH=${GITHUB_REF##*/}
|
||||||
|
echo "$BRANCH"
|
||||||
|
|
||||||
|
cd "$ROOT/ci"
|
||||||
|
rm -Rf bin
|
||||||
|
mkdir bin
|
||||||
|
|
||||||
|
# Get the Projucer
|
||||||
|
cd "$ROOT/ci/bin"
|
||||||
|
PROJUCER_OS=$OS
|
||||||
|
if [ "$OS" = "win" ]; then
|
||||||
|
PROJUCER_OS="windows"
|
||||||
|
elif [ "$OS" = "mac" ]; then
|
||||||
|
PROJUCER_OS="osx"
|
||||||
|
fi
|
||||||
|
|
||||||
|
curl -s -S -L "https://api.juce.com/api/v1/download/juce/latest/$PROJUCER_OS" -o Projucer.zip
|
||||||
|
unzip Projucer.zip
|
||||||
|
|
||||||
|
# Set Projucer path based on OS
|
||||||
|
if [ "$OS" = "mac" ]; then
|
||||||
|
PROJUCER_PATH="$ROOT/ci/bin/JUCE/Projucer.app/Contents/MacOS/Projucer"
|
||||||
|
elif [ "$OS" = "linux" ]; then
|
||||||
|
PROJUCER_PATH="$ROOT/ci/bin/JUCE/Projucer"
|
||||||
|
else
|
||||||
|
PROJUCER_PATH="$ROOT/ci/bin/JUCE/Projucer.exe"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set global path
|
||||||
|
GLOBAL_PATH_COMMAND="$PROJUCER_PATH --set-global-search-path $PROJUCER_OS 'defaultJuceModulePath' '$ROOT/ci/bin/JUCE/modules'"
|
||||||
|
eval "$GLOBAL_PATH_COMMAND"
|
|
@ -0,0 +1,41 @@
|
||||||
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
PLUGIN="osci-render-test"
|
||||||
|
|
||||||
|
# Resave jucer file
|
||||||
|
RESAVE_COMMAND="$PROJUCER_PATH --resave '$ROOT/$PLUGIN.jucer'"
|
||||||
|
eval "$RESAVE_COMMAND"
|
||||||
|
|
||||||
|
# Build mac version
|
||||||
|
if [ "$OS" = "mac" ]; then
|
||||||
|
cd "$ROOT/Builds/Test/MacOSX"
|
||||||
|
xcodebuild -configuration Release || exit 1
|
||||||
|
cd "build/Release"
|
||||||
|
# Run the test using the .app file
|
||||||
|
open -a "$PLUGIN.app"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Build linux version
|
||||||
|
if [ "$OS" = "linux" ]; then
|
||||||
|
cd "$ROOT/Builds/LinuxMakefile"
|
||||||
|
make CONFIG=Release
|
||||||
|
|
||||||
|
cd build
|
||||||
|
# Run the test using the binary
|
||||||
|
xvfb-run -a -s "-screen 0 1280x720x24" ./$PLUGIN
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Build Win version
|
||||||
|
if [ "$OS" = "win" ]; then
|
||||||
|
VS_WHERE="C:/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe"
|
||||||
|
|
||||||
|
MSBUILD_EXE=$("$VS_WHERE" -latest -requires Microsoft.Component.MSBuild -find "MSBuild\**\Bin\MSBuild.exe")
|
||||||
|
echo $MSBUILD_EXE
|
||||||
|
|
||||||
|
cd "$ROOT/Builds/VisualStudio2022"
|
||||||
|
"$MSBUILD_EXE" "$PLUGIN.sln" "//p:VisualStudioVersion=16.0" "//m" "//t:Build" "//p:Configuration=Release" "//p:Platform=x64" "//p:PreferredToolArchitecture=x64"
|
||||||
|
|
||||||
|
cd "x64/Release/Standalone Plugin"
|
||||||
|
# Run the test using the .exe file
|
||||||
|
./$PLUGIN.exe
|
||||||
|
fi
|
|
@ -0,0 +1,73 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<JUCERPROJECT id="Dt5Xh7" name="osci-render-test" projectType="consoleapp"
|
||||||
|
useAppConfig="0" addUsingNamespaceToJuceHeader="0" jucerFormatVersion="1">
|
||||||
|
<MAINGROUP id="ztPpnM" name="osci-render-test">
|
||||||
|
<GROUP id="{4373FA2A-1E20-AAA6-40E0-740C13D88B75}" name="Source">
|
||||||
|
<FILE id="IsmItc" name="TestMain.cpp" compile="1" resource="0" file="../Source/TestMain.cpp"/>
|
||||||
|
<GROUP id="{9D1E8A66-A99C-4333-3CF8-A86432FE09A7}" name="obj">
|
||||||
|
<FILE id="ItrCVG" name="Frustum.cpp" compile="1" resource="0" file="../Source/obj/Frustum.cpp"/>
|
||||||
|
<FILE id="xr4U2j" name="Frustum.h" compile="0" resource="0" file="../Source/obj/Frustum.h"/>
|
||||||
|
</GROUP>
|
||||||
|
<GROUP id="{71CDF579-70BE-4BE4-D061-E5A079751C8E}" name="shape">
|
||||||
|
<FILE id="Cpe50B" name="CircleArc.cpp" compile="1" resource="0" file="../Source/shape/CircleArc.cpp"/>
|
||||||
|
<FILE id="EAvBdQ" name="CircleArc.h" compile="0" resource="0" file="../Source/shape/CircleArc.h"/>
|
||||||
|
<FILE id="tBJOz5" name="CubicBezierCurve.cpp" compile="1" resource="0"
|
||||||
|
file="../Source/shape/CubicBezierCurve.cpp"/>
|
||||||
|
<FILE id="kqPZkY" name="CubicBezierCurve.h" compile="0" resource="0"
|
||||||
|
file="../Source/shape/CubicBezierCurve.h"/>
|
||||||
|
<FILE id="H9cnS9" name="Line.cpp" compile="1" resource="0" file="../Source/shape/Line.cpp"/>
|
||||||
|
<FILE id="rAHuMy" name="Line.h" compile="0" resource="0" file="../Source/shape/Line.h"/>
|
||||||
|
<FILE id="eoabzV" name="Point.cpp" compile="1" resource="0" file="../Source/shape/Point.cpp"/>
|
||||||
|
<FILE id="PLnC15" name="Point.h" compile="0" resource="0" file="../Source/shape/Point.h"/>
|
||||||
|
<FILE id="jWzgJJ" name="QuadraticBezierCurve.cpp" compile="1" resource="0"
|
||||||
|
file="../Source/shape/QuadraticBezierCurve.cpp"/>
|
||||||
|
<FILE id="bM4cRL" name="QuadraticBezierCurve.h" compile="0" resource="0"
|
||||||
|
file="../Source/shape/QuadraticBezierCurve.h"/>
|
||||||
|
<FILE id="etDjNu" name="Shape.cpp" compile="1" resource="0" file="../Source/shape/Shape.cpp"/>
|
||||||
|
<FILE id="UZ3kKQ" name="Shape.h" compile="0" resource="0" file="../Source/shape/Shape.h"/>
|
||||||
|
</GROUP>
|
||||||
|
</GROUP>
|
||||||
|
</MAINGROUP>
|
||||||
|
<MODULES>
|
||||||
|
<MODULE id="juce_core" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
|
||||||
|
<MODULE id="juce_data_structures" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
|
||||||
|
<MODULE id="juce_events" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
|
||||||
|
</MODULES>
|
||||||
|
<JUCEOPTIONS JUCE_STRICT_REFCOUNTEDPOINTER="1"/>
|
||||||
|
<EXPORTFORMATS>
|
||||||
|
<LINUX_MAKE targetFolder="Builds/Test/LinuxMakefile">
|
||||||
|
<CONFIGURATIONS>
|
||||||
|
<CONFIGURATION isDebug="1" name="Debug" targetName="osci-render-test"/>
|
||||||
|
<CONFIGURATION isDebug="0" name="Release" targetName="osci-render-test"/>
|
||||||
|
</CONFIGURATIONS>
|
||||||
|
<MODULEPATHS>
|
||||||
|
<MODULEPATH id="juce_core" path="../../../JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_data_structures" path="../../../JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_events" path="../../../JUCE/modules"/>
|
||||||
|
</MODULEPATHS>
|
||||||
|
</LINUX_MAKE>
|
||||||
|
<VS2022 targetFolder="Builds/Test/VisualStudio2022">
|
||||||
|
<CONFIGURATIONS>
|
||||||
|
<CONFIGURATION isDebug="1" name="Debug" targetName="osci-render-test"/>
|
||||||
|
<CONFIGURATION isDebug="0" name="Release" targetName="osci-render-test"/>
|
||||||
|
</CONFIGURATIONS>
|
||||||
|
<MODULEPATHS>
|
||||||
|
<MODULEPATH id="juce_core" path="../../../JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_data_structures" path="../../../JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_events" path="../../../JUCE/modules"/>
|
||||||
|
</MODULEPATHS>
|
||||||
|
</VS2022>
|
||||||
|
<XCODE_MAC targetFolder="Builds/Test/MacOSX">
|
||||||
|
<CONFIGURATIONS>
|
||||||
|
<CONFIGURATION isDebug="1" name="Debug" targetName="osci-render-test"/>
|
||||||
|
<CONFIGURATION isDebug="0" name="Release" targetName="osci-render-test"/>
|
||||||
|
</CONFIGURATIONS>
|
||||||
|
<MODULEPATHS>
|
||||||
|
<MODULEPATH id="juce_core" path="../../../JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_data_structures" path="../../../JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_events" path="../../../JUCE/modules"/>
|
||||||
|
</MODULEPATHS>
|
||||||
|
</XCODE_MAC>
|
||||||
|
</EXPORTFORMATS>
|
||||||
|
</JUCERPROJECT>
|
Ładowanie…
Reference in New Issue