1
0
forked from 0ad/0ad

Use vanilla cxxtest functionallity

To disable tests we carry a patch which allows disabling test by
appending DISABLED to the test function name. Instead just do as
upstream says and prepend the test function so it won't be recognized as
a test any longer.

The docs suggest to prepend x but anything will do. Continue to use
DISABLED_ but as prefix which is actually already in use in one case.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser 2024-09-18 19:45:06 +02:00
parent 668ae8a20e
commit aeb1def1cd
Signed by: sera
SSH Key Fingerprint: SHA256:peL4nxsVEHY8tOsBHev85LILY2TqpfHeutw4LUbOFPQ
9 changed files with 22 additions and 19 deletions

View File

@ -65,7 +65,7 @@ public:
TS_ASSERT_EQUALS(losData[0], 104);
}
void test_perf_DISABLED()
void DISABLED_test_perf()
{
CSimulation2 sim{nullptr, *g_ScriptContext, nullptr};
CLOSTexture tex(sim);

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2022 Wildfire Games.
/* Copyright (C) 2024 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -127,7 +127,10 @@ public:
}
}
void test_basic_DISABLED()
// just so that cxxtestgen doesn't complain "No tests defined" if all are disabled
void test_dummy() {}
void DISABLED_test_basic()
{
// This doesn't actually test much, it just runs a very quick multiplayer game
// and prints a load of debug output so you can see if anything funny's going on
@ -209,7 +212,7 @@ public:
wait(clients, 100);
}
void test_rejoin_DISABLED()
void DISABLED_test_rejoin()
{
ScriptInterface scriptInterface("Engine", "Test", g_ScriptContext);
ScriptRequest rq(scriptInterface);

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2022 Wildfire Games.
/* Copyright (C) 2024 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -62,7 +62,7 @@ public:
TS_FAIL("StunClient::FindLocalIP did not return a valid IPV4 address: wrong separators");
}
void test_stun_DISABLED()
void DISABLED_test_stun()
{
// Disabled test -> should return your external IP by connecting to our STUN server.
CConfigDB::Initialise();

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2021 Wildfire Games.
/* Copyright (C) 2024 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -47,7 +47,7 @@ public:
TS_ASSERT_EQUALS(HashCryptographically("D9895FDEE287DBEE19907B7329207F388B1708AC4A123CA537603E953885B20F", "foobar"), "8CE4D45113D5A682FE4B6F185C1880F83EEA6CB2F007E815DCA5BF4B8178ECD0");
}
void test_hash_perf_DISABLED()
void DISABLED_test_hash_perf()
{
double t = timer_Time();
for (size_t i = 0; i < 100; ++i)

View File

@ -133,7 +133,7 @@ public:
}
}
void test_performance_DISABLED()
void DISABLED_test_performance()
{
CTerrain terrain;
@ -191,7 +191,7 @@ public:
printf("[%f]", t);
}
void test_performance_short_DISABLED()
void DISABLED_test_performance_short()
{
CTerrain terrain;
terrain.Initialize(5, NULL);
@ -247,7 +247,7 @@ public:
}
}
void test_perf2_DISABLED()
void DISABLED_test_perf2()
{
CTerrain terrain;
@ -304,7 +304,7 @@ public:
stream << "</svg>\n";
}
void test_perf3_DISABLED()
void DISABLED_test_perf3()
{
CTerrain terrain;

View File

@ -237,7 +237,7 @@ public:
}
// This just attempts loading every public entity, to check there's no validation errors
void test_load_all_DISABLED() // disabled since it's a bit slow and noisy
void DISABLED_test_load_all() // disabled since it's a bit slow and noisy
{
CTerrain dummy;
CSimulation2 sim{nullptr, *g_ScriptContext, &dummy};

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2019 Wildfire Games.
/* Copyright (C) 2024 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -190,7 +190,7 @@ public:
TS_ASSERT(test.find(30) == test.end());
}
void test_perf_DISABLED()
void DISABLE_test_perf()
{
EntityMap<int> test;
printf("Testing performance of EntityMap\n");

View File

@ -843,7 +843,7 @@ public:
class TestSerializerPerf : public CxxTest::TestSuite
{
public:
void test_script_props_DISABLED()
void DISABLED_test_script_props()
{
const char* input = "var x = {}; for (var i=0;i<256;++i) x[i]=Math.pow(i, 2); x";
@ -877,7 +877,7 @@ public:
}
}
void test_hash_DISABLED()
void DISABLED_test_hash()
{
CXeromyces::Startup();

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2021 Wildfire Games.
/* Copyright (C) 2024 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -262,7 +262,7 @@ public:
"#line 1\n\n\t\n\n\n\t\n\t\n\n\n\t\n\t\n\t\n\t\n\tvec3 color();\n\t\n#line 5\n\t42 256");
}
void test_performance_DISABLED()
void DISABLED_test_performance()
{
CPreprocessorWrapper::IncludeRetrieverCallback includeCallback = [](
const CStr& includePath, CStr& out) {