102 lines
2.0 KiB
C++
102 lines
2.0 KiB
C++
|
|
/**
|
|||
|
|
* \file main.cpp
|
|||
|
|
* \project EFC_PlatformC28x
|
|||
|
|
* \Author leonidTitov
|
|||
|
|
* \date 10 мая 2024 г.
|
|||
|
|
*
|
|||
|
|
*/
|
|||
|
|
#define _DUAL_HEADERS // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
#include "UnitTestInterface.hh"
|
|||
|
|
#include "AsyncRunnerInterface.hh"
|
|||
|
|
|
|||
|
|
#include "AsyncRunner.hh"
|
|||
|
|
|
|||
|
|
struct BaseResult : public umlib::tests::TestResult {
|
|||
|
|
|
|||
|
|
void assert_false( bool, std::string description );
|
|||
|
|
void assert_true( bool, std::string description );
|
|||
|
|
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
#include <sysctl.h>
|
|||
|
|
#include <interrupt.h>
|
|||
|
|
|
|||
|
|
void init() {
|
|||
|
|
|
|||
|
|
Interrupt_disableGlobal();
|
|||
|
|
Interrupt_disablePIE();
|
|||
|
|
|
|||
|
|
Interrupt_initModule();
|
|||
|
|
Interrupt_initVectorTable();
|
|||
|
|
|
|||
|
|
Interrupt_enablePIE();
|
|||
|
|
Interrupt_enableGlobal();
|
|||
|
|
|
|||
|
|
EINT;
|
|||
|
|
ERTM;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#include <AsyncRunnerTest.hh>
|
|||
|
|
|
|||
|
|
#include <Atomic.hpp>
|
|||
|
|
#include <AtomicTest.hpp>
|
|||
|
|
|
|||
|
|
#include <SdfmTest.hpp>//<2F><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SDFM
|
|||
|
|
#include <VoltageMonitoring\SDFM.hpp>//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* \function run()
|
|||
|
|
*/
|
|||
|
|
int run()
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
BaseResult result;
|
|||
|
|
|
|||
|
|
umlib::tests::AsyncRunnerTest async_runner_test( platform::AsyncRunner::getInstance() );
|
|||
|
|
|
|||
|
|
async_runner_test.run(result);
|
|||
|
|
|
|||
|
|
umlib::tests::AtomicFlagTest<umlib::imp::AtomicFlag> atomic_flag_tests( platform::AsyncRunner::getInstance() );
|
|||
|
|
|
|||
|
|
atomic_flag_tests.run(result);
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Sdfm_tests
|
|||
|
|
umlib::tests::SdfmTest<umlib::imp::Sdfm> Sdfm_tests;
|
|||
|
|
Sdfm_tests.run(result);
|
|||
|
|
return 0;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#include <stdio.h>
|
|||
|
|
|
|||
|
|
/*!
|
|||
|
|
* \brief Вся инициализация должна быть произведена в скрипте отладчика.
|
|||
|
|
* \function main()
|
|||
|
|
*
|
|||
|
|
*/
|
|||
|
|
int main(int argc, char * argv[]) {
|
|||
|
|
|
|||
|
|
printf("\n");
|
|||
|
|
printf("Run PlatformC28x Tests:\n");
|
|||
|
|
|
|||
|
|
init();
|
|||
|
|
|
|||
|
|
return run();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void BaseResult::assert_false( bool check, std::string description ) {
|
|||
|
|
|
|||
|
|
printf("\"%s\": %s\n", description.c_str(), check ? "False" : "True");
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void BaseResult::assert_true( bool check, std::string description ) {
|
|||
|
|
|
|||
|
|
printf("\"%s\": %s\n", description.c_str(), check ? "True" : "False");
|
|||
|
|
|
|||
|
|
}
|