From aade3a7fb9565a87ad6f2438473c4b5f017bdc4a Mon Sep 17 00:00:00 2001 From: Patrick Baudin <patrick.baudin@cea.fr> Date: Mon, 20 Jan 2020 11:31:20 +0100 Subject: [PATCH] [wp/tests] how to add a test --- src/plugins/wp/tests/README.md | 42 +++++++++++++++++++ .../wp_gallery/oracle_qualif/find.res.oracle | 28 ++++++------- 2 files changed, 54 insertions(+), 16 deletions(-) create mode 100644 src/plugins/wp/tests/README.md diff --git a/src/plugins/wp/tests/README.md b/src/plugins/wp/tests/README.md new file mode 100644 index 00000000000..c88b74cb66d --- /dev/null +++ b/src/plugins/wp/tests/README.md @@ -0,0 +1,42 @@ +# How to add a new test + +``` +cd src/plugins/wp +git add tests/wp_gallery/find.i +``` + +## Update oracle for default configuration + +1. generate oracle files +``` +ptests.opt tests/wp_gallery/find.i -show +ptests.opt tests/wp_gallery/find.i -update +``` + +2. check again (for a final validation) before adding the oracle files +``` +ptests.opt tests/wp_gallery/find.i +git add tests/wp_gallery/oracle/find.* +``` + +## Update oracle for 'qualif' configuration (if there is such) + +1. generate oracle files and updated cache files +``` +FRAMAC_WP_CACHE=update ptests.opt -config qualif tests/wp_gallery/find.i -show +ptests.opt -config qualif tests/wp_gallery/find.i -update +``` + +Note: cleaning the cache is _not_ recommanded when updating or modifying an +existing test; actually it might introduce git merge conflicts that are +annoying to resolve. But the cleaning can be usefull when adding a new test. +It can be done using the command (before those of the step 1): +``` +rm -rf tests/wp_gallery/oracle_qualif/find.[0-9]*.session/cache/ +``` + +2. check again (for a final validation) before adding the oracle and cache files +``` +ptests.opt -config qualif tests/wp_gallery/find.i +git add tests/wp_gallery/oracle_qualif/find.* +``` diff --git a/src/plugins/wp/tests/wp_gallery/oracle_qualif/find.res.oracle b/src/plugins/wp/tests/wp_gallery/oracle_qualif/find.res.oracle index 8f59a81a8f9..f0f68963ee4 100644 --- a/src/plugins/wp/tests/wp_gallery/oracle_qualif/find.res.oracle +++ b/src/plugins/wp/tests/wp_gallery/oracle_qualif/find.res.oracle @@ -48,14 +48,12 @@ [wp] Proved goals: 41 / 41 Qed: 15 Alt-Ergo 2.0.0: 26 -[wp] Report in: 'tests/wp_gallery/oracle_qualif/find.0.report.json' -[wp] Report out: 'tests/wp_gallery/result_qualif/find.0.report.json' -------------------------------------------------------------- -Functions WP Alt-Ergo Total Success -find 7 9 (56..80) 16 100% -find_ptr 6 11 (192..240) 17 100% -iter_ptr 2 6 (72..96) 8 100% -------------------------------------------------------------- +------------------------------------------------------------ + Functions WP Alt-Ergo Total Success + find 7 9 16 100% + find_ptr 6 11 17 100% + iter_ptr 2 6 8 100% +------------------------------------------------------------ [wp] Running WP plugin... [rte] annotating function find [rte] annotating function find_ptr @@ -108,11 +106,9 @@ iter_ptr 2 6 (72..96) 8 100% [wp] Proved goals: 29 / 44 Qed: 0 Alt-Ergo 2.0.0: 29 -[wp] Report in: 'tests/wp_gallery/oracle_qualif/find.0.report.json' -[wp] Report out: 'tests/wp_gallery/result_qualif/find.0.report.json' -------------------------------------------------------------- -Functions WP Alt-Ergo Total Success -find 7 11 (56..80) 18 100% -find_ptr 6 12 (192..240) 18 100% -iter_ptr 2 6 (72..96) 8 100% -------------------------------------------------------------- +------------------------------------------------------------ + Functions WP Alt-Ergo Total Success + find 7 11 18 100% + find_ptr 6 12 18 100% + iter_ptr 2 6 8 100% +------------------------------------------------------------ -- GitLab