Skip to content

Commit

Permalink
Merge pull request #7
Browse files Browse the repository at this point in the history
automated-test-registration
  • Loading branch information
Sidsky authored Oct 27, 2023
2 parents 301a0e4 + ec1fb3f commit 8796522
Show file tree
Hide file tree
Showing 88 changed files with 1,427 additions and 3,480 deletions.
46 changes: 4 additions & 42 deletions test-suite/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,44 +174,6 @@ set(QL_TEST_SOURCES
)

set(QL_TEST_HEADERS
assetswap.hpp
autocovariances.hpp
barrieroption.hpp
basismodels.hpp
basisswapratehelpers.hpp
basketoption.hpp
batesmodel.hpp
bermudanswaption.hpp
binaryoption.hpp
blackdeltacalculator.hpp
blackformula.hpp
bondforward.hpp
bonds.hpp
brownianbridge.hpp
businessdayconventions.hpp
calendars.hpp
callablebonds.hpp
capfloor.hpp
capflooredcoupon.hpp
cashflows.hpp
catbonds.hpp
cdo.hpp
cdsoption.hpp
chooseroption.hpp
cliquetoption.hpp
cms.hpp
cms_normal.hpp
cmsspread.hpp
commodityunitofmeasure.hpp
compiledboostversion.hpp
compoundoption.hpp
convertiblebonds.hpp
covariance.hpp
creditdefaultswap.hpp
creditriskplus.hpp
crosscurrencyratehelpers.hpp
currency.hpp
curvestates.hpp
dates.hpp
daycounters.hpp
defaultprobabilitycurves.hpp
Expand Down Expand Up @@ -349,10 +311,10 @@ set(QL_BENCHMARK_SOURCES

americanoption.cpp
asianoptions.cpp
barrieroption.cpp barrieroption.hpp
basketoption.cpp basketoption.hpp
batesmodel.cpp batesmodel.hpp
convertiblebonds.cpp convertiblebonds.hpp
barrieroption.cpp
basketoption.cpp
batesmodel.cpp
convertiblebonds.cpp
digitaloption.cpp digitaloption.hpp
dividendoption.cpp dividendoption.hpp
europeanoption.cpp europeanoption.hpp
Expand Down
44 changes: 1 addition & 43 deletions test-suite/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -174,45 +174,6 @@ QL_TEST_SRCS = \
zerocouponswap.cpp

QL_TEST_HDRS = \
speedlevel.hpp \
assetswap.hpp \
autocovariances.hpp \
barrieroption.hpp \
binaryoption.hpp \
basismodels.hpp \
basisswapratehelpers.hpp \
basketoption.hpp \
batesmodel.hpp \
bermudanswaption.hpp \
blackdeltacalculator.hpp \
blackformula.hpp \
bondforward.hpp \
bonds.hpp \
brownianbridge.hpp \
businessdayconventions.hpp \
calendars.hpp \
callablebonds.hpp \
capfloor.hpp \
capflooredcoupon.hpp \
cashflows.hpp \
catbonds.hpp \
cdo.hpp \
cdsoption.hpp \
chooseroption.hpp \
cliquetoption.hpp \
cms.hpp \
cms_normal.hpp \
cmsspread.hpp \
commodityunitofmeasure.hpp \
compiledboostversion.hpp \
compoundoption.hpp \
convertiblebonds.hpp \
covariance.hpp \
creditdefaultswap.hpp \
creditriskplus.hpp \
crosscurrencyratehelpers.hpp \
currency.hpp \
curvestates.hpp \
dates.hpp \
daycounters.hpp \
defaultprobabilitycurves.hpp \
Expand Down Expand Up @@ -310,6 +271,7 @@ QL_TEST_HDRS = \
shortratemodels.hpp \
sofrfutures.hpp \
solvers.hpp \
speedlevel.hpp \
spreadoption.hpp \
squarerootclvmodel.hpp \
stats.hpp \
Expand Down Expand Up @@ -371,11 +333,7 @@ QL_BENCHMARK_SRCS = \
utilities.cpp

QL_BENCHMARK_HDRS = \
barrieroption.hpp \
doublebarrieroption.hpp \
basketoption.hpp \
batesmodel.hpp \
convertiblebonds.hpp \
digitaloption.hpp \
dividendoption.hpp \
europeanoption.hpp \
Expand Down
2 changes: 1 addition & 1 deletion test-suite/americanoption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ namespace {

}

BOOST_FIXTURE_TEST_SUITE(QuantLibTest, QuantLib::TopLevelFixture)
BOOST_FIXTURE_TEST_SUITE(QuantLibTest, TopLevelFixture)

BOOST_AUTO_TEST_SUITE(AmericanOptionTest)

Expand Down
2 changes: 1 addition & 1 deletion test-suite/amortizingbond.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
using namespace QuantLib;
using namespace boost::unit_test_framework;

BOOST_FIXTURE_TEST_SUITE(QuantLibTest, QuantLib::TopLevelFixture)
BOOST_FIXTURE_TEST_SUITE(QuantLibTest, TopLevelFixture)

BOOST_AUTO_TEST_SUITE(AmortizingBondTest)

Expand Down
2 changes: 1 addition & 1 deletion test-suite/andreasenhugevolatilityinterpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ namespace andreasen_huge_volatility_interpl_test {
}


BOOST_FIXTURE_TEST_SUITE(QuantLibTest, QuantLib::TopLevelFixture)
BOOST_FIXTURE_TEST_SUITE(QuantLibTest, TopLevelFixture)

BOOST_AUTO_TEST_SUITE(AndreasenHugeVolatilityInterplTest)

Expand Down
2 changes: 1 addition & 1 deletion test-suite/array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace array_test {
};
}

BOOST_FIXTURE_TEST_SUITE(QuantLibTest, QuantLib::TopLevelFixture)
BOOST_FIXTURE_TEST_SUITE(QuantLibTest, TopLevelFixture)

BOOST_AUTO_TEST_SUITE(ArrayTest)

Expand Down
2 changes: 1 addition & 1 deletion test-suite/asianoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ namespace {
};
}

BOOST_FIXTURE_TEST_SUITE(QuantLibTest, QuantLib::TopLevelFixture)
BOOST_FIXTURE_TEST_SUITE(QuantLibTest, TopLevelFixture)

BOOST_AUTO_TEST_SUITE(AsianOptionTest)

Expand Down
45 changes: 17 additions & 28 deletions test-suite/assetswap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
FOR A PARTICULAR PURPOSE. See the license for more details.
*/

#include "assetswap.hpp"
#include "toplevelfixture.hpp"
#include "utilities.hpp"
#include <ql/time/schedule.hpp>
#include <ql/instruments/assetswap.hpp>
Expand Down Expand Up @@ -112,7 +112,12 @@ namespace asset_swap_test {

}

void AssetSwapTest::testConsistency() {

BOOST_FIXTURE_TEST_SUITE(QuantLibTest, TopLevelFixture) // fails with QL_USE_INDEXED_COUPON

BOOST_AUTO_TEST_SUITE(AssetSwapTest)

BOOST_AUTO_TEST_CASE(testConsistency) {
BOOST_TEST_MESSAGE(
"Testing consistency between fair price and fair spread...");

Expand Down Expand Up @@ -499,7 +504,7 @@ void AssetSwapTest::testConsistency() {

}

void AssetSwapTest::testImpliedValue() {
BOOST_AUTO_TEST_CASE(testImpliedValue) {

BOOST_TEST_MESSAGE("Testing implied bond value against asset-swap fair"
" price with null spread...");
Expand Down Expand Up @@ -867,7 +872,7 @@ void AssetSwapTest::testImpliedValue() {
}


void AssetSwapTest::testMarketASWSpread() {
BOOST_AUTO_TEST_CASE(testMarketASWSpread) {

BOOST_TEST_MESSAGE("Testing relationship between market asset swap"
" and par asset swap...");
Expand Down Expand Up @@ -1307,7 +1312,7 @@ void AssetSwapTest::testMarketASWSpread() {
}


void AssetSwapTest::testZSpread() {
BOOST_AUTO_TEST_CASE(testZSpread) {

BOOST_TEST_MESSAGE("Testing clean and dirty price with null Z-spread "
"against theoretical prices...");
Expand Down Expand Up @@ -1629,7 +1634,7 @@ void AssetSwapTest::testZSpread() {
}


void AssetSwapTest::testGenericBondImplied() {
BOOST_AUTO_TEST_CASE(testGenericBondImplied) {

BOOST_TEST_MESSAGE("Testing implied generic-bond value against"
" asset-swap fair price with null spread...");
Expand Down Expand Up @@ -2019,8 +2024,7 @@ void AssetSwapTest::testGenericBondImplied() {
}
}


void AssetSwapTest::testMASWWithGenericBond() {
BOOST_AUTO_TEST_CASE(testMASWWithGenericBond) {

BOOST_TEST_MESSAGE("Testing market asset swap against par asset swap "
"with generic bond...");
Expand Down Expand Up @@ -2495,7 +2499,7 @@ void AssetSwapTest::testMASWWithGenericBond() {
}


void AssetSwapTest::testZSpreadWithGenericBond() {
BOOST_AUTO_TEST_CASE(testZSpreadWithGenericBond) {

BOOST_TEST_MESSAGE("Testing clean and dirty price with null Z-spread "
"against theoretical prices...");
Expand Down Expand Up @@ -2861,8 +2865,7 @@ void AssetSwapTest::testZSpreadWithGenericBond() {
}
}


void AssetSwapTest::testSpecializedBondVsGenericBond() {
BOOST_AUTO_TEST_CASE(testSpecializedBondVsGenericBond) {

BOOST_TEST_MESSAGE("Testing clean and dirty prices for specialized bond"
" against equivalent generic bond...");
Expand Down Expand Up @@ -3423,7 +3426,7 @@ void AssetSwapTest::testSpecializedBondVsGenericBond() {
}


void AssetSwapTest::testSpecializedBondVsGenericBondUsingAsw() {
BOOST_AUTO_TEST_CASE(testSpecializedBondVsGenericBondUsingAsw) {

BOOST_TEST_MESSAGE("Testing asset-swap prices and spreads for specialized"
" bond against equivalent generic bond...");
Expand Down Expand Up @@ -4252,20 +4255,6 @@ void AssetSwapTest::testSpecializedBondVsGenericBondUsingAsw() {
}
}

BOOST_AUTO_TEST_SUITE_END()

test_suite* AssetSwapTest::suite() {
auto* suite = BOOST_TEST_SUITE("AssetSwap tests");
suite->add(QUANTLIB_TEST_CASE(&AssetSwapTest::testConsistency));
suite->add(QUANTLIB_TEST_CASE(&AssetSwapTest::testImpliedValue));
suite->add(QUANTLIB_TEST_CASE(&AssetSwapTest::testMarketASWSpread));
suite->add(QUANTLIB_TEST_CASE(&AssetSwapTest::testZSpread));
suite->add(QUANTLIB_TEST_CASE(&AssetSwapTest::testGenericBondImplied));
suite->add(QUANTLIB_TEST_CASE(&AssetSwapTest::testMASWWithGenericBond));
suite->add(QUANTLIB_TEST_CASE(&AssetSwapTest::testZSpreadWithGenericBond));
suite->add(QUANTLIB_TEST_CASE(
&AssetSwapTest::testSpecializedBondVsGenericBond));
suite->add(QUANTLIB_TEST_CASE(
&AssetSwapTest::testSpecializedBondVsGenericBondUsingAsw));

return suite;
}
BOOST_AUTO_TEST_SUITE_END()
43 changes: 0 additions & 43 deletions test-suite/assetswap.hpp

This file was deleted.

21 changes: 10 additions & 11 deletions test-suite/autocovariances.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,18 @@
FOR A PARTICULAR PURPOSE. See the license for more details.
*/

#include "autocovariances.hpp"
#include "toplevelfixture.hpp"
#include "utilities.hpp"
#include <ql/math/autocovariance.hpp>

using namespace QuantLib;
using namespace boost::unit_test_framework;

void AutocovariancesTest::testConvolutions() {
BOOST_FIXTURE_TEST_SUITE(QuantLibTest, TopLevelFixture)

BOOST_AUTO_TEST_SUITE(AutocovariancesTest)

BOOST_AUTO_TEST_CASE(testConvolutions) {
BOOST_TEST_MESSAGE("Testing convolutions...");
Array x(10, 1, 1);
Array conv(6);
Expand All @@ -38,7 +42,7 @@ void AutocovariancesTest::testConvolutions() {
<< " expected: " << Array(expected, expected+6));
}

void AutocovariancesTest::testAutoCovariances() {
BOOST_AUTO_TEST_CASE(testAutoCovariances) {
BOOST_TEST_MESSAGE("Testing auto-covariances...");
Array x(10, 1, 1);
Array acovf(6);
Expand All @@ -57,7 +61,7 @@ void AutocovariancesTest::testAutoCovariances() {
<< " expected: " << Array(expected, expected+6));
}

void AutocovariancesTest::testAutoCorrelations() {
BOOST_AUTO_TEST_CASE(testAutoCorrelations) {
BOOST_TEST_MESSAGE("Testing auto-correlations...");
Array x(10, 1, 1);
Array acorf(6);
Expand All @@ -83,11 +87,6 @@ void AutocovariancesTest::testAutoCorrelations() {
<< " expected: " << Array(10, -4.5, 1));
}

test_suite* AutocovariancesTest::suite() {
auto* suite = BOOST_TEST_SUITE("auto-covariance tests");
suite->add(QUANTLIB_TEST_CASE(&AutocovariancesTest::testConvolutions));
suite->add(QUANTLIB_TEST_CASE(&AutocovariancesTest::testAutoCovariances));
suite->add(QUANTLIB_TEST_CASE(&AutocovariancesTest::testAutoCorrelations));
return suite;
}
BOOST_AUTO_TEST_SUITE_END()

BOOST_AUTO_TEST_SUITE_END()
Loading

0 comments on commit 8796522

Please sign in to comment.