Hi MMS, I'm trying to run the qutest examples /qpcpp/examples/posix-win32-cmake/dpp/qutest. Using the explanation provided in the CMakeLists file I have been able to build all the example and they work as they should but I can not see how to run the tests. If I run the built executable (./philo_test ) the application stops at waiting for a reset, I believe this because qutest is not running.
Hi MMS, Using the repo you linked above, the qpcpp-examples/qutest/self_test/test example builds fine with -DQ_UTEST flag in the make_posix file. However with -DQ_UTEST=0 I get this error: /home/root/qp/qpcpp/examples/qutest/self_test/test/../../../../ports/posix-qutest/qutest_port.cpp:171: undefined reference to `QP::QF::stop()' /usr/lib/gcc/arm-oe-linux-gnueabi/11.4.0/../../../../arm-oe-linux-gnueabi/bin/ld: build_posix/qutest_port.o: in function `QP::QS::onTestLoop()': /home/root/qp/qpcpp/examples/qutest/self_test/test/../../../../ports/posix-qutest/qutest_port.cpp:275:...
Hi MMS The <qpc|qpcpp>/test/ example does not have a posix makefile to show how to build for posix. Thus, I have been trying to build /qp/qpcpp/examples/qutest/dpp/test_dpp with -DQ_UTEST=0 ld flag. The build keep failing, I have tried both: QP_PORT_DIR := $(QPCPP)/ports/posix-qutest and QP_PORT_DIR := $(QPCPP)/ports/posix ports. with the error below</qpc|qpcpp> When liking with posix-qutest QP_PORT_DIR := $(QPCPP)/ports/posix-qutest .o <command-line>: warning: "Q_UTEST" redefined <command-line>:...
That what I thought. I got confused reading this post linked below, about the timestamp. you stated: "Instead, the formatting of timestamps is represented as the TCL array $theFmt(tstamp)." https://sourceforge.net/p/qpc/discussion/668726/thread/feec2b7f/?limit=25#92e7
Hi MSM From what I understand the QSPY timestamp is based on Tcl associative array and the size is define with QS_TIME_SIZE ? On my project QS_TIME_SIZE is 4, what is the best way to get human readable timestamp from the output? or is the timestamp just a timer-counter? Thanks Eddie
Hi MSM From what I understand the QSPY timestamp is based on Tcl associative array and the size is define with QS_TIME_SIZE ? On my project QS_TIME_SIZE is 4, what is the best way to get human readable timestamp from the output? Thanks Eddie
Hi Miro Thanks for the fast response. I tried the new update and got this out put _port.o build_posix/qstamp.o -lpthread set -e; while true; do \ echo "restarting build_posix/test_dpp"; \ build_posix/test_dpp "" 192.168.0.7:6601; \ done restarting build_posix/test_dpp <TARGET> ERROR cannot resolve host Name=:6601,Err=-2 <TARGET> ERROR invalid TCP socket restarting build_posix/test_dpp <TARGET> ERROR cannot resolve host Name=:6601,Err=-2 <TARGET> ERROR invalid TCP socket which is not correct. this...
Hi Miro Thanks for the fast response. I tried the new update and got this out put _port.o build_posix/qstamp.o -lpthread set -e; while true; do \ echo "restarting build_posix/test_dpp"; \ build_posix/test_dpp "" 192.168.0.7:6601; \ done restarting build_posix/test_dpp <TARGET> ERROR cannot resolve host Name=:6601,Err=-2 <TARGET> ERROR invalid TCP socket restarting build_posix/test_dpp <TARGET> ERROR cannot resolve host Name=:6601,Err=-2 <TARGET> ERROR invalid TCP socket which is not correct. this...
to run the test I'm using the instructions provided in the make make_posix file make -f make_posix HOST=192.168.1.65:6601 # examples of invoking this Makefile: # make -f make_posix # make and run the tests in the current directory # make -f make_posix HOST=192.168.1.65:6601 # make and run the executable # make -f make_posix norun # only make but not run the tests # make -f make_posix clean # cleanup the build From the make print out it looks like HOST=192.168.1.65:6601 is being ignored as qutest...
Yes, I used it as a guide.
Hi Miro. I'm trying to build and run the qutest example for posix on a Beaglebone black running Linux 6.1.46-g1d4b5da681 #1 PREEMPT Thu Oct 19 10:19:08 UTC 2023 armv7l armv7l armv7l GNU/Linux and qp 7.3.3 when I run make as below I get TARGET ERROR infinit loop root@bbb-m1914:~/qp/qpcpp/examples/qutest/dpp/test_dpp# make -f make_posix HOST=192.168.0.110:6601 #set -e; while true; do \ echo "restarting build_posix/test_dpp"; \ build_posix/test_dpp "" 192.168.0.110:6601; \ done restarting build_posix/test_dpp...
Hi Miro, Thanks for the fix, much appreciated.
Hi Miro I have some old qutest tests that used to work but now throwing an error when I run them, this is after updating to QP 7.3.3 I have also tried the qutest example provide with qpcpp: qp/qpcpp/examples/qutest/dpp/test_dpp The example tests builds and runs as expected. but when I try make debug I get the same error: eddie@DESKTOP-JMAMJDN:~/qp/qpcpp/examples/qutest/dpp/test_dpp$ make debug python3 /home/eddie/qp/qtools/qutest/qutest.py -edebug -q -l -o -- QUTest unit testing front-end 7.3.3 running...
I have changed the init() mutex initialization from the new recursive mutex back to non-recursive initializer. This has resolved the issue were the application hangs after calling pthread_mutex_unlock(&l_startupMutex); and high cpu usage is gone. // initialize the critical section mutex QF_critSectMutex_ as a // *recursive mutex* in a portable way according to the POSIX Standard // pthread_mutexattr_t attr; // pthread_mutexattr_init(&attr); // pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);...
I have added some printf code in the run() int run() { onStartup(); // application-specific startup callback PRINTF_S("\n%s\n", "run() onStartup()!"); // produce the QS_QF_RUN trace record QS_BEGIN_PRE_(QS_QF_RUN, 0U) QS_END_PRE_() // try to set the priority of the ticker thread, see NOTE01 struct sched_param sparam; sparam.sched_priority = l_tickPrio; if (pthread_setschedparam(pthread_self(), SCHED_FIFO, &sparam) == 0) { // success, this application has sufficient privileges } else { // setting...
Hi Miro, Having full control the sleeping mechanism make sense, I was think of options that could help while debugging the issue I'm having. I have tried just using sleep(1) as suggested got this output Dining Philosophers Problem example QP 7.3.1 Press 'p' to pause Press 's' to serve Press ESC to quit... Philosopher 0 is thinking Philosopher 1 is thinking Philosopher 2 is thinking Philosopher 3 is thinking Philosopher 4 is thinking [ 785.781975] sched: RT throttling activated the application stops...
The example runs fine on a laptop running Ubuntu 20.04. I have also tested in WSL Unbutu 22.04 without any issues. I did try using poll() blocking call with the same results. I will try sleep() next. If i replace the clock_nanosleep() with the nanosleep() in the run function in qf_port.cpp, will this be a valid test? // sleep without drifting till next_time (absolute), see NOTE03 if (clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &next_tick, NULL) == 0) // success? { // clock tick callback (must...
Hi Miro, I have tested the new ~/qpcpp/examples/posix-win32/dpp-posix# example that uses the select() api. This is the output I get Dining Philosophers Problem example QP 7.3.1 Press 'p' to pause Press 's' to serve Press ESC to quit... Philosopher 0 is thinking Philosopher 1 is thinking Philosopher 2 is thinking Philosopher 3 is thinking Philosopher 4 is thinking Then the application just freezes and the board becomes unresponsive. I have added a print statement before select is called as bellow...
Hi Miro, Thanks for the update. TI has just released a new processor sdk for the Beaglebone black, I will try the - qpcpp/examples/posix-win32/dpp-posix example on both the new and older sdk. I will update you on findings. Thanks Eddie
Hi Miro, I'm using the multithreaded POSIX port. Testing nanosleep() and clock_nanosleep() with a simple application running on a Beaglebone black, shows clock_nanosleep() loading the CPU. I'm not sure why this is the case. The DDP example on a Linux desktop works as expected. I will investigate why this is not the case on the Beaglebone black. Thanks for your time, Eddie
Hi Miro, My project was based on qpcpp version 7.2.1 and the qp/qpcpp/examples/workstation/dpp example. Running on the Beaglebone black with Linux 5.10.168-g991c5ce91e #1 PREEMPT. After updating to the latest qp release v7.3.0, my application now loads the cpu up to %95 in both Idle and running states. To isolate the issue, I downloaded qpcpp v7.3.0 onto the Beaglebone black and run the dpp posix example, which presented the same issue, high cpu usage when running the dpp application. The qpcpp v7.2.1...
Thanks for the info MMS. Eddie
Hie Miro Is there an example that shows how to use QP QEQueue for communication between raw threads and qp active objects? I’m using QF posix port, I have a raw pthread that deals with TCP comms and would like to send events to it. I can post events from the thread to an AO without any issues, I’m just not sure how to get started with receiving events from AOs
Hi Miro, I have managed to get debugging working by not passing the hostname to getaddrinfo() call above ~~~ memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_INET; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = IPPROTO_TCP; status = getaddrinfo(0, serviceName, &hints, &result); ~~~ with this change I don't get any errors. I'm not sure if this is the best solution. Eddie.
Hi Miro, I will not have access to the first PC mentioned above till Monday. On another machine, Ubuntu 20.04 with QSPY 7.1.1 qpcpp_7_0_1. using the qutest blinky example. start qspy QSPY 7.1.1 Copyright (c) 2005-2022 Quantum Leaps Documentation: https://www.state-machine.com/qtools/qspy.html Current timestamp: 230324_170000 -u 7701 -t 6601 output: <F-END> Attached Chan=00000010 start qutest with make debug python3 /home/eddie/qp/qtools/qutest/qutest.py *.py DEBUG QUTest unit testing front-end 7.1.0...
Hi Miro, I will not have access to the first PC mentioned above till Monday. On another machine, Ubuntu 20.04 with QSPY 7.1.1 qpcpp_7_0_1. using the qutest blinky example. start qspy QSPY 7.1.1 Copyright (c) 2005-2022 Quantum Leaps Documentation: https://www.state-machine.com/qtools/qspy.html Current timestamp: 230324_170000 -u 7701 -t 6601 output: <F-END> Attached Chan=00000010 start qutest with make debug python3 /home/eddie/qp/qtools/qutest/qutest.py *.py DEBUG QUTest unit testing front-end 7.1.0...
Hi Miro, I will not have access to the first PC mentioned above till Monday. On another machine, Ubuntu 20.04 with QSPY 7.1.1 qpcpp_7_0_1. using the qutest blinky example. start qspy QSPY 7.1.1 Copyright (c) 2005-2022 Quantum Leaps Documentation: https://www.state-machine.com/qtools/qspy.html Current timestamp: 230324_170000 -u 7701 -t 6601 output: <F-END> Attached Chan=00000010 start qutest with make debug python3 /home/eddie/qp/qtools/qutest/qutest.py *.py DEBUG QUTest unit testing front-end 7.1.0...
I'm using Ubuntu installed in windows WSL, not sure if that would cause any issues. I have updated QP to 7.2.1. Still having the same issue. Using the command python3 $QTOOLS/qutest/qutest.py -eDEBUG -- test_blinky.py to start the test in debug mode. GDB output Breakpoint 1, main (argc=2, argv=0x7fffffffdc68) at test_blinky.cpp:43 43 int main(int argc, char *argv[]) { Loaded '/lib/x86_64-linux-gnu/libc.so.6'. Symbols loaded. Execute debugger commands using "-exec <command>", for example "-exec info...
I'm using QP/C++ 7.1.2 and QUTest unit testing front-end 7.1.2 running on Python 3.10.6. Simple tests works perfectly without any issues. Only debug mode is not working. It would be ideal if I can get debugging working just now without having to upgrade to QUTest 7.2.1 . Will upgrade in the near future as the new features look really useful.
Hi Miro I'm trying to run the qutest blinky example in debug mode. I can start the debug process as described in the YouTube video. The application crashes when onStartup function is called. This is located in qpcpp/port/posix-qutest/qutest_port.cpp I'm using VS code debugger with gdb in Ubuntu 22.04. I have tried stepping into onStartup(), but the application crashes as soon as I step into it. debugger output. Loaded '/lib64/ld-linux-x86-64.so.2'. Symbols loaded. [Thread debugging using libthread_db...
MMS, I was using your implementation in qf_port as a starting point in configuring the raw p-threads, that's when I came to the question of scheduling policy and priority. Thank you very much for your response and time, it's much appreciated. Eddie
Miro, Thanks for your example approach, it makes a lot of sense. When it comes to configuring the thread priorities using rat-monotonic as an example, would you consider both the active objects and the raw p-threads in the same context or does this require a specific approach? Thanks Eddie
Hi Miro After using command(0) I have run into an issue were I create an infinite loop of self posted events which is not ideal. A bit more context on what I am working on. My target is uses Linux OS, I have to collect data from a fifo (named pipe) using a blocking read() system call. To isolate the blocking, I have a single AO that acts as a message pump. When it gets READ_SIG it calls read() which will block till data is available. With new data, the AO just packages the data and posts it to a...
Hi Miro After using command(0) I have run into an issue were I create an infinite loop of self posted events which is not ideal. A bit more context on what I am working on. My target is uses Linux OS, I have to collect data from a fifo (named pipe) using a blocking read() system call. To isolate the blocking, I have a single AO that acts as a message pump. When it gets READ_SIG it calls read() which will block till data is available. With new data, the AO just packages the data and posts it to a...
Thank you very much Miro, you solution is exactley what I was looking for. Much appreciated. Eddie
Hi Miro I'm using Qutest to test an AO that sends an event to self to trigger some start action from the entry action in the initial state. In other words, on start-up execute initial transition to initial state, on entry into the state call a bsp function getStatus(). Based on the return value of this function the AO sends START_SIG or ERROR_SIG to self. These events will trigger state transitions when handled. The issue I'm having is, I would like to test the entry action's response to the return...
managed to get it working had to use QUTEST_ON_POST for QS_BEGIN_ID not QS_BEGIN_ID(COMMS_CH1_NEW_CLIENT_SIG, 0U) using QS_BEGIN_ID(QUTEST_ON_POST, 0U) got rid of the errors
Hi Miro I’m using qutest to develop my project. In my test.py script, I’m dispatching an event to the application under test. I fill in the event structure using pack(). dispatch("COMMS_CH1_NEW_CLIENT_SIG", pack("<10s16s",b'<1y3r4', b'192.168.0.125')) To see if this is working as I expect I’m using the onTestEvt( ) in the test.cpp to show the contents of the event. // callback function to "massage" the event, if necessary void QS::onTestEvt(QEvt *e) { (void)e; switch (e->sig) { case COMMS_CH1_NEW_CLIENT_SIG:...
Hi Miro, Thanks for the response much appreciated, I will read the QP/C++ Manual. In my experimental code, changing the class functions to static fixies the issue as you pointed out. Thanks again, much appreciated I always learn something new. Eddie.
Both qpcpp\ports\win32-qv and qpcpp\ports\win32 header files already handle correctly the pointer sizes as you have descibed. From my compiler output I get: C:/qp/qpcpp/ports/win32-qutest/qs_port.hpp C:/qp/qtools/mingw32/i686-w64-mingw32... the test results QS_OBJ_PTR_SIZE==4, QS_FUN_PTR_SIZE=4 file win32-qutest/qs_port.hpp /// @endcond /// #ifndef QS_PORT_HPP #define QS_PORT_HPP #define QS_TIME_SIZE 4U #ifdef _WIN64 // 64-bit architecture? #define QS_OBJ_PTR_SIZE 8U #define QS_FUN_PTR_SIZE 8U #else...
Both qpcpp\ports\win32-qv and qpcpp\ports\win32 header files already handle correctly the pointer sizes as you have descibed. From my compiler output I get: C:/qp/qpcpp/ports/win32-qutest/qs_port.hpp C:/qp/qtools/mingw32/i686-w64-mingw32... the test results QS_OBJ_PTR_SIZE==4, QS_FUN_PTR_SIZE=4 file win32-qutest/qs_port.hpp /// @endcond /// #ifndef QS_PORT_HPP #define QS_PORT_HPP #define QS_TIME_SIZE 4U #ifdef _WIN64 // 64-bit architecture? #define QS_OBJ_PTR_SIZE 8U #define QS_FUN_PTR_SIZE 8U #else...
Both qpcpp\ports\win32-qv and qpcpp\ports\win32 header files already handle correctly the pointer sizes as you have descibed. From my compiler output I get: C:/qp/qpcpp/ports/win32-qutest/qs_port.hpp C:/qp/qtools/mingw32/i686-w64-mingw32... the test results QS_OBJ_PTR_SIZE==4, QS_FUN_PTR_SIZE=4 file win32-qutest/qs_port.hpp /// @endcond /// #ifndef QS_PORT_HPP #define QS_PORT_HPP #define QS_TIME_SIZE 4U #ifdef _WIN64 // 64-bit architecture? #define QS_OBJ_PTR_SIZE 8U #define QS_FUN_PTR_SIZE 8U #else...
Hi MMS, I'm using a 64-bit machine with win 10. My compiler is using 4 bytes for pointer size as you have noted. How do I adjust the QS port accordingly. the qpcpp/ports/win/ qs_port.hpp has #ifdef _WIN64 // 64-bit architecture? #define QS_OBJ_PTR_SIZE 8U #define QS_FUN_PTR_SIZE 8U #else // 32-bit architecture #define QS_OBJ_PTR_SIZE 4U #define QS_FUN_PTR_SIZE 4U #endif I'm a bit lost now. I have tried a few ideas but I don't realy know what I'm doing. Thanks Eddie
Hi Miro, Thanks for the solution and explanation. This does resolve my issue, template inline functions don't have an address to point to. Using User-dictionaries works very well. However, as an experiment I tried the simple method of using pointer to functions on regular non-templated and non-inline functions and got the same error. error: invalid cast from type 'void (foo::*)()' to type 'uint32_t' {aka 'unsigned int'} 910 | reinterpret_cast<std::uint32_t>(fun_)))</std::uint32_t> **file fool.hpp...
Hi Miro, Thanks for the example, it makes sense. However the struct I'm trying to write a spy for has static functions in the .hpp file and templates as follows. file: reg_access.hpp template <typename register_address_type, typename register_value_type> struct reg_access_dynamic final { static register_value_type reg_get(const register_address_type address) { return *reinterpret_cast<volatile register_value_type *>(address); } static void reg_set(const register_address_type address, const register_value_type...
Hi Miro, Thanks for the example, it makes sense. However the struct I'm trying to write a spy for has static functions in the .hpp file and templates as follows. file: reg_access.hpp template <typename register_address_type, typename register_value_type> struct reg_access_dynamic final { static register_value_type reg_get(const register_address_type address) { return *reinterpret_cast<volatile register_value_type *>(address); } static void reg_set(const register_address_type address, const register_value_type...
I would like to use QUtest and TTD to develop my C++ project. Is there an example that shows how to write a class or struct "spy object" test double. My code under test calls functions defined in a struct, how would I go about creating a spy object for the struct? I have looked at the example code in qpc/qutest and qpcpp/qutest without any luck. I don’t see how to convert the .c spy objects examples to C++. Any ideas would be really appreciated.
Miro, Looking back at my previous posts I can see how confusing my description is. I think diagrams and code snippets would have helped, I guess. The Components interact with the Container AO, thus your second solution works in my case. If they don't interact at all (they are perfectly "orthogonal"), perhaps you can get away with using some "dummy" test doubles. But remember that the "dummies" must be actually instantiated and constructed (before you call on them QHSM_INIT() and QHSM_DISPATCH()....
Miro, Using the suggested debugging method, I can confirm that the real constructer for the orthogonal component is not being called since I have replaced it’s source file with a test double. The test double does not handle any instantiation. Do I need to manually add QHSM_IINIT() in the test double? The approach I’m using is to test the main AO in isolation and the orthogonal components on their own. This means, when testing the main AO I have the CUT: UIconfig.c, TESTS: test_UIconfig.c, spy_A.c,...
Using the suggested debugging method, I can confirm that the real constructer for the orthogonal component is not being called since I have replaced it’s source file with a test double. The test double does not handle any instantiation. Do I need to manually add QHSM_IINIT() in the test double? The approach I’m using is to test the main AO in isolation and the orthogonal components on their own. This means, when testing the main AO I have the CUT: UIconfig.c, TESTS: test_UIconfig.c, spy_A.c, spy_B.c...
Hi Miro I have an AO (UIconfig) that has two component HSMs “A” and “B”. My implementation is based on the dpp-comp example: qp\qpc\examples\workstation\dpp-comp The main AO calls the constructors for both “A” and “B” HSMs from its constructor, the hsm constructors are defined in “A” and “B” source files. Next, QHSM_IINIT() for each HSM is called from UIconfig _initial(), this works fine. When writing tests for UIconfig I get an assertion when QHSM_IINIT() is called from the CUT UIconfig _initial()....
Thank you Miro The issue was with my QS_MEM(). as you pointed out was incorrect thus the callback was not working resualting in the timeout. Changing it to: QS_MEM(Q_EVT_CAST(UartEvt)->chars, 8); resolved the issue. With this fix the test is executing correctlly. Thanks again.
Hi Miro In the QUTest script discussed above I would like to see the contents of a published event to verify that the CUT is receiving the correct packed data provided by the test script. For example a bsp uart publishes an evet containing a char[8] and its length. Using pack() to fill the evt struct… typedef struct { /* protected: */ QEvt super; uint8_t len; // length of rx string. char chars[UART1_FIFO_LEN]; } UartEvt; I would like to be able to see the values that have been packed into the event....
Hi Miro In the QUTest script discussed above I would like to see the contents of a published event to verify that the CUT is receiving the correct packed data provided by the test script. For example a bsp uart publishes an evet containing a char[8] and its length. Using pack() to fill the evt struct… typedef struct { /* protected: */ QEvt super; uint8_t len; // length of string. char chars[UART1_FIFO_LEN]; } UartEvt; I would like to be able to see the values that have been packed into the event....
Miro I have a HSM that collects fixed number of samples from an ADC. The total number of samples is a const variable defined in a configs.h file. What is the best way to change this value during testing without having to change the definition to a static in RAM. As an example, Static const uint8_t SAMPLES = 20; or ##define SAMPLES (20) Used as: if collectedSamples == SAMPLES status_ = Q_TRAN(&processing); during testing I would like to have few iterations, say 5 then transition to processing state....
Miro I have a HSM that collects fixed number of samples from an ADC. The total number of samples is a const variable defined in a configs.h file. What is the best way to change this value during testing without having to change the definition to a static in RAM. As an example, Static const uint8_t SAMPLES = 20; or #define SAMPLES (20) Used as: if collectedSamples == SAMPLES status_ = Q_TRAN(&processing); during testing I would like to have few iterations, say 5 then transition to processing state....
Thanks Miro that worked. Eddie
Hi Miro I have finally manged to get the function test running the way I want, it did take a bit of with the help of the suggested text. However, I’m stuck again. I have bsp function that takes 3 pointers, fills them with new data and returns. What is the best way to fill in the pointers with the new expected data and check the returned value? In spy_bsp.c file I have the test double function as: void BSP_Accelerometer_Input(uint16_t *x, uint16_t *y, uint16_t *z) { QS_BEGIN_ID(BSP_CALL, 0U) /* app-specific...
Hi Miro I have another issue now. I’m trying to write a functional test for the same AO in the previous discussion. This time I’m using the qutest\qmsmtst\test\test_qmsm-funct.py example. This is my test script: # preamble... def on_reset(): expect_pause() continue_test() glb_filter(GRP_UA) current_obj(OBJ_SM, "AO_Acceleration") expect_run() # test initialisation test("Acceleration_init") init() On running this script, I get a failure: Group: test_funct.py Acceleration_init: FAIL (0.048s): @C:\qp\qtools\qutest\qutest.py/glb_filter:333...
Hi Miro I have another issue now. I’m trying to write a functional test for the same AO in the previous discussion. This time I’m using the qutest\qmsmtst\test\test_qmsm-funct.py example. This is my test script: # preamble... def on_reset(): expect_pause() continue_test() glb_filter(GRP_UA) current_obj(OBJ_SM, "AO_Acceleration") expect_run() # test initialisation test("Acceleration_init") init() On running this script, I get a failure: Group: test_funct.py Acceleration_init: FAIL (0.048s): @C:\qp\qtools\qutest\qutest.py/glb_filter:333...
Currently I have no other issues. Thank you very much for your help Miro, much appreciated Eddie
Update: I have configured the failing test with 2 different one-shot times as shown in the dpp test_tick example. # test calibration get data time out transitions to trigger reading test("post ACC_GET_DATA_TIMEOUT_SIG, in get data state", NORESET) query_curr(OBJ_SM) expect("@timestamp Query-SM Obj=Acceleration_inst,State=Acceleration_calibration_getData") query_curr(OBJ_AO) expect("@timestamp Query-AO Obj=Acceleration_inst,State=Acceleration_calibration_getData") current_obj(OBJ_TE, "Acceleration_inst.accelerationGetDataTimeEvt")...
Update: I have configured the failing test with 2 different one-shot times as shown in the dpp test_tick example. # test calibration get data time out transitions to trigger reading test("post ACC_GET_DATA_TIMEOUT_SIG, in get data state", NORESET) query_curr(OBJ_SM) expect("@timestamp Query-SM Obj=Acceleration_inst,State=Acceleration_calibration_getData") query_curr(OBJ_AO) expect("@timestamp Query-AO Obj=Acceleration_inst,State=Acceleration_calibration_getData") current_obj(OBJ_TE, "Acceleration_inst.accelerationGetDataTimeEvt")...
Update: I have configured the failing test with 2 different one-shot times as shown in the dpp test_tick example. # test calibration get data time out transitions to trigger reading test("post ACC_GET_DATA_TIMEOUT_SIG, in get data state", NORESET) query_curr(OBJ_SM) expect("@timestamp Query-SM Obj=Acceleration_inst,State=Acceleration_calibration_getData") query_curr(OBJ_AO) expect("@timestamp Query-AO Obj=Acceleration_inst,State=Acceleration_calibration_getData") current_obj(OBJ_TE, "Acceleration_inst.accelerationGetDataTimeEvt")...
Update: I have configured the failing test with 2 different one-shot times as shown in the dpp test_tick example. # test calibration get data time out transitions to trigger reading test("post ACC_GET_DATA_TIMEOUT_SIG, in get data state", NORESET) query_curr(OBJ_SM) expect("@timestamp Query-SM Obj=Acceleration_inst,State=Acceleration_calibration_getData") query_curr(OBJ_AO) expect("@timestamp Query-AO Obj=Acceleration_inst,State=Acceleration_calibration_getData") current_obj(OBJ_TE, "Acceleration_inst.accelerationGetDataTimeEvt")...
TE0-ADis Obj=Acceleration_inst.accelerationGetDataTimeEvt,... This should be generated when a one-shot time event is handled in QS_tickX_() (see file qpc\src\qs\qutest.c). Of course, this is assuming that you didn't filter this out (did you?) The only filter defined is a global filter: glb_filter(GRP_SM). I'm not sure if this filters out the auto disarm trace info. I got the test to run without the assertion. Firstly, as advised I disarmed the one-shot timer on exit of each state, this resolved the...
I’m using the \qp\qpc\examples\qutest\qmsmtst to create structural test for my qm based project. Following the example I have managed to create tests that test most of the transitions, entry and exit actions of the AO. I’m stuck on testing a hsm with 2 nested states that use one shot timer events to transition between the 2 states. The first one-shot timer is armed in the state entry action of the first state for 10ms. The timeout event from this timer triggers a transition to the next state. The...
Hi Miro Thanks for prompt replay. Your explanation and suggestion has cleared up some misunderstanding on my part. I will experiment with the suggested code organization. If I run into any issues I will update you. thanks again for your time and effort Eddie
I’m trying to add unit tests to an existing project using qutest. The project is based on the freeRTOS DDP example. The issue I’m having is how to organise production code and test code, mainly the bsp .h .c files. In my current project I have all the application source files and header files in the same folder as shown in the screen clipping. I have added a separate folder with the test code (test-fixture, test spy and test script) to the same project. I’m not sure as to how I can add the host specific...
Hi Miro No reason for using the old GCC it's an old installation that has not been used in while thus not been updated. I tend to use arm gcc provided with QP for target development or gcc installed in a docker container for TDD using seedling . That was the problem removing the old gcc fixed the build issue. Thanks for the prompt and informative replay Miro, much appreciated. Eddie.
I’m following the YouTube video example debugging with QUTest using the blinkey example code. When I try to build the test fixtures in C:\qp\<qpc|qpcpp>\examples\qutest\blinky\test I get compile errors referring to undefined reference to `_imp____acrt_iob_func'.</qpc|qpcpp> I have tried rebuild the GCC library on my machine, Uninstalling and reinstalling QP as suggested here. https://sourceforge.net/p/qpc/discussion/668726/thread/cbb29f4a43/?limit=25#5563 I’m using qp 6.9.3 on windows 10 Build output...
Hi Miro Thanks for the very detailed explanation much appreciated, learning a lot. Your explanation (example) is in line with what I discovered after extensive debugging and datasheet reading, I had made bad assumptions. I was not of the best way to proceed, your example and explanation helped solve that issue. Thanks again. Eddie.
Hi Miro Thanks for the very detailed explanation much appreciated, learning a lot. Your explanation (example) is in line with what I discovered after extensive debugging and datasheet reading, I had made bad assumptions. I was not of the best way to proceed, your example and explanation helped solve that issue. Thanks again. Eddie.
Hi everyone, I need some advice or help. I’m having an issue with a uart1 ISR and active object implementation. I have an ISR that is triggered when the uart buffer has data. On entering the ISR a new from ISR event is requested from QF, data from the uart buffer is saved into the new event object, the same data is output to the terminal using another (Uart0) with in the ISR. This part is working as expected the second uart0 echo’s the data received by uart1. If 1234 is sent 1234 is echoed back....
Hi everyone, I need some advice or help. I’m having an issue with a uart1 ISR and active object implementation. I have an ISR that is triggered when the uart buffer has data. On entering the ISR a new from ISR event is requested from QF, data from the uart buffer is saved into the new event object, the same data is output to the terminal using another (Uart0) with in the ISR. This part is working as expected the second uart0 echo’s the data received by uart1. If 1234 is sent 1234 is echoed back....
Hi MMS Thanks for the detailed explanation, that solved my issue. Eddie
Hi everyone need help with the FreeRTOS port example. I’m currently working with the freeRTOS port example located in \qpc\examples\freertos\arm-cm\dpp_ek-tm4c123gxl The port is for the tm4c123gxl processer. I’m trying to add an ADC ISR to the existing project but keep getting a compile error: ..\bsp.c(76): error: #94: the size of an array must be greater than zero I believe this is due to this assertion / "kernel-aware" interrupts should not overlap the PendSV priority / Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI...