@@@ misc wip
[mLib] / test / tvec.h
index f7512bd..3c7884c 100644 (file)
@@ -316,12 +316,14 @@ struct tvec_regty {
               unsigned /*style*/,
               const struct gprintf_ops */*gops*/, void */*go*/);
 #define TVSF_COMPACT 1u
+#define TVSF_RAW 2u
     /* Write a human-readable representation of the value @*rv@ using
      * @gprintf@ on @gops@ and @go@.  The @style@ is a collection of flags:
      * if @TVSF_COMPACT@ is set, then output should be minimal, and must fit
      * on a single line; otherwise, output may consist of multiple lines and
      * may contain redundant information if that is likely to be useful to a
-     * human reader.
+     * human reader.  If @TVSF_RAW@ is set, then output should prefer
+     * machine-readability over human-readability.
      */
 };
 
@@ -448,8 +450,8 @@ enum {
 
   TVOUT_LOSE,                          /* test failed */
   TVOUT_SKIP,                          /* test skipped */
-  TVOUT_WIN,                           /* test passed */
   TVOUT_XFAIL,                         /* test passed, but shouldn't have */
+  TVOUT_WIN,                           /* test passed */
   TVOUT_LIMIT                          /* (number of possible outcomes) */
 };
 
@@ -1199,6 +1201,7 @@ extern tvec_envteardownfn tvec_benchteardown;
  * Arguments:  @const struct gprintf_ops *gops@ = print operations
  *             @void *go@ = print destination
  *             @unsigned unit@ = the unit being measured (~TVBU_...@)
+ *             @unsigned style@ = output style (@TVSF_...@)
  *             @const struct bench_timing *tm@ = the benchmark result
  *
  * Returns:    ---
@@ -1210,7 +1213,7 @@ extern tvec_envteardownfn tvec_benchteardown;
 
 extern void tvec_benchreport
   (const struct gprintf_ops */*gops*/, void */*go*/,
-   unsigned /*unit*/, const struct bench_timing */*tm*/);
+   unsigned /*unit*/, unsigned /*style*/, const struct bench_timing */*tm*/);
 
 /*----- Remote execution --------------------------------------------------*/
 
@@ -1522,6 +1525,7 @@ extern int tvec_dupregerr(struct tvec_state */*tv*/, const char */*name*/);
 /* --- @tvec_humanoutput@ --- *
  *
  * Arguments:  @FILE *fp@ = output file to write on
+ *             @unsigned style@ = output style (@TVSF_...@)
  *
  * Returns:    An output formatter.
  *
@@ -1535,9 +1539,22 @@ extern int tvec_dupregerr(struct tvec_state */*tv*/, const char */*name*/);
 
 extern struct tvec_output *tvec_humanoutput(FILE */*fp*/);
 
+/* --- @tvec_machineoutput@ --- *
+ *
+ * Arguments:  @FILE *fp@ = output file to write on
+ *
+ * Returns:    An output formatter.
+ *
+ * Use:                Return an output formatter which writes on @fp@ in a
+ *             moderately simple machine-readable format.
+ */
+
+struct tvec_output *tvec_machineoutput(FILE *fp);
+
 /* --- @tvec_tapoutput@ --- *
  *
  * Arguments:  @FILE *fp@ = output file to write on
+ *             @unsigned style@ = output style (@TVSF_...@)
  *
  * Returns:    An output formatter.
  *