mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-12-21 12:06:03 +01:00
hos: allow turning off ams extension hard-reqs for unit testing
This commit is contained in:
parent
d562bb841d
commit
ec950d8320
libraries/libstratosphere
tests/TestSvc/source
@ -123,6 +123,7 @@ $(OFILES) : $(GCH_FILES)
|
|||||||
$(OFILES_SRC) : $(HFILES_BIN)
|
$(OFILES_SRC) : $(HFILES_BIN)
|
||||||
|
|
||||||
ams_environment_weak.o: CXXFLAGS += -fno-lto
|
ams_environment_weak.o: CXXFLAGS += -fno-lto
|
||||||
|
hos_version_api_weak_for_unit_test.o: CXXFLAGS += -fno-lto
|
||||||
pm_info_api_weak.o: CXXFLAGS += -fno-lto
|
pm_info_api_weak.o: CXXFLAGS += -fno-lto
|
||||||
hos_stratosphere_api.o: CXXFLAGS += -fno-lto
|
hos_stratosphere_api.o: CXXFLAGS += -fno-lto
|
||||||
|
|
||||||
|
@ -48,6 +48,7 @@ namespace ams::hos {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsUnitTestProgramForSetVersion();
|
||||||
void InitializeVersionInternal(bool allow_approximate);
|
void InitializeVersionInternal(bool allow_approximate);
|
||||||
|
|
||||||
void InitializeForStratosphere() {
|
void InitializeForStratosphere() {
|
||||||
@ -58,7 +59,7 @@ namespace ams::hos {
|
|||||||
hos::InitializeVersionInternal(CanAllowTemporaryApproximateVersion());
|
hos::InitializeVersionInternal(CanAllowTemporaryApproximateVersion());
|
||||||
|
|
||||||
/* Check that we're running under mesosphere. */
|
/* Check that we're running under mesosphere. */
|
||||||
AMS_ABORT_UNLESS(svc::IsKernelMesosphere());
|
AMS_ABORT_UNLESS(IsUnitTestProgramForSetVersion() || svc::IsKernelMesosphere());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,16 @@ namespace ams::hos {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsUnitTestProgramForSetVersion();
|
||||||
|
|
||||||
void InitializeVersionInternal(bool allow_approximate) {
|
void InitializeVersionInternal(bool allow_approximate) {
|
||||||
|
/* If we're unit testing, just set the version and move on. */
|
||||||
|
if (IsUnitTestProgramForSetVersion()) {
|
||||||
|
g_hos_version = hos::Version_Current;
|
||||||
|
g_set_hos_version = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Get the current (and previous approximation of) target firmware. */
|
/* Get the current (and previous approximation of) target firmware. */
|
||||||
hos::Version prev, current;
|
hos::Version prev, current;
|
||||||
bool has_prev = false;
|
bool has_prev = false;
|
||||||
|
@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) Atmosphère-NX
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms and conditions of the GNU General Public License,
|
||||||
|
* version 2, as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include <stratosphere.hpp>
|
||||||
|
|
||||||
|
namespace ams::hos {
|
||||||
|
|
||||||
|
WEAK_SYMBOL bool IsUnitTestProgramForSetVersion() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -27,6 +27,12 @@ namespace ams {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace hos {
|
||||||
|
|
||||||
|
bool IsUnitTestProgramForSetVersion() { return true; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
namespace init {
|
namespace init {
|
||||||
|
|
||||||
void InitializeSystemModuleBeforeConstructors() {
|
void InitializeSystemModuleBeforeConstructors() {
|
||||||
|
Loading…
Reference in New Issue
Block a user