Commit Graph

81 Commits

Author SHA1 Message Date
Xiang Xiao
9291d07a87 Fix the coding style issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-06 12:20:32 +02:00
Petro Karashchenko
8e8d461590 ostest/prioinherit: fix priority inheritance test when compiled without optimisation
When application is compiled without optimisation the stack usage
is higher. 1K stack of adversary task is getting overflowed and that
leads to crash. Set stack size to CONFIG_DEFAULT_TASK_STACKSIZE for
adversary task

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-01 11:41:26 +08:00
ligd
048b79955e ostest: fix sighand_test report error
sighand_test: ERROR waiter task did not exit

reason:
sleep will be interrupt by signal

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-09-07 01:18:15 +08:00
Fotis Panagiotopoulos
c4c3ffff90 ostest: Fixed prints in setenv test. 2022-07-20 11:57:01 +08:00
Xiang Xiao
26367a66db testing/ostest: Replace up_tls_info with tls_get_info
follow the kernel side change

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-30 15:14:29 +03:00
David Sidrane
3821121a2e ostest:priority_inheritance Added priority restoration test 2022-05-21 18:27:55 +03:00
chao.an
e4dcdcd158 testing/ostest: remove CONFIG_TESTING_OSTEST_FPUSIZE
fptest should not need to care about the size of FPU

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-19 02:48:24 +08:00
Petro Karashchenko
566be8c7b1 definitions: unify MAX and MIN macro definitions
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-16 23:20:17 +08:00
Alin Jerpelea
e0499fea49 apps: testing: ostest: nxstyle fixes
fixes for errors reported by nxstyle

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-03-08 01:44:49 +08:00
Alin Jerpelea
f57c59ff54 apps: testing: ostest: update licenses to Apache
Gregory Nutt has submitted the SGA
Haltian Ltd has submitted the SGA

as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-03-08 01:44:49 +08:00
Huang Qi
cc156b908e ostest: Introduce basic setjmp/longjmp test
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-03-01 12:03:31 +08:00
chao.an
cb988a8394 testing/ostest: set the default value to TESTING_OSTEST_FPUSIZE
.config:2053:warning: symbol value '' invalid for TESTING_OSTEST_FPUSIZE

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-09 18:07:52 +08:00
Fotis Panagiotopoulos
bc5d8034f1 Typo fixes. 2022-01-06 10:30:41 +08:00
Zeng Zhaoxiu
614b73d321 ostest: sighand.c: add sem_wait in signal handler
task is blocked by semphore1, signal handler is blocked by semphore2,
after post semphore2, the task must get -EINTR.

Signed-off-by: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>
2022-01-05 21:34:30 +09:00
Jiuzhu Dong
4a14126d76 ostest: fix assert when enable CONFIG_PRIORITY_INHERITANCE
[ 96.555456] [265] ap: up_assert: Assertion failed at file:semaphore/sem_holder.c line: 112 task: pt-0x5b09fd0b
[ 96.555657] [265] ap: up_assert: Assertion failed at file:semaphore/sem_recover.c line: 86 task: pt-0x5b09fd0b
[ 96.555828] [265] ap: up_assert: Assertion failed at file:semaphore/sem_recover.c line: 86 task: pt-0x5b09fd0b
[ 96.556023] [265] ap: up_assert: Assertion failed at file:semaphore/sem_recover.c line: 86 task: pt-0x5b09fd0b
[ 96.556222] [265] ap: up_assert: Assertion failed at file:semaphore/sem_recover.c line: 86 task: pt-0x5b09fd0b
[ 96.556437] [265] ap: up_assert: Assertion failed at file:semaphore/sem_recover.c line: 86 task: pt-0x5b09fd0b
[ 96.556639] [265] ap: up_assert: Assertion failed at file:semaphore/sem_recover.c line: 86 task: pt-0x5b09fd0b
[ 96.556842] [265] ap: up_assert: Assertion failed at file:semaphore/sem_recover.c line: 86 task: pt-0x5b09fd0b
[ 96.557036] [265] ap: up_assert: Assertion failed at file:semaphore/sem_recover.c line: 86 task: pt-0x5b09fd0b

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-01-05 20:20:45 +08:00
Xiang Xiao
87d8494a6e testing/ostest: Include nuttx/arch.h explicitly
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-08 16:32:47 +08:00
Xiang Xiao
14a52b1933 testing/ostest: Don't include arch/tls.h
since it doesn't exist any more

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-05 23:06:02 -03:00
Juha Niskanen
0c21a89a3f testing/ostest: remove spurious redefinitions of NULL
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2021-11-29 11:14:42 -06:00
Xiang Xiao
3ba18e5407 testing/ostest: Fix the compiler warning
aio.c: In function ‘check_done’:
aio.c:158:41: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘ssize_t’ {aka ‘volatile long int’} [-Wformat=]
  158 |           printf("  list[%d]. result = %d\n", i, aiocbp->aio_result);
      |                                        ~^        ~~~~~~~~~~~~~~~~~~
      |                                         |              |
      |                                         int            ssize_t {aka volatile long int}
      |                                        %ld
aio.c: In function ‘remove_done’:
aio.c:222:41: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘ssize_t’ {aka ‘volatile long int’} [-Wformat=]
  222 |           printf("  list[%d]. result = %d\n", i, aiocbp->aio_result);
      |                                        ~^        ~~~~~~~~~~~~~~~~~~
      |                                         |              |
      |                                         int            ssize_t {aka volatile long int}
      |                                        %ld

sporadic2.c: In function ‘sporadic2_test’:
sporadic2.c:313:10: warning: format ‘%i’ expects argument of type ‘int’, but argument 4 has type ‘long int’ [-Wformat=]
  313 |   printf("Sporadic 1: prio high %d, low %d, repl %" PRIi32 " ns\n",
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/xiaoxiang/backup/os/nuttx/nuttx/include/stdint.h:35,
                 from /home/xiaoxiang/backup/os/nuttx/nuttx/include/sys/types.h:32,
                 from /home/xiaoxiang/backup/os/nuttx/nuttx/include/stdio.h:30,
                 from sporadic2.c:27:
/home/xiaoxiang/backup/os/nuttx/nuttx/include/arch/inttypes.h:51:24: note: format string is defined here
   51 | #  define PRIi32      "i"
sporadic2.c:315:10: warning: format ‘%i’ expects argument of type ‘int’, but argument 4 has type ‘long int’ [-Wformat=]
  315 |   printf("Sporadic 2: prio high %d, low %d, repl %" PRIi32 " ns\n",
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-10-31 14:07:25 -03:00
Abdelatif Guettouche
b1fb24d5b9 testing/ostest/barrier: Remove duplicate initialization of the barrier's
attributes.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-07-28 21:13:14 -07:00
Abdelatif Guettouche
025ce0e008 testing/ostest/barrier: Fix the message printed when
pthread_barrier_init fails.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-07-28 21:13:14 -07:00
Alin Jerpelea
6f4dccdb64 testing: fix relative path CI error
error: Path relative to repository other than nuttx must begin with the root directory
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-06-16 09:03:06 -05:00
Alin Jerpelea
3378b8ef54 testing: ostest: nxstyle fixes
Fixes for errors reported by nxstyle tool

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-06-10 08:49:24 -05:00
Alin Jerpelea
590307e957 testing: update licenses to Apache
Gregory Nutt is has submitted the SGA

Mark Schulte has submitted the ICLA

Ken Pettit has submitted the ICLA

as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-06-10 08:49:24 -05:00
Alin Jerpelea
ec339bc49a Makefiles: Gregory Nutt: update licenses to Apache
Gregory Nutt is the copyright holder for those files and he has submitted the
SGA as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-06-07 21:35:33 -05:00
Xiang Xiao
a6ca97d733 ostest: Include errno.h in timedmutex.c
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-05-18 12:42:02 +01:00
Abdelatif Guettouche
e86faa6966 testing/ostest: Fix nxstyle errors.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-04-30 09:17:14 -03:00
Abdelatif Guettouche
0e9f08e454 testing/ostest: Report "ERROR" the same way for all the test cases.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-04-30 09:17:14 -03:00
Gregory Nutt
dd7c3bfa53 apps/testing/ostest: Add test for required argument format
The Linux man page requires that the getopt_long() and getopt_long_only() functions accept arguments to options in a form like:

    --option=argument

This PR adds a test that missing functionality that was recently added to NuttX.

This change also fixes an error in string comparison that was working before only because of the way that strings are stored by in linker ELF.  The address of the strings were being compared, not the value of the string.

This change effects only the getopt() tests of the OS test.

Tested on a simulator NSH configuration and used to verify the NuttX change.
2021-04-04 14:14:21 -05:00
Gregory Nutt
6a679043e6 testing/ostest: More improvements to getopt() testing/ostest
Fix optind range checking.  optind may index through argc (to the NULL argv entry) on the last option since optind is required to always point to the next command line argument.

Add two more test cases were the final thing on the command line is an invalid long option.

Fix a check that used an older, obsoleted hard-coded value that was not updated.

This should have no impact other than to the getopt() test cases of the OS test.

Tested on the simulator using a modified NSH configuration.
2021-04-04 11:45:24 -05:00
Gregory Nutt
02ef45980b OS Test: Minor improvement to the getopt() test
Add logic to assure that the getopt() functions parse exactly the correct number of parameters.  Previously if the test terminated early, the error would be undetected.  Also, prevents indexing past the end of the results array.

Fixes a coding error that was not causing a test failure.

Add some minimal level of testing for invalid options (this found a good bug in getopt_long()).

Affects only the getopt() test cases of the OS test.

Verified using an NSH simulator configuration set up to add apps/testing/ostest as a built-in command.
2021-04-04 07:15:35 -05:00
Gregory Nutt
99138f6b39 testing/ostest: Add a test of the getopt() family of interfaces.
This new test was used to verify the new implementations of getopt_long() and getopt_long_only() and to verify that there are no regressions to the existing getopts().

Only the OS test is affect by this change.

Verified with the getopt() modifications on a modified version of the sim:nsh configuration.
2021-04-03 01:07:34 -05:00
Gregory Nutt
9f65362dd4 OS test: Improve reporting from the dual thread sporadic test
Results were difficult to interpret because the counts during the high priority, budget interval were included with other counts during the low priority interval.  This corrects that reporting by using two counts:  One for the low and one for the high priority interval.  This makes the results much easier to interpret.

There should be no impact to anything other that the sporadic scheduler case of the OS test.

Tested using the the stm32f4discovery:sporadic configration.  That configuration has no yet been merged but is available from incubator-apps PR 3097.
2021-03-19 23:11:35 -07:00
Gregory Nutt
1d3dda49a8 Extend Testing of Sporadic Schedule in OS test
This commit adds the test developed by Jan Staschulat with Issue #incubator_nuttx/2935

It is expected to cause the OS test to fail for the time being since that issue reports a bug.

Tested using the (new) stm32f4discovery:sporadic configuratioin.
2021-03-18 19:57:58 -07:00
ligd
ef0c6b30c4 apps: update mqueue_open usage
As the mqd_t change to int

Change-Id: I16a9c137b6308eeec0badd241a101359e5f751b4
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-01-03 21:23:34 -06:00
ligd
135c5f61e1 testing/ostest/timedmqueue.c: fix nx_style
Change-Id: Ic7ba4f9008164932d3d94da1d09096a0f3e9534b
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-01-03 21:23:34 -06:00
Xiang Xiao
eff52fefcf Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-12-31 12:29:59 -08:00
Xiang Xiao
625832aa59 ostest: Don't assign NULL to mq_t varaibles
change to 0 instead since mq_t mayn't be a pointer

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-12-31 12:29:59 -08:00
YAMAMOTO Takashi
5555d0ae91 testing/ostest/fpu.c: Fix a printf format warning 2020-11-13 05:51:23 -08:00
YAMAMOTO Takashi
916543213f testing/ostest/fpu.c: Appease nxstyle 2020-11-13 05:51:23 -08:00
YAMAMOTO Takashi
10a0764175 testing/ostest/posixtimer.c: Fix printf format warnings 2020-11-13 05:51:23 -08:00
YAMAMOTO Takashi
361615b8b4 testing/ostest/posixtimer.c: Appease nxstyle 2020-11-13 05:51:23 -08:00
YAMAMOTO Takashi
135ee16d6c testing/ostest/sighand.c: Fix printf format warnings 2020-11-13 05:51:23 -08:00
YAMAMOTO Takashi
6f6c452991 testing/ostest/signest.c: Fix a printf warning
error: too many arguments for format [-Werror=format-extra-args]
2020-11-09 04:10:59 -08:00
YAMAMOTO Takashi
0a1825b384 testing/ostest/signest.c: Appease nxstyle 2020-11-09 04:10:59 -08:00
Xiang Xiao
ecae66fe59 Replace all CONFIG_NFILE_STREAMS with CONFIG_FILE_STREAM
follow up the kernel side change

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ic27ad65d7cc2ea570921e0c17098dcb6bfe1893a
2020-09-11 17:57:58 +08:00
Xiang Xiao
deaa6c5b7b build: Replace $(TOPDIR)/Make.defs with $(APPDIR)/Make.defs
and move NUTTXLIB defintion to the common place

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-09 15:17:37 -03:00
qiaowei
d07db1fa5e ostest: fix assert when open CONFIG_SIG_DEFAULT
SIGKILL was captured and call nxsig_abnormal_termination,
which kills the children when SIGCHLD was set. Solution:
change SIGKILL to SIGUSR1.

Signed-off-by: qiaowei <qiaowei@xiaomi.com>
Change-Id: I4a4b06220a28fcf9d50debfd8a3b789fdbdf1976
2020-07-08 00:20:06 +01:00
YAMAMOTO Takashi
faba0249c1 Include malloc.h instead of stdlib.h for mallinfo()
Adapt to the change in the main repo.

mallinfo is meant to be API compatible with Linux,
where it's provided by malloc.h.

(I think the API actually originated with System V. I don't
remember how it was there though. Anyway, I guess the
compatibility with Linux is more important than System V
these days.)
2020-06-15 07:21:52 -06:00
Xiang Xiao
69f013e74e build: Remve the unnecessary .gitignore
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-23 15:56:35 +01:00