Skip to content

Commit 3502539

Browse files
committed
8.0.1
Updated qutest test fixtures to enable configuring qspy host via command-line
1 parent 9ae5fb3 commit 3502539

File tree

28 files changed

+525
-4465
lines changed

28 files changed

+525
-4465
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
*.obj
1414
*.elf
1515

16-
# Linker output
16+
# Linker/Gcov output
1717
*.ilk
1818
*.map
1919
*.exp
20+
*.gcov
2021

2122
# Precompiled Headers
2223
*.gch

qutest/blinky/test/test_blinky.c

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,28 @@
11
//============================================================================
22
// Purpose: Fixture for QUTEST
3-
// Last updated for version 8.0.0
4-
// Last updated on 2024-09-18
5-
//
6-
// Q u a n t u m L e a P s
7-
// ------------------------
8-
// Modern Embedded Software
93
//
104
// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
115
//
12-
// This program is open source software: you can redistribute it and/or
13-
// modify it under the terms of the GNU General Public License as published
14-
// by the Free Software Foundation, either version 3 of the License, or
15-
// (at your option) any later version.
6+
// Q u a n t u m L e a P s
7+
// ------------------------
8+
// Modern Embedded Software
9+
//
10+
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
1611
//
17-
// Alternatively, this program may be distributed and modified under the
18-
// terms of Quantum Leaps commercial licenses, which expressly supersede
19-
// the GNU General Public License and are specifically designed for
20-
// licensees interested in retaining the proprietary status of their code.
12+
// The QP/C software is dual-licensed under the terms of the open-source GNU
13+
// General Public License (GPL) or under the terms of one of the closed-
14+
// source Quantum Leaps commercial licenses.
2115
//
22-
// This program is distributed in the hope that it will be useful,
23-
// but WITHOUT ANY WARRANTY; without even the implied warranty of
24-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25-
// GNU General Public License for more details.
16+
// Redistributions in source code must retain this top-level comment block.
17+
// Plagiarizing this software to sidestep the license obligations is illegal.
2618
//
27-
// You should have received a copy of the GNU General Public License
28-
// along with this program. If not, see <www.gnu.org/licenses/>.
19+
// NOTE:
20+
// The GPL does NOT permit the incorporation of this code into proprietary
21+
// programs. Please contact Quantum Leaps for commercial licensing options,
22+
// which expressly supersede the GPL and are designed explicitly for
23+
// closed-source distribution.
2924
//
30-
// Contact information:
25+
// Quantum Leaps contact information:
3126
// <www.state-machine.com/licensing>
3227
3328
//============================================================================
@@ -38,13 +33,24 @@
3833
Q_DEFINE_THIS_FILE
3934

4035
//............................................................................
41-
int main() {
36+
#ifdef Q_HOST
37+
int main(int argc, char *argv[])
38+
#else
39+
int main(void)
40+
#endif
41+
{
4242
QF_init(); // initialize the framework
4343

4444
// initialize the QS software tracing
45-
if (!QS_INIT((void*)0)) {
45+
#ifdef Q_HOST
46+
if (QS_INIT((argc > 1) ? argv[1] : (void*)0) == 0U) {
4647
Q_ERROR();
4748
}
49+
#else
50+
if (QS_INIT((void*)0) == 0U) {
51+
Q_ERROR();
52+
}
53+
#endif
4854

4955
BSP_init(); // initialize the BSP
5056

qutest/dpp-comp/src/bsp.c

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,28 @@
11
//============================================================================
22
// Product: DPP example, BSP for QUTest
3-
// Last Updated for Version: 7.3.0
4-
// Date of the Last Update: 2023-08-23
5-
//
6-
// Q u a n t u m L e a P s
7-
// ------------------------
8-
// Modern Embedded Software
93
//
104
// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
115
//
12-
// This program is open source software: you can redistribute it and/or
13-
// modify it under the terms of the GNU General Public License as published
14-
// by the Free Software Foundation, either version 3 of the License, or
15-
// (at your option) any later version.
6+
// Q u a n t u m L e a P s
7+
// ------------------------
8+
// Modern Embedded Software
9+
//
10+
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
1611
//
17-
// Alternatively, this program may be distributed and modified under the
18-
// terms of Quantum Leaps commercial licenses, which expressly supersede
19-
// the GNU General Public License and are specifically designed for
20-
// licensees interested in retaining the proprietary status of their code.
12+
// The QP/C software is dual-licensed under the terms of the open-source GNU
13+
// General Public License (GPL) or under the terms of one of the closed-
14+
// source Quantum Leaps commercial licenses.
2115
//
22-
// This program is distributed in the hope that it will be useful,
23-
// but WITHOUT ANY WARRANTY; without even the implied warranty of
24-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25-
// GNU General Public License for more details.
16+
// Redistributions in source code must retain this top-level comment block.
17+
// Plagiarizing this software to sidestep the license obligations is illegal.
2618
//
27-
// You should have received a copy of the GNU General Public License
28-
// along with this program. If not, see <www.gnu.org/licenses/>.
19+
// NOTE:
20+
// The GPL does NOT permit the incorporation of this code into proprietary
21+
// programs. Please contact Quantum Leaps for commercial licensing options,
22+
// which expressly supersede the GPL and are designed explicitly for
23+
// closed-source distribution.
2924
//
30-
// Contact information:
25+
// Quantum Leaps contact information:
3126
// <www.state-machine.com/licensing>
3227
3328
//============================================================================
@@ -46,21 +41,14 @@ enum {
4641

4742
//............................................................................
4843
void BSP_init(void) {
49-
// initialize the QS software tracing
50-
if (!QS_INIT((void *)0)) {
51-
Q_ERROR();
52-
}
44+
BSP_randomSeed(1234U);
5345

5446
QS_FUN_DICTIONARY(&BSP_displayPaused);
5547
QS_FUN_DICTIONARY(&BSP_displayPhilStat);
5648
QS_FUN_DICTIONARY(&BSP_random);
5749
QS_FUN_DICTIONARY(&BSP_randomSeed);
58-
5950
QS_ONLY(produce_sig_dict());
60-
6151
QS_USR_DICTIONARY(BSP_CALL);
62-
63-
BSP_randomSeed(1234U);
6452
}
6553
//............................................................................
6654
void BSP_displayPhilStat(uint8_t n, char const *stat) {

qutest/dpp-comp/test_dpp/test_dpp.c

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,28 @@
11
//============================================================================
22
// Product: QUTEST fixture for the DPP components
3-
// Last updated for version 8.0.0
4-
// Last updated on 2024-09-18
5-
//
6-
// Q u a n t u m L e a P s
7-
// ------------------------
8-
// Modern Embedded Software
93
//
104
// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
115
//
12-
// This program is open source software: you can redistribute it and/or
13-
// modify it under the terms of the GNU General Public License as published
14-
// by the Free Software Foundation, either version 3 of the License, or
15-
// (at your option) any later version.
6+
// Q u a n t u m L e a P s
7+
// ------------------------
8+
// Modern Embedded Software
9+
//
10+
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
1611
//
17-
// Alternatively, this program may be distributed and modified under the
18-
// terms of Quantum Leaps commercial licenses, which expressly supersede
19-
// the GNU General Public License and are specifically designed for
20-
// licensees interested in retaining the proprietary status of their code.
12+
// The QP/C software is dual-licensed under the terms of the open-source GNU
13+
// General Public License (GPL) or under the terms of one of the closed-
14+
// source Quantum Leaps commercial licenses.
2115
//
22-
// This program is distributed in the hope that it will be useful,
23-
// but WITHOUT ANY WARRANTY; without even the implied warranty of
24-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25-
// GNU General Public License for more details.
16+
// Redistributions in source code must retain this top-level comment block.
17+
// Plagiarizing this software to sidestep the license obligations is illegal.
2618
//
27-
// You should have received a copy of the GNU General Public License
28-
// along with this program. If not, see <www.gnu.org/licenses/>.
19+
// NOTE:
20+
// The GPL does NOT permit the incorporation of this code into proprietary
21+
// programs. Please contact Quantum Leaps for commercial licensing options,
22+
// which expressly supersede the GPL and are designed explicitly for
23+
// closed-source distribution.
2924
//
30-
// Contact information:
25+
// Quantum Leaps contact information:
3126
// <www.state-machine.com/licensing>
3227
3328
//============================================================================
@@ -37,11 +32,28 @@
3732

3833
//#include "safe_std.h" // portable "safe" <stdio.h>/<string.h> facilities
3934

40-
//Q_DEFINE_THIS_FILE
35+
Q_DEFINE_THIS_FILE
4136

4237
//============================================================================
43-
int main() {
44-
QF_init(); // initialize the framework and the underlying RT kernel
38+
#ifdef Q_HOST
39+
int main(int argc, char *argv[])
40+
#else
41+
int main(void)
42+
#endif
43+
{
44+
QF_init(); // initialize the framework
45+
46+
// initialize the QS software tracing
47+
#ifdef Q_HOST
48+
if (QS_INIT((argc > 1) ? argv[1] : (void*)0) == 0U) {
49+
Q_ERROR();
50+
}
51+
#else
52+
if (QS_INIT((void*)0) == 0U) {
53+
Q_ERROR();
54+
}
55+
#endif
56+
4557
BSP_init(); // initialize the BSP
4658

4759
// pause execution of the test and wait for the test script to continue

qutest/dpp-comp/test_philo/test_philo.c

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,28 @@
11
//============================================================================
22
// Product: QUTEST fixture for the DPP example
3-
// Last updated for version 8.0.0
4-
// Last updated on 2024-09-18
5-
//
6-
// Q u a n t u m L e a P s
7-
// ------------------------
8-
// Modern Embedded Software
93
//
104
// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
115
//
12-
// This program is open source software: you can redistribute it and/or
13-
// modify it under the terms of the GNU General Public License as published
14-
// by the Free Software Foundation, either version 3 of the License, or
15-
// (at your option) any later version.
6+
// Q u a n t u m L e a P s
7+
// ------------------------
8+
// Modern Embedded Software
9+
//
10+
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
1611
//
17-
// Alternatively, this program may be distributed and modified under the
18-
// terms of Quantum Leaps commercial licenses, which expressly supersede
19-
// the GNU General Public License and are specifically designed for
20-
// licensees interested in retaining the proprietary status of their code.
12+
// The QP/C software is dual-licensed under the terms of the open-source GNU
13+
// General Public License (GPL) or under the terms of one of the closed-
14+
// source Quantum Leaps commercial licenses.
2115
//
22-
// This program is distributed in the hope that it will be useful,
23-
// but WITHOUT ANY WARRANTY; without even the implied warranty of
24-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25-
// GNU General Public License for more details.
16+
// Redistributions in source code must retain this top-level comment block.
17+
// Plagiarizing this software to sidestep the license obligations is illegal.
2618
//
27-
// You should have received a copy of the GNU General Public License
28-
// along with this program. If not, see <www.gnu.org/licenses/>.
19+
// NOTE:
20+
// The GPL does NOT permit the incorporation of this code into proprietary
21+
// programs. Please contact Quantum Leaps for commercial licensing options,
22+
// which expressly supersede the GPL and are designed explicitly for
23+
// closed-source distribution.
2924
//
30-
// Contact information:
25+
// Quantum Leaps contact information:
3126
// <www.state-machine.com/licensing>
3227
3328
//============================================================================
@@ -46,8 +41,25 @@ QActive * const AO_Table = &Table_dummy.super;
4641
extern QAsm * const SM_Philo[N_PHILO];
4742

4843
//............................................................................
49-
int main() {
50-
QF_init(); // initialize the framework and the underlying RT kernel
44+
#ifdef Q_HOST
45+
int main(int argc, char *argv[])
46+
#else
47+
int main(void)
48+
#endif
49+
{
50+
QF_init(); // initialize the framework
51+
52+
// initialize the QS software tracing
53+
#ifdef Q_HOST
54+
if (QS_INIT((argc > 1) ? argv[1] : (void*)0) == 0U) {
55+
Q_ERROR();
56+
}
57+
#else
58+
if (QS_INIT((void*)0) == 0U) {
59+
Q_ERROR();
60+
}
61+
#endif
62+
5163
BSP_init(); // initialize the BSP
5264

5365
// object dictionaries...

0 commit comments

Comments
 (0)