@roomi-fields/grillhouse 0.29.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +769 -0
- package/agents/developpeur.md +0 -1
- package/agents/explorateur.md +0 -1
- package/agents/questionneur.md +0 -1
- package/agents/testwriter.md +0 -1
- package/bin/grillhouse.mjs +79 -18
- package/cadre/templates/projet/.github/workflows/ci.yml +2 -13
- package/cadre/templates/projet/CLAUDE.md +5 -1
- package/cadre/templates/projet/docs/agents/issue-tracker.md +1 -1
- package/cadre/templates/projet/package.json +2 -2
- package/charte.md +24 -0
- package/dist/temporal/acte.d.ts +24 -0
- package/dist/temporal/acte.js +139 -0
- package/dist/temporal/acte.js.map +1 -0
- package/dist/temporal/attributs.d.ts +6 -0
- package/dist/temporal/attributs.js +15 -0
- package/dist/temporal/attributs.js.map +1 -0
- package/dist/temporal/circuit/activites.d.ts +13 -0
- package/dist/temporal/circuit/activites.js +33 -0
- package/dist/temporal/circuit/activites.js.map +1 -0
- package/dist/temporal/circuit/client.d.ts +72 -0
- package/dist/temporal/circuit/client.js +247 -0
- package/dist/temporal/circuit/client.js.map +1 -0
- package/dist/temporal/circuit/commande.d.ts +2 -0
- package/dist/temporal/circuit/commande.js +238 -0
- package/dist/temporal/circuit/commande.js.map +1 -0
- package/dist/temporal/circuit/contrat.d.ts +305 -0
- package/dist/temporal/circuit/contrat.js +30 -0
- package/dist/temporal/circuit/contrat.js.map +1 -0
- package/dist/temporal/circuit/deroule.d.ts +3 -0
- package/dist/temporal/circuit/deroule.js +540 -0
- package/dist/temporal/circuit/deroule.js.map +1 -0
- package/dist/temporal/client.d.ts +47 -0
- package/dist/temporal/client.js +69 -0
- package/dist/temporal/client.js.map +1 -0
- package/dist/temporal/commande.d.ts +2 -0
- package/dist/temporal/commande.js +94 -0
- package/dist/temporal/commande.js.map +1 -0
- package/dist/temporal/deroules.d.ts +5 -0
- package/dist/temporal/deroules.js +10 -0
- package/dist/temporal/deroules.js.map +1 -0
- package/dist/temporal/etat.d.ts +33 -0
- package/dist/temporal/etat.js +59 -0
- package/dist/temporal/etat.js.map +1 -0
- package/dist/temporal/file/activites.d.ts +10 -0
- package/dist/temporal/file/activites.js +25 -0
- package/dist/temporal/file/activites.js.map +1 -0
- package/dist/temporal/file/client.d.ts +4 -0
- package/dist/temporal/file/client.js +6 -0
- package/dist/temporal/file/client.js.map +1 -0
- package/dist/temporal/file/contrat.d.ts +158 -0
- package/dist/temporal/file/contrat.js +14 -0
- package/dist/temporal/file/contrat.js.map +1 -0
- package/dist/temporal/file/deroule.d.ts +15 -0
- package/dist/temporal/file/deroule.js +235 -0
- package/dist/temporal/file/deroule.js.map +1 -0
- package/dist/temporal/installation.d.ts +120 -0
- package/dist/temporal/installation.js +386 -0
- package/dist/temporal/installation.js.map +1 -0
- package/dist/temporal/places/activites.d.ts +8 -0
- package/dist/temporal/places/activites.js +13 -0
- package/dist/temporal/places/activites.js.map +1 -0
- package/dist/temporal/places/client.d.ts +28 -0
- package/dist/temporal/places/client.js +64 -0
- package/dist/temporal/places/client.js.map +1 -0
- package/dist/temporal/places/contrat.d.ts +106 -0
- package/dist/temporal/places/contrat.js +21 -0
- package/dist/temporal/places/contrat.js.map +1 -0
- package/dist/temporal/places/deroule.d.ts +3 -0
- package/dist/temporal/places/deroule.js +198 -0
- package/dist/temporal/places/deroule.js.map +1 -0
- package/dist/temporal/sonde/activites.d.ts +6 -0
- package/dist/temporal/sonde/activites.js +52 -0
- package/dist/temporal/sonde/activites.js.map +1 -0
- package/dist/temporal/sonde/contrat.d.ts +35 -0
- package/dist/temporal/sonde/contrat.js +10 -0
- package/dist/temporal/sonde/contrat.js.map +1 -0
- package/dist/temporal/sonde/deroule.d.ts +3 -0
- package/dist/temporal/sonde/deroule.js +39 -0
- package/dist/temporal/sonde/deroule.js.map +1 -0
- package/dist/temporal/tickets/activites.d.ts +7 -0
- package/dist/temporal/tickets/activites.js +81 -0
- package/dist/temporal/tickets/activites.js.map +1 -0
- package/dist/temporal/tickets/client.d.ts +10 -0
- package/dist/temporal/tickets/client.js +31 -0
- package/dist/temporal/tickets/client.js.map +1 -0
- package/dist/temporal/tickets/contrat.d.ts +56 -0
- package/dist/temporal/tickets/contrat.js +13 -0
- package/dist/temporal/tickets/contrat.js.map +1 -0
- package/dist/temporal/tickets/deroule.d.ts +3 -0
- package/dist/temporal/tickets/deroule.js +94 -0
- package/dist/temporal/tickets/deroule.js.map +1 -0
- package/dist/temporal/travailleur.d.ts +2 -0
- package/dist/temporal/travailleur.js +69 -0
- package/dist/temporal/travailleur.js.map +1 -0
- package/docs/ARCHITECTURE.md +646 -87
- package/docs/CADRE.md +27 -0
- package/docs/INTERFACE.md +139 -42
- package/hooks/crochet.mjs +19 -2
- package/hooks/hooks.json +11 -0
- package/package.json +16 -4
- package/scripts/activites.mjs +2255 -0
- package/scripts/aiguillage.d.mts +37 -0
- package/scripts/aiguillage.mjs +40 -14
- package/scripts/avancement.mjs +155 -26
- package/scripts/bilan.mjs +137 -43
- package/scripts/cadre.mjs +16 -4
- package/scripts/circuit.mjs +993 -4075
- package/scripts/circuits-cles.d.mts +4 -0
- package/scripts/circuits-cles.mjs +21 -0
- package/scripts/circuits-du-serveur.mjs +105 -0
- package/scripts/codes-de-sortie.mjs +9 -0
- package/scripts/commandes-composees.mjs +45 -41
- package/scripts/commandes-du-path.d.mts +7 -0
- package/scripts/commandes-du-path.mjs +25 -0
- package/scripts/composants-affectes.mjs +64 -21
- package/scripts/composition-des-langages.mjs +18 -12
- package/scripts/conformite.mjs +56 -28
- package/scripts/copies-finies.mjs +52 -47
- package/scripts/depart-du-ticket.d.mts +53 -0
- package/scripts/depart-du-ticket.mjs +124 -0
- package/scripts/dependances-internes.mjs +121 -0
- package/scripts/dernier-vert.mjs +61 -34
- package/scripts/dette.mjs +32 -11
- package/scripts/donnees-cles.mjs +244 -0
- package/scripts/droits.mjs +51 -16
- package/scripts/effets.mjs +352 -0
- package/scripts/empreinte-d-etape.mjs +17 -0
- package/scripts/engendres.mjs +15 -5
- package/scripts/enveloppe/enveloppe.mjs +259 -55
- package/scripts/enveloppe/lancer.sh +14 -18
- package/scripts/enveloppe/paquets-du-plan.mjs +2 -2
- package/scripts/enveloppe/travail-de-la-copie.mjs +41 -13
- package/scripts/etapes.mjs +5 -2
- package/scripts/faits-du-circuit.mjs +493 -0
- package/scripts/file-des-tickets.d.mts +21 -0
- package/scripts/file-des-tickets.mjs +58 -0
- package/scripts/flux-des-paquets.mjs +201 -0
- package/scripts/gardes-du-cadre.mjs +21 -5
- package/scripts/init.mjs +11 -4
- package/scripts/integration/file.mjs +544 -434
- package/scripts/integration/integrer.mjs +87 -43
- package/scripts/integration/rejeu.mjs +45 -13
- package/scripts/jointure.d.ts +151 -28
- package/scripts/langages/cargo/commandes.mjs +383 -124
- package/scripts/langages/cargo/composants.mjs +154 -42
- package/scripts/langages/cargo/exemples.mjs +12 -21
- package/scripts/langages/cargo/index.mjs +22 -8
- package/scripts/langages/cargo/sccache.mjs +8 -14
- package/scripts/langages/cargo/tests-de-head.mjs +25 -9
- package/scripts/langages/python/commandes.mjs +218 -100
- package/scripts/langages/python/composants.mjs +53 -21
- package/scripts/langages/python/exemples.mjs +6 -16
- package/scripts/langages/python/index.mjs +28 -8
- package/scripts/langages/python/lot.mjs +1 -36
- package/scripts/langages/typescript/chemins-des-tests.mjs +6 -2
- package/scripts/langages/typescript/composants.mjs +9 -3
- package/scripts/langages/typescript/consommateurs-arbitres.mjs +40 -14
- package/scripts/langages/typescript/consommateurs.mjs +39 -14
- package/scripts/langages/typescript/construire.mjs +6 -163
- package/scripts/langages/typescript/elements-du-lot.mjs +36 -12
- package/scripts/langages/typescript/exemples.mjs +3 -11
- package/scripts/langages/typescript/frontieres.mjs +66 -22
- package/scripts/langages/typescript/index-interfaces.mjs +36 -13
- package/scripts/langages/typescript/index.mjs +50 -61
- package/scripts/langages/typescript/interfaces-contre-code.mjs +113 -45
- package/scripts/langages/typescript/lecteurs.mjs +36 -11
- package/scripts/langages/typescript/migrations/0.23.0-config-vitest.mjs +15 -5
- package/scripts/langages/typescript/migrations/0.25.0-chemins-des-tests.mjs +6 -2
- package/scripts/langages/typescript/migrations/0.25.0-tailles-des-tests.mjs +6 -2
- package/scripts/langages/typescript/migrations/0.30.0-prefixe-des-tickets.mjs +63 -0
- package/scripts/langages/typescript/migrations/0.30.0-tailles-des-outils-lourds.mjs +33 -0
- package/scripts/langages/typescript/migrations/0.30.0-titres-nommant-un-ticket.mjs +40 -0
- package/scripts/langages/typescript/mise-a-jour.mjs +1 -2
- package/scripts/langages/typescript/parcours.mjs +12 -4
- package/scripts/langages/typescript/regle-des-tests.mjs +9 -3
- package/scripts/langages/typescript/resumes.mjs +9 -3
- package/scripts/langages/typescript/tailles-des-tests.mjs +93 -20
- package/scripts/langages/typescript/tests-de-nuit.mjs +15 -10
- package/scripts/langages/typescript/tests.mjs +40 -15
- package/scripts/langages/typescript/titres-de-tests.mjs +320 -0
- package/scripts/langages/typescript/turbo-des-paquets.mjs +327 -81
- package/scripts/langages/typescript/verdict.mjs +4 -2
- package/scripts/langages/typescript/verifier.mjs +58 -20
- package/scripts/langages/typescript/vitest-config/avancement.reporter.mjs +15 -5
- package/scripts/langages/typescript/vitest-config/base.mjs +29 -3
- package/scripts/langages/typescript/vitest-config/bornes.mjs +13 -0
- package/scripts/langages/typescript/vitest-config/changements.mjs +21 -8
- package/scripts/langages/typescript/vitest-config/cibles.mjs +36 -14
- package/scripts/langages/typescript/vitest-config/delais.mjs +60 -0
- package/scripts/langages/typescript/vitest-config/delais.setup.mjs +11 -0
- package/scripts/langages/typescript/vitest-config/duree.classement.mjs +108 -0
- package/scripts/langages/typescript/vitest-config/duree.reporter.mjs +56 -59
- package/scripts/langages/typescript/vitest-config/lances.mjs +83 -27
- package/scripts/langages/typescript/vitest-config/machine.setup.mjs +10 -0
- package/scripts/langages/typescript/vitest-config/resultats.mjs +3 -1
- package/scripts/langages/typescript/vitest.nuit.config.mjs +4 -0
- package/scripts/lint-des-scripts.mjs +58 -0
- package/scripts/mesure/base-de-passe.mjs +117 -25
- package/scripts/mesure/pression.mjs +12 -6
- package/scripts/mesure-de-la-machine.d.mts +21 -0
- package/scripts/mesure-de-la-machine.mjs +76 -0
- package/scripts/migrations/0.23.0-charte-importee.mjs +6 -2
- package/scripts/migrations/0.23.0-crochets-de-seance.mjs +25 -8
- package/scripts/migrations/0.23.0-marche-du-projet.mjs +18 -6
- package/scripts/migrations/0.23.2-copies-du-cadre.mjs +56 -18
- package/scripts/migrations/0.24.12-tri-des-decouvertes.mjs +6 -2
- package/scripts/migrations/0.25.0-script-des-tests.mjs +15 -5
- package/scripts/migrations/0.30.0-ci-appelle-la-verification.mjs +124 -0
- package/scripts/migrations/0.31.0-paquets-dans-le-graphe.mjs +81 -0
- package/scripts/migrations.mjs +5 -0
- package/scripts/nuit.sh +25 -3
- package/scripts/outil.mjs +3 -1
- package/scripts/outils-cles.d.mts +24 -0
- package/scripts/outils-cles.mjs +18 -8
- package/scripts/paquet-npm.mjs +157 -0
- package/scripts/paquet.mjs +73 -4
- package/scripts/paquets.mjs +46 -10
- package/scripts/passe-de-la-machine.mjs +71 -0
- package/scripts/places-de-la-machine.mjs +414 -0
- package/scripts/places-du-serveur.mjs +170 -0
- package/scripts/prefixe-des-tickets.mjs +68 -0
- package/scripts/preparation.mjs +25 -8
- package/scripts/registre.mjs +9 -4
- package/scripts/regles-des-places.d.mts +36 -0
- package/scripts/regles-des-places.mjs +70 -0
- package/scripts/reponses-du-circuit.d.mts +6 -0
- package/scripts/reponses-du-circuit.mjs +28 -0
- package/scripts/reprise.mjs +66 -0
- package/scripts/resultats.mjs +112 -46
- package/scripts/retirer-les-copies-finies.mjs +25 -0
- package/scripts/sans-reponse.d.mts +4 -0
- package/scripts/sans-reponse.mjs +13 -0
- package/scripts/seances.mjs +936 -0
- package/scripts/services-du-noyau.mjs +27 -8
- package/scripts/session-start.sh +2 -2
- package/scripts/sortie.mjs +3 -3
- package/scripts/sous-commandes.mjs +41 -10
- package/scripts/style-a-l-ecriture.mjs +260 -0
- package/scripts/superviseur.mjs +122 -111
- package/scripts/tableau.mjs +180 -117
- package/scripts/taches-du-graphe.mjs +348 -0
- package/scripts/ticket-du-circuit.mjs +216 -0
- package/scripts/transitions.d.mts +148 -0
- package/scripts/transitions.mjs +1018 -0
- package/scripts/verrou-de-fichier.mjs +8 -4
- package/scripts/verrou-de-machine.mjs +150 -51
- package/scripts/verrous/commande.mjs +50 -17
- package/scripts/verrous/ticket-du-sous-agent.mjs +9 -3
- package/scripts/verrous/verrou.mjs +42 -14
- package/skills/explorateur/SKILL.md +9 -2
- package/skills/grill/SKILL.md +1 -1
- package/skills/mesure/SKILL.md +3 -0
- package/skills/pitmaster/SKILL.md +17 -18
- package/skills/pitmaster/references/consigne-agent.md +5 -1
- package/skills/release/SKILL.md +3 -3
- package/skills/relecteur/SKILL.md +5 -3
- package/skills/testwriter/SKILL.md +49 -31
- package/scripts/demon.mjs +0 -251
- package/scripts/integration/file-attente.mjs +0 -61
- package/scripts/langages/cargo/touches.mjs +0 -93
- package/scripts/langages/typescript/script-des-tests.mjs +0 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// The components of a workspace of cargo, as cargo itself describes them (`cargo metadata
|
|
2
2
|
// --format-version 1 --no-deps --offline`): the crates the module cargo answers the join with
|
|
3
3
|
// (scripts/jointure.d.ts, `composants`, `composantDe`, `matieres`, `joueDesTests`, `lecteurs`,
|
|
4
|
-
// `estUnTest`, `
|
|
4
|
+
// `estUnTest`, `arbreDAvant`, `testsDeHead`).
|
|
5
5
|
//
|
|
6
6
|
// - A component is a member of the workspace (`workspace_members`): its folder, the manifest's;
|
|
7
7
|
// its name and its package, the crate's name. A directory without a Cargo.toml at its root holds
|
|
@@ -29,12 +29,13 @@
|
|
|
29
29
|
// `tests.rs` under `src/`, and any file of a folder `tests/` under `src/`, is a unit test file,
|
|
30
30
|
// played with its crate when it is Rust; a file of a crate of the shared test material is
|
|
31
31
|
// material; any other file of a crate (the code of `src/`) is none of them.
|
|
32
|
-
// -
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
// unit test of `src/`, whose names of tests HEAD's version holds
|
|
36
|
-
// (`testsDeHead`, ./tests-de-head.mjs), the proof holding each for
|
|
37
|
-
// a target `tests/<nom>.rs` too, when its
|
|
32
|
+
// - HEAD's version of a test file plays in a tree of its own (`arbreDAvant`), never beside the
|
|
33
|
+
// file: a target `tests/<nom>.rs`, a target cargo finds by itself, its tree the copy's with that
|
|
34
|
+
// file replaced, built in the cargo target directory of the copy (`envDArbre`); none for
|
|
35
|
+
// `tests/<dossier>/main.rs` nor a unit test of `src/`, whose names of tests HEAD's version holds
|
|
36
|
+
// are read without playing them (`testsDeHead`, ./tests-de-head.mjs), the proof holding each for
|
|
37
|
+
// a green HEAD holds; those of a target `tests/<nom>.rs` too, when its tree no longer compiles
|
|
38
|
+
// (grillhouse-3e2.2).
|
|
38
39
|
// - What the testwriter writes of the manifests (`manifestes`): the tables that declare what the
|
|
39
40
|
// tests of a crate depend on, `[dev-dependencies]` and `[target.<cible>.dev-dependencies]` of
|
|
40
41
|
// its Cargo.toml (cargo's book, « Development dependencies »), as the author of a test of Bazel
|
|
@@ -48,7 +49,7 @@
|
|
|
48
49
|
// when a manifest is judged, so that a project of another language, which loads this module
|
|
49
50
|
// without it, never needs it.
|
|
50
51
|
import { spawnSync } from 'node:child_process';
|
|
51
|
-
import { existsSync, readdirSync, statSync } from 'node:fs';
|
|
52
|
+
import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
|
|
52
53
|
import { createRequire } from 'node:module';
|
|
53
54
|
import path from 'node:path';
|
|
54
55
|
import { isDeepStrictEqual } from 'node:util';
|
|
@@ -270,16 +271,15 @@ export const DE_NUIT = '_nuit';
|
|
|
270
271
|
export const BANC = '_budget';
|
|
271
272
|
|
|
272
273
|
/**
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
*
|
|
280
|
-
* its crate's module.
|
|
274
|
+
* Whether HEAD's version of the test file <chemin> (from the root <racine>) plays in a tree of its
|
|
275
|
+
* own, in the same proof as the lot's: a test target `tests/<nom>.rs`, a target cargo finds by
|
|
276
|
+
* itself (`autotests`), its `mod` of the same folder read as the file's; false for any other
|
|
277
|
+
* file: a target `tests/<dossier>/main.rs` holds its modules beside it, and a unit test of
|
|
278
|
+
* `src/` is compiled in its crate's module (`testsDeHead` reads their names).
|
|
279
|
+
* @param {string} chemin
|
|
280
|
+
* @param {string} racine
|
|
281
281
|
*/
|
|
282
|
-
export function
|
|
282
|
+
export function arbreDAvant(chemin, racine) {
|
|
283
283
|
const abs = path.resolve(racine, chemin);
|
|
284
284
|
const c = composantDans(
|
|
285
285
|
crates(racine).map(x => x.composant),
|
|
@@ -287,30 +287,45 @@ export function soeurDAvant(chemin, racine) {
|
|
|
287
287
|
abs
|
|
288
288
|
);
|
|
289
289
|
const parts = c ? path.relative(c.dossier, abs).split(path.sep) : [];
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
290
|
+
return parts.length === 2 && parts[0] === 'tests' && parts[1].endsWith('.rs');
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/** The variable that names, to the launcher, the copy whose git tracks the `Cargo.lock` of a tree. */
|
|
294
|
+
export const COPIE_DE_L_ARBRE = 'GRILLHOUSE_COPIE_DE_L_ARBRE';
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* The environment a tree of HEAD's version plays under: the target directory of the copy's
|
|
298
|
+
* compilations, so that the tree builds there, whatever its place (`cibleDeCompilation`
|
|
299
|
+
* (./sccache.mjs) for a copy in the temporary directory, its `target/` otherwise; the caller's
|
|
300
|
+
* own `CARGO_TARGET_DIR` stays), and the copy itself (`COPIE_DE_L_ARBRE`), where git tracks the
|
|
301
|
+
* `Cargo.lock` the tree, which has no `.git`, carries.
|
|
302
|
+
* @param {string} _chemin
|
|
303
|
+
* @param {string} racine
|
|
304
|
+
* @returns {NodeJS.ProcessEnv}
|
|
305
|
+
*/
|
|
306
|
+
export function envDArbre(_chemin, racine) {
|
|
307
|
+
const cible = cibleDeCompilation(racine, process.env, { creer: false });
|
|
308
|
+
return {
|
|
309
|
+
...(process.env.CARGO_TARGET_DIR || cible.CARGO_TARGET_DIR
|
|
310
|
+
? cible
|
|
311
|
+
: { CARGO_TARGET_DIR: path.join(racine, 'target') }),
|
|
312
|
+
[COPIE_DE_L_ARBRE]: racine,
|
|
313
|
+
};
|
|
297
314
|
}
|
|
298
315
|
|
|
299
316
|
/**
|
|
300
317
|
* The names of the tests of HEAD's version of the test file <chemin> (from the root <racine>),
|
|
301
|
-
* read without playing them, for a file
|
|
302
|
-
*
|
|
303
|
-
* `
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
* from the root. Null for any other file, or one HEAD does not hold.
|
|
318
|
+
* read without playing them, for a file whose tree the proof does not play: a unit test file of
|
|
319
|
+
* `src/` (`tests.rs`, a file of a folder `tests/` under `src/`, out of `src/bin/`) and a target
|
|
320
|
+
* `tests/<dossier>/main.rs` (./tests-de-head.mjs), and a target `tests/<nom>.rs`, whose tree the
|
|
321
|
+
* proof plays unless it no longer compiles (grillhouse-3e2.2): its names as nextest gives them,
|
|
322
|
+
* without the target, its out-of-line modules read (`mod common;`, `common::<fn>`). <lire> gives
|
|
323
|
+
* HEAD's text of a file from the root. Null for any other file, or one HEAD does not hold.
|
|
308
324
|
* @param {string} chemin
|
|
309
325
|
* @param {string} racine
|
|
310
326
|
* @param {(f: string) => string | null} lire
|
|
311
|
-
* @param {{ sansSoeur?: boolean }} [options]
|
|
312
327
|
*/
|
|
313
|
-
export function testsDeHead(chemin, racine, lire
|
|
328
|
+
export function testsDeHead(chemin, racine, lire) {
|
|
314
329
|
const abs = path.resolve(racine, chemin);
|
|
315
330
|
const c = composantDans(
|
|
316
331
|
crates(racine).map(x => x.composant),
|
|
@@ -324,7 +339,7 @@ export function testsDeHead(chemin, racine, lire, { sansSoeur = false } = {}) {
|
|
|
324
339
|
if (parts.length === 3 && parts[0] === 'tests' && parts[2] === 'main.rs') {
|
|
325
340
|
return nomsDeHead(chemin, null, lire);
|
|
326
341
|
}
|
|
327
|
-
if (
|
|
342
|
+
if (arbreDAvant(chemin, racine)) {
|
|
328
343
|
return nomsDeHead(chemin, null, lire);
|
|
329
344
|
}
|
|
330
345
|
if (!unitaire(parts) || parts[1] === 'bin') {
|
|
@@ -350,7 +365,9 @@ function partiesHors(a, b) {
|
|
|
350
365
|
const cles = (x, y) => [...new Set([...Object.keys(x), ...Object.keys(y)])].sort();
|
|
351
366
|
const out = [];
|
|
352
367
|
for (const k of cles(a, b)) {
|
|
353
|
-
if (k === DES_TESTS || isDeepStrictEqual(a[k], b[k]))
|
|
368
|
+
if (k === DES_TESTS || isDeepStrictEqual(a[k], b[k])) {
|
|
369
|
+
continue;
|
|
370
|
+
}
|
|
354
371
|
if (k !== 'target') {
|
|
355
372
|
const tableau = [a[k], b[k]].some(v => v !== null && typeof v === 'object');
|
|
356
373
|
out.push(tableau ? `[${k}]` : k);
|
|
@@ -360,7 +377,9 @@ function partiesHors(a, b) {
|
|
|
360
377
|
for (const c of cles(ta, tb)) {
|
|
361
378
|
const [ca, cb] = [table(ta[c]), table(tb[c])];
|
|
362
379
|
for (const s of cles(ca, cb)) {
|
|
363
|
-
if (s !== DES_TESTS && !isDeepStrictEqual(ca[s], cb[s]))
|
|
380
|
+
if (s !== DES_TESTS && !isDeepStrictEqual(ca[s], cb[s])) {
|
|
381
|
+
out.push(`[target.${c}.${s}]`);
|
|
382
|
+
}
|
|
364
383
|
}
|
|
365
384
|
}
|
|
366
385
|
}
|
|
@@ -400,7 +419,9 @@ function finDuLexeme(texte, i) {
|
|
|
400
419
|
j++;
|
|
401
420
|
} else if (texte.startsWith('*/', j)) {
|
|
402
421
|
j++;
|
|
403
|
-
if (--profondeur === 0)
|
|
422
|
+
if (--profondeur === 0) {
|
|
423
|
+
return j + 1;
|
|
424
|
+
}
|
|
404
425
|
}
|
|
405
426
|
}
|
|
406
427
|
return texte.length;
|
|
@@ -408,8 +429,12 @@ function finDuLexeme(texte, i) {
|
|
|
408
429
|
for (const re of [BRUTE, CHAINE, CARACTERE]) {
|
|
409
430
|
re.lastIndex = i;
|
|
410
431
|
const m = re.exec(texte);
|
|
411
|
-
if (!m)
|
|
412
|
-
|
|
432
|
+
if (!m) {
|
|
433
|
+
continue;
|
|
434
|
+
}
|
|
435
|
+
if (re !== BRUTE) {
|
|
436
|
+
return m.index + m[0].length;
|
|
437
|
+
}
|
|
413
438
|
const fin = texte.indexOf(`"${m[1]}`, i + m[0].length);
|
|
414
439
|
return fin < 0 ? texte.length : fin + 1 + m[1].length;
|
|
415
440
|
}
|
|
@@ -491,8 +516,12 @@ function horsDesTests(chemin, racine, avant, apres) {
|
|
|
491
516
|
const parts = c ? path.relative(c.dossier, abs).split(path.sep) : [];
|
|
492
517
|
return parts[0] === 'src' && !unitaire(parts) ? codeHorsDuModuleDeTest(avant, apres) : null;
|
|
493
518
|
}
|
|
494
|
-
if (path.basename(abs) !== 'Cargo.toml')
|
|
495
|
-
|
|
519
|
+
if (path.basename(abs) !== 'Cargo.toml') {
|
|
520
|
+
return null;
|
|
521
|
+
}
|
|
522
|
+
if (!tous.some(c => path.join(c.composant.dossier, 'Cargo.toml') === abs)) {
|
|
523
|
+
return null;
|
|
524
|
+
}
|
|
496
525
|
const { parse } = require('smol-toml');
|
|
497
526
|
const lire = texte => {
|
|
498
527
|
try {
|
|
@@ -502,9 +531,92 @@ function horsDesTests(chemin, racine, avant, apres) {
|
|
|
502
531
|
}
|
|
503
532
|
};
|
|
504
533
|
const [a, b] = [lire(avant), lire(apres)];
|
|
505
|
-
if (a.faute || b.faute)
|
|
534
|
+
if (a.faute || b.faute) {
|
|
535
|
+
return [a.faute ?? b.faute];
|
|
536
|
+
}
|
|
506
537
|
return partiesHors(a.valeur, b.valeur);
|
|
507
538
|
}
|
|
508
539
|
|
|
509
540
|
/** What the testwriter writes of the manifests (scripts/jointure.d.ts, `manifestes`). */
|
|
510
541
|
export const manifestes = { verrous: ['Cargo.lock'], horsDesTests };
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* The name a Cargo.toml <texte> gives its package: the `name` of its `[package]`; null for none.
|
|
545
|
+
* @param {string} texte
|
|
546
|
+
*/
|
|
547
|
+
export function nomDuManifeste(texte) {
|
|
548
|
+
let section = null;
|
|
549
|
+
for (const l of texte.split('\n')) {
|
|
550
|
+
const s = /^\s*\[([^\]]+)\]\s*(?:#.*)?$/.exec(l);
|
|
551
|
+
if (s) {
|
|
552
|
+
section = s[1].trim();
|
|
553
|
+
continue;
|
|
554
|
+
}
|
|
555
|
+
const n = /^\s*name\s*=\s*["']([^"']+)["']/.exec(l);
|
|
556
|
+
if (section === 'package' && n) {
|
|
557
|
+
return n[1];
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
return null;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
const TABLES = ['dependencies', 'dev-dependencies', 'build-dependencies'];
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* The absolute path of the binary <sortie> of the crate at <chemin> (from the root of the workspace
|
|
567
|
+
* at <racine>): a target of kind `bin` of `cargo metadata`, in its target directory, under
|
|
568
|
+
* `release` or `debug`. Throws, named, for a folder that holds no crate and for a crate without
|
|
569
|
+
* that binary.
|
|
570
|
+
* @param {string} racine
|
|
571
|
+
* @param {string} chemin
|
|
572
|
+
* @param {string} sortie
|
|
573
|
+
* @param {{ release?: boolean }} [o]
|
|
574
|
+
*/
|
|
575
|
+
export function sortieDuPaquet(racine, chemin, sortie, { release = false } = {}) {
|
|
576
|
+
const m = metadonnees(racine);
|
|
577
|
+
const crate = m?.packages.find(
|
|
578
|
+
p => path.relative(m.workspace_root, path.dirname(p.manifest_path)) === path.normalize(chemin)
|
|
579
|
+
);
|
|
580
|
+
if (!crate) {
|
|
581
|
+
throw new Error(`${chemin} ne tient aucun crate du dépôt.`);
|
|
582
|
+
}
|
|
583
|
+
const binaires = crate.targets.filter(t => t.kind.includes('bin')).map(t => t.name);
|
|
584
|
+
if (!binaires.includes(sortie)) {
|
|
585
|
+
throw new Error(
|
|
586
|
+
`le crate ${crate.name} ne produit pas de binaire « ${sortie} » (ses binaires : ${binaires.join(', ') || 'aucun'}).`
|
|
587
|
+
);
|
|
588
|
+
}
|
|
589
|
+
return path.join(m.target_directory, release ? 'release' : 'debug', sortie);
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
/**
|
|
593
|
+
* The internal dependencies of the crate at <chemin> (from <racine>): each dependency with a
|
|
594
|
+
* `path` (in `[dependencies]`, `[dev-dependencies]`, `[build-dependencies]` and the same under
|
|
595
|
+
* `[target.*]`; a `workspace = true` one takes the `path` of `[workspace.dependencies]` of the
|
|
596
|
+
* root Cargo.toml), named by <nomA> of the folder at that path, else by its key.
|
|
597
|
+
* @param {string} racine
|
|
598
|
+
* @param {string} chemin
|
|
599
|
+
* @param {(dossier: string) => string | null} nomA
|
|
600
|
+
*/
|
|
601
|
+
export function liensDuManifeste(racine, chemin, nomA) {
|
|
602
|
+
const { parse } = require('smol-toml');
|
|
603
|
+
const lire = f => (existsSync(f) ? parse(readFileSync(f, 'utf8')) : null);
|
|
604
|
+
const dossier = path.join(racine, chemin);
|
|
605
|
+
const m = lire(path.join(dossier, 'Cargo.toml')) ?? {};
|
|
606
|
+
const communes = lire(path.join(racine, 'Cargo.toml'))?.workspace?.dependencies ?? {};
|
|
607
|
+
const noms = new Set();
|
|
608
|
+
const tables = [
|
|
609
|
+
...TABLES.map(t => m[t]),
|
|
610
|
+
...Object.values(m.target ?? {}).flatMap(c => TABLES.map(t => c?.[t])),
|
|
611
|
+
];
|
|
612
|
+
for (const table of tables) {
|
|
613
|
+
for (const [cle, spec] of Object.entries(table ?? {})) {
|
|
614
|
+
const commune = spec?.workspace === true;
|
|
615
|
+
const lien = commune ? communes[cle]?.path : spec?.path;
|
|
616
|
+
if (typeof lien === 'string') {
|
|
617
|
+
noms.add(nomA(path.resolve(commune ? racine : dossier, lien)) ?? cle);
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
return { noms: [...noms], table: 'path', outil: 'cargo' };
|
|
622
|
+
}
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
// `ws-outil`, which depends on `ws-app` for its tests (`dev`) and on `ws-core` for its build
|
|
9
9
|
// script (`build`); `ws-matiere`, the shared test material (`[package.metadata.grillhouse]
|
|
10
10
|
// matiere = true`); the interfaces of `ws-core`, of `ws-app` and of the root, and the index of the
|
|
11
|
-
// interfaces they give, up to date (grillhouse-pkl.6). Committed: `espace`; the same
|
|
12
|
-
// out of every crate added: `change`, measured from its commit; the same with a second commit
|
|
11
|
+
// interfaces they give, up to date (grillhouse-pkl.6). Committed: `espace`; the same with a second commit
|
|
13
12
|
// that changes `ws-core`, adds the crate `ws-neuf` and removes `ws-outil`: `lot`; the same, the
|
|
14
13
|
// interface of `ws-core` then changed, its index late: `enRetard`.
|
|
15
14
|
// - Each workspace commits its Cargo.lock, the one cargo writes (grillhouse-rph): the commands
|
|
@@ -124,6 +123,12 @@ function espace(dans) {
|
|
|
124
123
|
ecrire('Cargo.lock', verrou(Object.entries(DEPENDANCES)));
|
|
125
124
|
ecrire('.gitignore', '/target\n');
|
|
126
125
|
ecrire('README.md', "# L'espace d'essai\n");
|
|
126
|
+
ecrire(
|
|
127
|
+
'docs/ARCHITECTURE.md',
|
|
128
|
+
`# Architecture\n\n| Composant | Langage |\n| --- | --- |\n${Object.keys(CRATES)
|
|
129
|
+
.map(n => `| \`crates/${n}\` | cargo |\n`)
|
|
130
|
+
.join('')}`
|
|
131
|
+
);
|
|
127
132
|
for (const [n, m] of Object.entries(CRATES)) {
|
|
128
133
|
ecrire(`crates/${n}/Cargo.toml`, m);
|
|
129
134
|
ecrire(`crates/${n}/src/lib.rs`, `pub fn ${n}() -> i32 {\n 1\n}\n`);
|
|
@@ -245,13 +250,6 @@ export default {
|
|
|
245
250
|
'crates/aide/Cargo.toml': manifeste('aide'),
|
|
246
251
|
'crates/aide/src/lib.rs': 'pub fn aide() {}\n',
|
|
247
252
|
});
|
|
248
|
-
const change = espace(dans);
|
|
249
|
-
const depuis = tete(change);
|
|
250
|
-
writeFileSync(
|
|
251
|
-
path.join(change, 'crates/core/src/lib.rs'),
|
|
252
|
-
'pub fn core() -> i32 {\n 2\n}\n'
|
|
253
|
-
);
|
|
254
|
-
writeFileSync(path.join(change, 'notes.txt'), 'hors des crates\n');
|
|
255
253
|
const lot = espace(dans);
|
|
256
254
|
const avantLeLot = tete(lot);
|
|
257
255
|
const ecrireLot = ecrireDans(lot);
|
|
@@ -283,8 +281,6 @@ export default {
|
|
|
283
281
|
espace: aJour,
|
|
284
282
|
seul,
|
|
285
283
|
imbrique,
|
|
286
|
-
change,
|
|
287
|
-
depuis,
|
|
288
284
|
lot,
|
|
289
285
|
avantLeLot,
|
|
290
286
|
enRetard,
|
|
@@ -319,11 +315,6 @@ export default {
|
|
|
319
315
|
'ws-absent : sans fournisseur',
|
|
320
316
|
],
|
|
321
317
|
},
|
|
322
|
-
touches: {
|
|
323
|
-
valide: { racine: aJour, depuis: 'HEAD' },
|
|
324
|
-
invalide: { racine: change, depuis },
|
|
325
|
-
attendu: ['touché ws-core', 'dépendant ws-app', 'dépendant ws-outil', 'hors notes.txt'],
|
|
326
|
-
},
|
|
327
318
|
commandes: {
|
|
328
319
|
valide: ['tester', 'verifier', 'typer', 'preparer'],
|
|
329
320
|
invalide: ['tester', 'deployer'],
|
|
@@ -382,12 +373,12 @@ export default {
|
|
|
382
373
|
'crates/core/tests/scenario/main.rs',
|
|
383
374
|
'Cargo.toml',
|
|
384
375
|
],
|
|
385
|
-
// A night test and a bench
|
|
376
|
+
// A target, a night test and a bench play in a tree, under their own name.
|
|
386
377
|
invalide: [
|
|
387
378
|
'crates/core/tests/t.rs',
|
|
388
379
|
'crates/core/tests/t_nuit.rs',
|
|
389
380
|
'crates/core/tests/t_budget.rs',
|
|
390
|
-
// A unit test of `src/` and a target `tests/<dossier>/main.rs` have no
|
|
381
|
+
// A unit test of `src/` and a target `tests/<dossier>/main.rs` have no tree: the
|
|
391
382
|
// names of HEAD's tests are read, as nextest reports them (its module path), the
|
|
392
383
|
// braces of a comment, a string or a character not counted, a `mod` of main.rs read.
|
|
393
384
|
{
|
|
@@ -403,9 +394,9 @@ export default {
|
|
|
403
394
|
},
|
|
404
395
|
],
|
|
405
396
|
attendu: [
|
|
406
|
-
'crates/core/tests/t.rs →
|
|
407
|
-
'crates/core/tests/t_nuit.rs →
|
|
408
|
-
'crates/core/tests/t_budget.rs →
|
|
397
|
+
'crates/core/tests/t.rs → un arbre',
|
|
398
|
+
'crates/core/tests/t_nuit.rs → un arbre',
|
|
399
|
+
'crates/core/tests/t_budget.rs → un arbre',
|
|
409
400
|
'crates/core/src/rendu/tests.rs : rendu::tests::ancien, rendu::tests::groupe::interne',
|
|
410
401
|
'crates/core/tests/scenario/main.rs : principal, m::dedans, aide::aidant',
|
|
411
402
|
],
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
// - The components, a file's, the shared test material, the components that play tests, the
|
|
16
16
|
// readers of a crate, the rule of a test file and what the testwriter writes of the manifests
|
|
17
17
|
// (./composants.mjs).
|
|
18
|
-
// - The crates touched since a commit and their dependents (./touches.mjs).
|
|
19
18
|
// - The elements of a lot, one per crate (./elements-du-lot.mjs).
|
|
20
|
-
// - The commands `tester
|
|
19
|
+
// - The commands `tester` (the crates' tasks of Turborepo), `tests-du-paquet` (the body of a crate's
|
|
20
|
+
// task), `verifier`, `typer`, `preparer` and `tests-de-nuit` (./commandes.mjs),
|
|
21
21
|
// each described, `{ script, args }`, never run, `preparer` played by the integration before the
|
|
22
22
|
// verification, `tests-de-nuit` by the night (the test targets `tests/*_nuit.rs`, then the time
|
|
23
23
|
// budget benches `tests/*_budget.rs`, which the day leaves out);
|
|
24
24
|
// the verdict of a run (./verdict.mjs). The tool of a test's temporary directory, the crate
|
|
25
|
-
// `tempfile`, and its guard: `
|
|
25
|
+
// `tempfile`, and its guard: `tests-du-paquet` and `verifier` play under a base of their pass, named in
|
|
26
26
|
// TMPDIR, TMP and TEMP, and fail naming what the tests left there (./commandes.mjs).
|
|
27
27
|
// - The generated file, the index of the interfaces (./index-interfaces.mjs), its command and its
|
|
28
28
|
// check; the guards of structure, in the order they play: the sizes of the tests
|
|
@@ -38,17 +38,22 @@
|
|
|
38
38
|
import { readFileSync } from 'node:fs';
|
|
39
39
|
import path from 'node:path';
|
|
40
40
|
import { fileURLToPath } from 'node:url';
|
|
41
|
-
import {
|
|
41
|
+
import { empreintesDesTaches } from '../../services-du-noyau.mjs';
|
|
42
|
+
import { commandes, fichierHorsDuJour, GARDES } from './commandes.mjs';
|
|
42
43
|
import {
|
|
43
44
|
composantDans,
|
|
44
45
|
composants,
|
|
45
46
|
estUnTest,
|
|
46
|
-
|
|
47
|
+
arbreDAvant,
|
|
48
|
+
envDArbre,
|
|
47
49
|
testsDeHead,
|
|
48
50
|
joueDesTests,
|
|
49
51
|
lecteurs,
|
|
52
|
+
liensDuManifeste,
|
|
50
53
|
manifestes,
|
|
51
54
|
matieres,
|
|
55
|
+
nomDuManifeste,
|
|
56
|
+
sortieDuPaquet,
|
|
52
57
|
} from './composants.mjs';
|
|
53
58
|
import { elementsDuLot } from './elements-du-lot.mjs';
|
|
54
59
|
import { enRetard, entreesDeLIndex, SORTIE } from './index-interfaces.mjs';
|
|
@@ -56,7 +61,6 @@ import { miseAJour } from './mise-a-jour.mjs';
|
|
|
56
61
|
import * as taillesDesTests from './migrations/0.28.4-tailles-des-tests.mjs';
|
|
57
62
|
import { squelette } from './squelette.mjs';
|
|
58
63
|
import { CACHE, CIBLES } from './sccache.mjs';
|
|
59
|
-
import { touches } from './touches.mjs';
|
|
60
64
|
import { verdict } from './verdict.mjs';
|
|
61
65
|
|
|
62
66
|
// The scripts of this module, beside this file.
|
|
@@ -65,6 +69,12 @@ const ici = nom => path.join(path.dirname(fileURLToPath(import.meta.url)), nom);
|
|
|
65
69
|
export default {
|
|
66
70
|
nom: 'cargo',
|
|
67
71
|
manifeste: 'Cargo.toml',
|
|
72
|
+
nomDuManifeste,
|
|
73
|
+
liensDuManifeste,
|
|
74
|
+
sortieDuPaquet,
|
|
75
|
+
construireLesPaquets: () => {
|
|
76
|
+
throw new Error('construction non prise en charge pour cargo');
|
|
77
|
+
},
|
|
68
78
|
// The reader of TOML by which the lock judges a Cargo.toml (./composants.mjs, `manifestes`).
|
|
69
79
|
outils: ['smol-toml'],
|
|
70
80
|
// The binaries the module runs, each at an exact version: nextest and cargo-deny at the ones the
|
|
@@ -110,12 +120,16 @@ export default {
|
|
|
110
120
|
matieres,
|
|
111
121
|
joueDesTests,
|
|
112
122
|
lecteurs,
|
|
113
|
-
touches,
|
|
114
123
|
elementsDuLot,
|
|
124
|
+
// The hashes of the inputs of the tests tasks of the crates and their dependents, as
|
|
125
|
+
// Turborepo plans them.
|
|
126
|
+
empreintes: (racine, noms) => empreintesDesTaches('turbo', racine, noms),
|
|
115
127
|
commandes,
|
|
116
128
|
verdict,
|
|
117
129
|
estUnTest,
|
|
118
|
-
|
|
130
|
+
horsDuJour: fichierHorsDuJour,
|
|
131
|
+
arbreDAvant,
|
|
132
|
+
envDArbre,
|
|
119
133
|
testsDeHead,
|
|
120
134
|
manifestes,
|
|
121
135
|
fichiersEngendres: () => [
|
|
@@ -49,11 +49,16 @@
|
|
|
49
49
|
// error of cargo that cannot run its wrapper.
|
|
50
50
|
import { spawnSync } from 'node:child_process';
|
|
51
51
|
import { createHash } from 'node:crypto';
|
|
52
|
-
import {
|
|
52
|
+
import { readFileSync, readlinkSync, realpathSync } from 'node:fs';
|
|
53
53
|
import { createRequire } from 'node:module';
|
|
54
54
|
import { homedir } from 'node:os';
|
|
55
55
|
import path from 'node:path';
|
|
56
|
-
import {
|
|
56
|
+
import {
|
|
57
|
+
cacheDeCompilation,
|
|
58
|
+
cacheDeLaRacine,
|
|
59
|
+
dansLeTemporaire,
|
|
60
|
+
trouverDansLePath,
|
|
61
|
+
} from '../../services-du-noyau.mjs';
|
|
57
62
|
|
|
58
63
|
// The loader of smol-toml, an optional peer of the package, a tool of this module.
|
|
59
64
|
const require = createRequire(import.meta.url);
|
|
@@ -140,18 +145,7 @@ export function sccacheAbsent(racine, env) {
|
|
|
140
145
|
if (lanceurDuProjet(racine, env)) {
|
|
141
146
|
return null;
|
|
142
147
|
}
|
|
143
|
-
|
|
144
|
-
.split(path.delimiter)
|
|
145
|
-
.filter(Boolean)
|
|
146
|
-
.some(d => {
|
|
147
|
-
try {
|
|
148
|
-
accessSync(path.join(d, 'sccache'), constants.X_OK);
|
|
149
|
-
return true;
|
|
150
|
-
} catch {
|
|
151
|
-
return false;
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
return present
|
|
148
|
+
return trouverDansLePath('sccache', env)
|
|
155
149
|
? null
|
|
156
150
|
: "⛔ sccache absent du PATH : cargo compile à travers lui (RUSTC_WRAPPER=sccache) ; `npx grillhouse maj` l'installe avec les autres binaires du module cargo.";
|
|
157
151
|
}
|
|
@@ -55,7 +55,9 @@ export function sansLitteraux(t) {
|
|
|
55
55
|
}
|
|
56
56
|
if (t[i] === '"') {
|
|
57
57
|
i++;
|
|
58
|
-
while (i < t.length && t[i] !== '"')
|
|
58
|
+
while (i < t.length && t[i] !== '"') {
|
|
59
|
+
i += t[i] === '\\' ? 2 : 1;
|
|
60
|
+
}
|
|
59
61
|
i++;
|
|
60
62
|
out += ' ';
|
|
61
63
|
continue;
|
|
@@ -93,19 +95,29 @@ export function lireLeFichier(texte) {
|
|
|
93
95
|
let profondeur = 1;
|
|
94
96
|
let k = jeton.lastIndex;
|
|
95
97
|
while (k < t.length && profondeur > 0) {
|
|
96
|
-
if (t[k] === '[')
|
|
97
|
-
|
|
98
|
+
if (t[k] === '[') {
|
|
99
|
+
profondeur++;
|
|
100
|
+
} else if (t[k] === ']') {
|
|
101
|
+
profondeur--;
|
|
102
|
+
}
|
|
98
103
|
k++;
|
|
99
104
|
}
|
|
100
105
|
const attribut = t.slice(jeton.lastIndex, k - 1).trim();
|
|
101
|
-
if (/^(?:\w+\s*::\s*)*test$/.test(attribut))
|
|
106
|
+
if (/^(?:\w+\s*::\s*)*test$/.test(attribut)) {
|
|
107
|
+
marque = true;
|
|
108
|
+
}
|
|
102
109
|
jeton.lastIndex = k;
|
|
103
110
|
} else if (m[1]) {
|
|
104
|
-
if (m[2] === '{')
|
|
105
|
-
|
|
111
|
+
if (m[2] === '{') {
|
|
112
|
+
pile.push(m[1]);
|
|
113
|
+
} else {
|
|
114
|
+
externes.push([...ici(), m[1]]);
|
|
115
|
+
}
|
|
106
116
|
marque = false;
|
|
107
117
|
} else if (m[3]) {
|
|
108
|
-
if (marque)
|
|
118
|
+
if (marque) {
|
|
119
|
+
tests.push([...ici(), m[3]]);
|
|
120
|
+
}
|
|
109
121
|
marque = false;
|
|
110
122
|
} else if (j === '{') {
|
|
111
123
|
pile.push(null);
|
|
@@ -128,7 +140,9 @@ export function lireLeFichier(texte) {
|
|
|
128
140
|
*/
|
|
129
141
|
export function nomsDeHead(chemin, module, lire) {
|
|
130
142
|
const texte = lire(chemin);
|
|
131
|
-
if (texte === null)
|
|
143
|
+
if (texte === null) {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
132
146
|
if (module) {
|
|
133
147
|
return lireLeFichier(texte).tests.map(t => [...module, ...t].join('::'));
|
|
134
148
|
}
|
|
@@ -136,7 +150,9 @@ export function nomsDeHead(chemin, module, lire) {
|
|
|
136
150
|
const vus = new Set();
|
|
137
151
|
// The file <f> of text <tx>, its modules under <dossier>, its tests under <prefixe>.
|
|
138
152
|
const parcourir = (f, tx, dossier, prefixe) => {
|
|
139
|
-
if (vus.has(f))
|
|
153
|
+
if (vus.has(f)) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
140
156
|
vus.add(f);
|
|
141
157
|
const { tests, externes } = lireLeFichier(tx);
|
|
142
158
|
noms.push(...tests.map(t => [...prefixe, ...t].join('::')));
|