libusb / libusb-cmake

CMake build system for libusb
https://github.com/libusb/libusb
GNU Lesser General Public License v2.1
26 stars 12 forks source link

Build/run stress_mt, set_option and init_context tests #9

Closed Youw closed 1 year ago

Youw commented 1 year ago

Relates to: #8

github-actions[bot] commented 1 year ago

Test Results

2 files  ±0  2 suites  ±0   4s :stopwatch: -1s 3 tests +2  3 :heavy_check_mark: +2  0 :zzz: ±0  0 :x: ±0  6 runs  +4  6 :heavy_check_mark: +4  0 :zzz: ±0  0 :x: ±0 

Results for commit f6423a06. ± Comparison against base commit 3adeed6e.

This pull request removes 1 and adds 3 tests. Note that renamed tests count towards both. ``` testlib ‑ testlib ``` ``` init_context ‑ init_context stress ‑ stress stress_mt ‑ stress_mt ```

:recycle: This comment has been updated with latest results.

Youw commented 1 year ago

Interesting why set_option test fails with Exception: SegFault, even though it clearly looks like the failure reason is "no USB devices found". Probably need to investigate/think how to workaround it.

@mcuee any ideas? Do we have somthing like "virtual USB device" on Linux for tests? Or should I disable the test on CI?

mcuee commented 1 year ago

Here is the build log under Linux for libusb git master, using Ubuntu 20.04 Linux.

mcuee@UbuntuSwift3:~/build/libusb/libusb_git$ ./autogen.sh
...
mcuee@UbuntuSwift3:~/build/libusb/libusb_git$ make
make  all-recursive
make[1]: Entering directory '/home/mcuee/build/libusb/libusb_git'
Making all in libusb
make[2]: Entering directory '/home/mcuee/build/libusb/libusb_git/libusb'
  CC       core.lo
  CC       descriptor.lo
  CC       hotplug.lo
  CC       io.lo
  CC       strerror.lo
  CC       sync.lo
  CC       os/events_posix.lo
  CC       os/threads_posix.lo
  CC       os/linux_usbfs.lo
  CC       os/linux_udev.lo
  CCLD     libusb-1.0.la
make[2]: Leaving directory '/home/mcuee/build/libusb/libusb_git/libusb'
Making all in examples
make[2]: Entering directory '/home/mcuee/build/libusb/libusb_git/examples'
  CC       dpfp.o
  CCLD     dpfp
  CC       dpfp_threaded-dpfp.o
  CCLD     dpfp_threaded
  CC       ezusb.o
  CC       fxload.o
  CCLD     fxload
  CC       hotplugtest.o
  CCLD     hotplugtest
  CC       listdevs.o
  CCLD     listdevs
  CC       sam3u_benchmark.o
  CCLD     sam3u_benchmark
  CC       testlibusb.o
  CCLD     testlibusb
  CC       xusb.o
  CCLD     xusb
make[2]: Leaving directory '/home/mcuee/build/libusb/libusb_git/examples'
Making all in tests
make[2]: Entering directory '/home/mcuee/build/libusb/libusb_git/tests'
  CC       stress.o
  CC       testlib.o
  CCLD     stress
  CC       stress_mt.o
  CCLD     stress_mt
  CC       set_option.o
  CCLD     set_option
  CC       init_context.o
  CCLD     init_context
  CC       umockdev-umockdev.o
umockdev.c:37:32: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]
   37 | #pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak"
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~
umockdev.c:38:32: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]
   38 | #pragma GCC diagnostic ignored "-Wanalyzer-file-leak"
      |                                ^~~~~~~~~~~~~~~~~~~~~~
  CCLD     umockdev
make[2]: Leaving directory '/home/mcuee/build/libusb/libusb_git/tests'
make[2]: Entering directory '/home/mcuee/build/libusb/libusb_git'
make[2]: Leaving directory '/home/mcuee/build/libusb/libusb_git'
make[1]: Leaving directory '/home/mcuee/build/libusb/libusb_git'
mcuee@UbuntuSwift3:~/build/libusb/libusb_git$ ls -la ./tests/
total 572
drwxrwxr-x  4 mcuee mcuee   4096 May  8 07:10 .
drwxrwxr-x 14 mcuee mcuee   4096 May  8 07:09 ..
drwxrwxr-x  2 mcuee mcuee   4096 May  8 07:10 .deps
-rwxrwxr-x  1 mcuee mcuee   6361 May  8 07:10 init_context
-rw-rw-r--  1 mcuee mcuee   5304 Apr 13 19:37 init_context.c
-rw-rw-r--  1 mcuee mcuee  33032 May  8 07:10 init_context.o
drwxrwxr-x  2 mcuee mcuee   4096 May  8 07:10 .libs
-rw-rw-r--  1 mcuee mcuee   2414 Nov 13  2021 libusb_testlib.h
-rw-rw-r--  1 mcuee mcuee  23818 May  8 07:09 Makefile
-rw-rw-r--  1 mcuee mcuee    780 Apr 13 19:37 Makefile.am
-rw-rw-r--  1 mcuee mcuee  24061 May  8 07:09 Makefile.in
-rwxrwxr-x  1 mcuee mcuee   6341 May  8 07:10 set_option
-rw-rw-r--  1 mcuee mcuee   9185 Apr 13 19:37 set_option.c
-rw-rw-r--  1 mcuee mcuee  51016 May  8 07:10 set_option.o
-rwxrwxr-x  1 mcuee mcuee   6301 May  8 07:10 stress
-rw-rw-r--  1 mcuee mcuee   4895 Jan 25 08:58 stress.c
-rwxrwxr-x  1 mcuee mcuee   6331 May  8 07:10 stress_mt
-rw-rw-r--  1 mcuee mcuee   4159 Mar 13 19:12 stress_mt.c
-rw-rw-r--  1 mcuee mcuee  23536 May  8 07:10 stress_mt.o
-rw-rw-r--  1 mcuee mcuee  22424 May  8 07:10 stress.o
-rw-rw-r--  1 mcuee mcuee   4735 Nov 13  2021 testlib.c
-rw-rw-r--  1 mcuee mcuee  26144 May  8 07:10 testlib.o
-rwxrwxr-x  1 mcuee mcuee   6321 May  8 07:10 umockdev
-rw-rw-r--  1 mcuee mcuee  36153 Jan 25 08:58 umockdev.c
-rw-rw-r--  1 mcuee mcuee 220480 May  8 07:10 umockdev-umockdev.o
mcuee commented 1 year ago

In order to run umockdev test, you need to intall two packages first: umockdev libumockdev-dev. It is a Linux specific test. Ref: https://github.com/libusb/libusb/blob/master/.private/ci-container-build.sh

mcuee commented 1 year ago

@Youw For set_option, you may have to disable the test for CI.