-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
246 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
build/* | ||
.vscode/* | ||
src/version.h | ||
Testing/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | ||
<xsl:output method="xml" indent="yes" /> | ||
<xsl:template match="/"> | ||
<testsuites> | ||
<xsl:variable name="buildName" select="//Site/@BuildName"/> | ||
<xsl:variable name="numberOfTests" select="count(//Site/Testing/Test)"/> | ||
<xsl:variable name="numberOfFailures" select="count(//Site/Testing/Test[@Status!='passed'])" /> | ||
<testsuite name="CTest" | ||
tests="{$numberOfTests}" time="0" | ||
failures="{$numberOfFailures}" errors="0" | ||
skipped="0"> | ||
<xsl:for-each select="//Site/Testing/Test"> | ||
<xsl:variable name="testName" select="translate(Name, '-', '_')"/> | ||
<xsl:variable name="duration" select="Results/NamedMeasurement[@name='Execution Time']/Value"/> | ||
<xsl:variable name="status" select="@Status"/> | ||
<xsl:variable name="output" select="Results/Measurement/Value"/> | ||
<xsl:variable name="className" select="translate(Path, '/.', '.')"/> | ||
<testcase classname="projectroot{$className}" | ||
name="{$testName}" | ||
time="{$duration}"> | ||
<xsl:if test="@Status!='passed'"> | ||
<failure> | ||
<xsl:value-of select="$output" /> | ||
</failure> | ||
</xsl:if> | ||
<system-out> | ||
<xsl:value-of select="$output" /> | ||
</system-out> | ||
</testcase> | ||
</xsl:for-each> | ||
</testsuite> | ||
</testsuites> | ||
</xsl:template> | ||
</xsl:stylesheet> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Windows test script for Appveyor | ||
|
||
$ErrorActionPreference = "Stop"; | ||
|
||
$XSLInputElement = New-Object System.Xml.Xsl.XslCompiledTransform | ||
$XSLInputElement.Load($(Join-Path $env:APPVEYOR_BUILD_FOLDER "scripts\ctest-to-junit.xsl")) | ||
|
||
pushd | ||
cd build | ||
ctest --no-compress-output -T Test | ||
foreach ($testReport in Get-ChildItem -Path .\Testing\*\Test.xml) | ||
{ | ||
$XSLInputElement.Transform($(Resolve-Path $testReport.FullName), (Join-Path (Resolve-Path .) "ctest-to-junit-results.xml")) | ||
$wc = New-Object 'System.Net.WebClient' | ||
$wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\ctest-to-junit-results.xml)) | ||
|
||
if ($res.FailedCount -gt 0) { | ||
throw "$($res.FailedCount) tests failed." | ||
} | ||
} | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
add_executable(cameraTests cameraTests.cpp) | ||
target_link_libraries(cameraTests Qt5::Core Qt5::Test halorayLib) | ||
add_test(cameraTests cameraTests) | ||
|
||
add_executable(crystalRepoTests crystalPopulationRepositoryTests.cpp) | ||
target_link_libraries(crystalRepoTests Qt5::Core Qt5::Test halorayLib) | ||
add_test(crystalRepoTests crystalRepoTests) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include <QtTest/QtTest> | ||
#include "../src/simulation/camera.h" | ||
|
||
Q_DECLARE_METATYPE(HaloSim::Projection) | ||
|
||
using namespace HaloSim; | ||
|
||
class CameraTests : public QObject | ||
{ | ||
Q_OBJECT | ||
private slots: | ||
void maxFov() | ||
{ | ||
QFETCH(Projection, projection); | ||
QFETCH(float, expectedMaxFov); | ||
|
||
auto c = Camera(); | ||
c.projection = projection; | ||
QCOMPARE(c.getMaximumFov(), expectedMaxFov); | ||
} | ||
void maxFov_data() | ||
{ | ||
QTest::addColumn<Projection>("projection"); | ||
QTest::addColumn<float>("expectedMaxFov"); | ||
|
||
QTest::newRow("stereographic") << Projection::Stereographic << 350.0f; | ||
QTest::newRow("rectilinear") << Projection::Rectilinear << 160.0f; | ||
QTest::newRow("equidistant") << Projection::Equidistant << 360.0f; | ||
QTest::newRow("equal area") << Projection::EqualArea << 360.0f; | ||
QTest::newRow("orthographic") << Projection::Orthographic << 180.0f; | ||
} | ||
}; | ||
|
||
QTEST_MAIN(CameraTests) | ||
#include "cameraTests.moc" |
Oops, something went wrong.