Skip to content

tests: handle cml interactive_sync disabling#13512

Merged
dylad merged 1 commit intoRIOT-OS:masterfrom
fjmolinas:pr_interactive_sync_disable
Mar 2, 2020
Merged

tests: handle cml interactive_sync disabling#13512
dylad merged 1 commit intoRIOT-OS:masterfrom
fjmolinas:pr_interactive_sync_disable

Conversation

@fjmolinas
Copy link
Contributor

Contribution description

If not running the automatic tests then having to enter s on every test can be annoying. This can be easily disable by using DISABLE_MODULE+=test_utils_interactive_sync but this does not work for tests that need to include it directly in the application, add header guards for this.

Testing procedure

  • with interactive sync BOARD=pba-d-01-kw2x make -C tests/ps_schedstatistics/ flash term
2020-02-28 17:56:16,923 # main(): This is RIOT! (Version: 2020.04-devel-828-g5fe86-pr_interactive_sync_disable)
2020-02-28 17:56:16,927 # Help: Press s to start test, r to print it is ready
s
2020-02-28 17:56:20,706 # START
2020-02-28 17:56:20,709 # Creating thread #0, next=1
2020-02-28 17:56:20,711 # Creating thread #1, next=2
2020-02-28 17:56:20,713 # Creating thread #2, next=3
2020-02-28 17:56:20,716 # Creating thread #3, next=4
2020-02-28 17:56:20,718 # Creating thread #4, next=0
> 2020-02-28 17:56:21,718 #  
  • without interactive sync

DISABLE_MODULE+=test_utils_interactive_sync BOARD=pba-d-01-kw2x make -C tests/ps_schedstatistics/ flash term

2020-02-28 17:57:31,251 #  main(): This is RIOT! (Version: 2020.04-devel-828-g5fe86-pr_interactive_sync_disable)
2020-02-28 17:57:31,253 # Creating thread #0, next=1
2020-02-28 17:57:31,255 # Creating thread #1, next=2
2020-02-28 17:57:31,257 # Creating thread #2, next=3
2020-02-28 17:57:31,260 # Creating thread #3, next=4
2020-02-28 17:57:31,262 # Creating thread #4, next=0

In master this would fail since there would be some undefined references.

Issues reference

The is the remaining case of tests/periph_rtc that will be dealt with by #13511

@fjmolinas fjmolinas added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: tests Area: tests and testing framework labels Feb 28, 2020
@fjmolinas fjmolinas requested a review from dylad February 28, 2020 16:59
@benpicco
Copy link
Contributor

Hm why not do

#ifdef MODULE_TEST_UTILS_INTERACTIVE_SYNC
void test_utils_interactive_sync(void);
#else
static inline void test_utils_interactive_sync(void) {}
#endif

in test_utils/interactive_sync.h instead?

If the header file is included test_utils_interactive_sync() will
be defined as an empty function when the module is not used, e.g.
added to DISABLE_MODULES in tests/*
@fjmolinas fjmolinas force-pushed the pr_interactive_sync_disable branch from 5fe8663 to 091ab15 Compare March 2, 2020 07:54
@fjmolinas
Copy link
Contributor Author

in test_utils/interactive_sync.h instead?

Done.

@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Mar 2, 2020
@dylad dylad added Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines Reviewed: 3-testing The PR was tested according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines labels Mar 2, 2020
@dylad dylad added this to the Release 2020.04 milestone Mar 2, 2020
Copy link
Member

@dylad dylad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with the given procedure. Work as expected.
Thanks @fjmolinas, my debugging sessions will be smoother !

@dylad
Copy link
Member

dylad commented Mar 2, 2020

Here we go

@dylad dylad merged commit ee8b837 into RIOT-OS:master Mar 2, 2020
@fjmolinas fjmolinas deleted the pr_interactive_sync_disable branch July 31, 2020 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines Reviewed: 3-testing The PR was tested according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants