mirror of
https://github.com/QuantumLeaps/qpcpp.git
synced 2025-01-28 06:02:56 +08:00
28841ee705
Added "QUIT" (QP Unit Internal Testing); refined AO encapsulation in examples: workstation/dpp and arm-cm/game
64 lines
2.2 KiB
C++
64 lines
2.2 KiB
C++
/// @file
|
|
/// @brief "QUIT" QP Unit Internal Test
|
|
/// @cond
|
|
///***************************************************************************
|
|
/// Last updated for version 6.9.2
|
|
/// Last updated on 2021-01-12
|
|
///
|
|
/// Q u a n t u m L e a P s
|
|
/// ------------------------
|
|
/// Modern Embedded Software
|
|
///
|
|
/// Copyright (C) 2005-2021 Quantum Leaps. All rights reserved.
|
|
///
|
|
/// This program is open source software: you can redistribute it and/or
|
|
/// modify it under the terms of the GNU General Public License as published
|
|
/// by the Free Software Foundation, either version 3 of the License, or
|
|
/// (at your option) any later version.
|
|
///
|
|
/// Alternatively, this program may be distributed and modified under the
|
|
/// terms of Quantum Leaps commercial licenses, which expressly supersede
|
|
/// the GNU General Public License and are specifically designed for
|
|
/// licensees interested in retaining the proprietary status of their code.
|
|
///
|
|
/// This program is distributed in the hope that 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 <www.gnu.org/licenses>.
|
|
///
|
|
/// Contact information:
|
|
/// <www.state-machine.com/licensing>
|
|
/// <info@state-machine.com>
|
|
///***************************************************************************
|
|
/// @endcond
|
|
///
|
|
#ifndef QUIT_HPP
|
|
#define QUIT_HPP
|
|
|
|
// macro to check an expectation
|
|
#define EXPECT(cond_) ((cond_) \
|
|
? (void)0 : QP::QUIT_fail_(#cond_, &Q_this_module_[0], __LINE__))
|
|
|
|
namespace QP {
|
|
|
|
void TEST(char const *title);
|
|
void QUIT_fail_(char const *cond, char const *module, int line);
|
|
void onRunTests(void); // user-defined callback to run the tests
|
|
|
|
} // namespace QP
|
|
|
|
#include "qf_port.hpp" // QF/C++ port from the port directory
|
|
#include "qassert.h" // QP embedded systems-friendly assertions
|
|
|
|
#ifdef Q_SPY /* software tracing enabled? */
|
|
#include "qs_port.hpp" // QS/C port from the port directory
|
|
#else
|
|
#include "qs_dummy.hpp" // QS/C dummy (inactive) interface
|
|
#endif
|
|
|
|
#endif // QUIT_HPP
|
|
|