Skip to content

Commit

Permalink
Cosmetic: Possibility to customize some RWLock test parameters at bui…
Browse files Browse the repository at this point in the history
…ld time and workflow changes to allow tests passing on a slow Mac VM
  • Loading branch information
oleh-derevenko committed Aug 13, 2023
1 parent be26695 commit e1c6d0d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: bootstrap
run: ./bootstrap
- name: configure
Expand All @@ -27,13 +27,13 @@ jobs:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: packages
run: brew install automake
- name: bootstrap
run: ./bootstrap
- name: configure
run: ./configure CXXFLAGS="-std=c++14 -O3 -g"
run: ./configure CXXFLAGS="-std=c++14 -O3 -g -DMGTEST_RWLOCK_ITERATION_COUNT=100000"
- name: make
run: make
- name: make check
Expand Down
8 changes: 8 additions & 0 deletions test/rwltest.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,19 @@
#include "mgtest_common.h"


#ifndef MGTEST_RWLOCK_TEST_TRYWRLOCK
#define MGTEST_RWLOCK_TEST_TRYWRLOCK 1
#endif
#ifndef MGTEST_RWLOCK_TEST_TRYRDLOCK
#define MGTEST_RWLOCK_TEST_TRYRDLOCK 1
#endif

#ifndef MGTEST_RWLOCK_ITERATION_COUNT
#define MGTEST_RWLOCK_ITERATION_COUNT 1000000
#endif
#ifndef MGTEST_RWLOCK_WRITE_CHANNELS
#define MGTEST_RWLOCK_WRITE_CHANNELS 4
#endif

#define MGTEST_RWLOCK_MINIMAL_READERS_TILL_WP 1
#define MGTEST_RWLOCK_AVERAGE_READERS_TILL_WP 2
Expand Down

0 comments on commit e1c6d0d

Please sign in to comment.