Browse Source

Extract test-005_opts, supress->suppress

MikeMirzayanov 1 year ago
parent
commit
14bf287607
66 changed files with 183 additions and 99 deletions
  1. 2 0
      .gitignore
  2. 29 34
      testlib.h
  3. 0 1
      tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r1/stdout
  4. 0 1
      tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r3/stderr
  5. 0 1
      tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r4/stderr
  6. 0 1
      tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r5/stderr
  7. 0 1
      tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r6/stderr
  8. 0 13
      tests/test-004_use-test.h/run.sh
  9. 1 1
      tests/test-004_use-test.h/tests/test-opts.cpp
  10. 1 2
      tests/test-005_opts/files/test-auto-ensure-no-unused-opts.cpp
  11. 23 0
      tests/test-005_opts/files/test-suppress-auto-ensure-no-unused-opts.cpp
  12. 0 0
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r1/exit_code
  13. 1 1
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r1/stderr
  14. 0 0
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r1/stdout
  15. 0 0
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r2/exit_code
  16. 1 1
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r2/stderr
  17. 0 0
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r2/stdout
  18. 0 0
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r3/exit_code
  19. 1 0
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r3/stderr
  20. 6 6
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r3/stdout
  21. 0 0
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r4/exit_code
  22. 1 0
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r4/stderr
  23. 6 6
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r4/stdout
  24. 0 0
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r5/exit_code
  25. 1 0
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r5/stderr
  26. 6 6
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r5/stdout
  27. 0 0
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r6/exit_code
  28. 1 0
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r6/stderr
  29. 6 6
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r6/stdout
  30. 0 0
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r7/exit_code
  31. 0 0
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r7/stderr
  32. 6 6
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r7/stdout
  33. 0 0
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r8/exit_code
  34. 0 0
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r8/stderr
  35. 6 6
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r8/stdout
  36. 0 0
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r9/exit_code
  37. 0 0
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r9/stderr
  38. 6 6
      tests/test-005_opts/refs/auto-ensure-no-unused-opts/r9/stdout
  39. 1 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r1/exit_code
  40. 1 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r1/stderr
  41. 0 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r1/stdout
  42. 1 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r2/exit_code
  43. 1 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r2/stderr
  44. 0 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r2/stdout
  45. 1 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r3/exit_code
  46. 0 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r3/stderr
  47. 6 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r3/stdout
  48. 1 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r4/exit_code
  49. 0 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r4/stderr
  50. 6 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r4/stdout
  51. 1 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r5/exit_code
  52. 0 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r5/stderr
  53. 6 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r5/stdout
  54. 1 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r6/exit_code
  55. 0 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r6/stderr
  56. 6 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r6/stdout
  57. 1 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r7/exit_code
  58. 0 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r7/stderr
  59. 6 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r7/stdout
  60. 1 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r8/exit_code
  61. 0 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r8/stderr
  62. 6 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r8/stdout
  63. 1 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r9/exit_code
  64. 0 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r9/stderr
  65. 6 0
      tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r9/stdout
  66. 26 0
      tests/test-005_opts/run.sh

+ 2 - 0
.gitignore

@@ -1,5 +1,7 @@
 .idea
+cmake-build-debug
 
 *.exe
 *.o
 *.obj
+CMakeLists.txt

+ 29 - 34
testlib.h

@@ -2305,7 +2305,8 @@ struct TestlibFinalizeGuard {
 
             if (testlibMode == _validator && readEofCount == 0 && quitCount == 0)
                 __testlib_fail("Validator must end with readEof call.");
-            
+
+            /* opts */
             autoEnsureNoUnusedOpts();
         }
 
@@ -2313,6 +2314,7 @@ struct TestlibFinalizeGuard {
     }
 
 private:
+    /* opts */
     void autoEnsureNoUnusedOpts();
 };
 
@@ -4839,7 +4841,6 @@ struct TestlibOpt {
     bool used;
 
     TestlibOpt() : value(), used(false) {}
-    explicit TestlibOpt(const std::string &value_) : value(value_), used(false) {}
 };
 
 /**
@@ -4944,16 +4945,16 @@ std::map<std::string, TestlibOpt> __testlib_opts;
  * Whether automatic no unused opts ensurement should be done. This flag will
  * be turned on when `has_opt` or `opt(key, default_value)` is called.
  * 
- * The automatic ensurement can be supressed when
- * __testlib_ensureNoUnusedOptsSupressed is true.
+ * The automatic ensurement can be suppressed when
+ * __testlib_ensureNoUnusedOptsSuppressed is true.
  */
 bool __testlib_ensureNoUnusedOptsFlag = false;
 
 /**
- * Supress no unused opts automatic ensurement. Can be set to true with
- * `supressEnsureNoUnusedOpts()`.
+ * Suppress no unused opts automatic ensurement. Can be set to true with
+ * `suppressEnsureNoUnusedOpts()`.
  */
-bool __testlib_ensureNoUnusedOptsSupressed = false;
+bool __testlib_ensureNoUnusedOptsSuppressed = false;
 
 /**
  * Parse command line arguments into opts.
@@ -5127,7 +5128,7 @@ long double optValueToLongDouble(const std::string &s_) {
  * Return true if there is an opt with a given key.
  * 
  * By calling this function, automatic ensurement for no unused opts will be
- * done when the program is finalized. Call supressEnsureNoUnusedOpts() to
+ * done when the program is finalized. Call suppressEnsureNoUnusedOpts() to
  * turn it off.
  */
 bool has_opt(const std::string &key) {
@@ -5183,32 +5184,32 @@ template<typename T>
 T opt(std::false_type is_floating_point, int index);
 
 template<>
-std::string opt(std::false_type is_floating_point, int index) {
+std::string opt(std::false_type /*is_floating_point*/, int index) {
     return __testlib_indexToArgv(index);
 }
 
 template<typename T>
-T opt(std::true_type is_floating_point, int index) {
+T opt(std::true_type /*is_floating_point*/, int index) {
     return T(optValueToLongDouble(__testlib_indexToArgv(index)));
 }
 
 template<typename T, typename U>
-T opt(std::false_type is_integral, U is_unsigned, int index) {
+T opt(std::false_type /*is_integral*/, U /*is_unsigned*/, int index) {
     return opt<T>(std::is_floating_point<T>(), index);
 }
 
 template<typename T>
-T opt(std::true_type is_integral, std::false_type is_unsigned, int index) {
+T opt(std::true_type /*is_integral*/, std::false_type /*is_unsigned*/, int index) {
     return optValueToIntegral<T>(__testlib_indexToArgv(index), false);
 }
 
 template<typename T>
-T opt(std::true_type is_integral, std::true_type is_unsigned, int index) {
+T opt(std::true_type /*is_integral*/, std::true_type /*is_unsigned*/, int index) {
     return optValueToIntegral<T>(__testlib_indexToArgv(index), true);
 }
 
 template<>
-bool opt(std::true_type is_integral, std::true_type is_unsigned, int index) {
+bool opt(std::true_type /*is_integral*/, std::true_type /*is_unsigned*/, int index) {
     std::string value = __testlib_indexToArgv(index);
     if (value == "true" || value == "1")
         return true;
@@ -5257,32 +5258,32 @@ template<typename T>
 T opt(std::false_type is_floating_point, const std::string &key);
 
 template<>
-std::string opt(std::false_type is_floating_point, const std::string &key) {
+std::string opt(std::false_type /*is_floating_point*/, const std::string &key) {
     return __testlib_keyToOpts(key);
 }
 
 template<typename T>
-T opt(std::true_type is_integral, const std::string &key) {
+T opt(std::true_type /*is_integral*/, const std::string &key) {
     return T(optValueToLongDouble(__testlib_keyToOpts(key)));
 }
 
 template<typename T, typename U>
-T opt(std::false_type is_integral, U, const std::string &key) {
+T opt(std::false_type /*is_integral*/, U, const std::string &key) {
     return opt<T>(std::is_floating_point<T>(), key);
 }
 
 template<typename T>
-T opt(std::true_type is_integral, std::false_type is_unsigned, const std::string &key) {
+T opt(std::true_type /*is_integral*/, std::false_type /*is_unsigned*/, const std::string &key) {
     return optValueToIntegral<T>(__testlib_keyToOpts(key), false);
 }
 
 template<typename T>
-T opt(std::true_type is_integral, std::true_type is_unsigned, const std::string &key) {
+T opt(std::true_type /*is_integral*/, std::true_type /*is_unsigned*/, const std::string &key) {
     return optValueToIntegral<T>(__testlib_keyToOpts(key), true);
 }
 
 template<>
-bool opt(std::true_type is_integral, std::true_type is_unsigned, const std::string &key) {
+bool opt(std::true_type /*is_integral*/, std::true_type /*is_unsigned*/, const std::string &key) {
     if (!has_opt(key))
         return false;
     std::string value = __testlib_keyToOpts(key);
@@ -5314,7 +5315,7 @@ std::string opt(const std::string &key) {
  * found, return the given default_value.
  * 
  * By calling this function, automatic ensurement for no unused opts will be
- * done when the program is finalized. Call supressEnsureNoUnusedOpts() to
+ * done when the program is finalized. Call suppressEnsureNoUnusedOpts() to
  * turn it off.
  */
 template<typename T>
@@ -5330,7 +5331,7 @@ T opt(const std::string &key, const T &default_value) {
  * given key are found, return the given default_value.
  * 
  * By calling this function, automatic ensurement for no unused opts will be
- * done when the program is finalized. Call supressEnsureNoUnusedOpts() to
+ * done when the program is finalized. Call suppressEnsureNoUnusedOpts() to
  * turn it off.
  */
 std::string opt(const std::string &key, const std::string &default_value) {
@@ -5344,27 +5345,21 @@ std::string opt(const std::string &key, const std::string &default_value) {
  * This function is useful when opt() with default_value for checking typos
  * in the opt's key.
  */
-void ensureNoUnusedOpts(bool with_supress_message = false) {
+void ensureNoUnusedOpts() {
     for (const auto &opt: __testlib_opts) {
         if (!opt.second.used) {
-            __testlib_fail(format(
-                "Opts: unused key '%s'%s", compress(opt.first).c_str(),
-                with_supress_message
-                    ? ". Call supressEnsureNoUnusedOpts() at the beginning of "
-                      "main() to turn off ensurement for no unused opts."
-                    : ""));
+            __testlib_fail(format("Opts: unused key '%s'", compress(opt.first).c_str()));
         }
     }
 }
 
-void supressEnsureNoUnusedOpts() {
-    __testlib_ensureNoUnusedOptsSupressed = true;
+void suppressEnsureNoUnusedOpts() {
+    __testlib_ensureNoUnusedOptsSuppressed = true;
 }
 
 void TestlibFinalizeGuard::autoEnsureNoUnusedOpts() {
-    if (__testlib_ensureNoUnusedOptsFlag &&
-        !__testlib_ensureNoUnusedOptsSupressed) {
-        ensureNoUnusedOpts(true);
+    if (__testlib_ensureNoUnusedOptsFlag && !__testlib_ensureNoUnusedOptsSuppressed) {
+        ensureNoUnusedOpts();
     }
 }
 

+ 0 - 1
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r1/stdout

@@ -1 +0,0 @@
-

+ 0 - 1
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r3/stderr

@@ -1 +0,0 @@
-FAIL Opts: unused key 'min-val'. Call supressEnsureNoUnusedOpts() at the beginning of main() to turn off ensurement for no unused opts.

+ 0 - 1
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r4/stderr

@@ -1 +0,0 @@
-FAIL Opts: unused key 'max-val'. Call supressEnsureNoUnusedOpts() at the beginning of main() to turn off ensurement for no unused opts.

+ 0 - 1
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r5/stderr

@@ -1 +0,0 @@
-FAIL Opts: unused key 'min-length'. Call supressEnsureNoUnusedOpts() at the beginning of main() to turn off ensurement for no unused opts.

+ 0 - 1
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r6/stderr

@@ -1 +0,0 @@
-FAIL Opts: unused key 'bias-value'. Call supressEnsureNoUnusedOpts() at the beginning of main() to turn off ensurement for no unused opts.

+ 0 - 13
tests/test-004_use-test.h/run.sh

@@ -4,16 +4,3 @@ set -eo pipefail
 bash ../scripts/compile test.cpp
 bash ../scripts/test-ref r1 "$VALGRIND" ./test
 rm -f test test.exe
-
-bash ../scripts/compile test-auto-ensure-no-unused-opts.cpp
-bash ../scripts/test-ref auto-ensure-no-unused-opts/r1 ./test-auto-ensure-no-unused-opts
-bash ../scripts/test-ref auto-ensure-no-unused-opts/r2 ./test-auto-ensure-no-unused-opts -test-count 3
-bash ../scripts/test-ref auto-ensure-no-unused-opts/r3 ./test-auto-ensure-no-unused-opts -test-count 3 -sum-n 10 -min-val 1
-bash ../scripts/test-ref auto-ensure-no-unused-opts/r4 ./test-auto-ensure-no-unused-opts -test-count 3 -sum-n 10 -min-value 10 -max-val 20
-bash ../scripts/test-ref auto-ensure-no-unused-opts/r5 ./test-auto-ensure-no-unused-opts -test-count 3 -sum-n 10 -min-length 3 -min-value 10 -max-value 20
-bash ../scripts/test-ref auto-ensure-no-unused-opts/r6 ./test-auto-ensure-no-unused-opts -test-count 3 -sum-n 10 -min-n 3 -min-value 10 -max-value 20 -bias-value 3
-bash ../scripts/test-ref auto-ensure-no-unused-opts/r7 ./test-auto-ensure-no-unused-opts -test-count 3 -sum-n 10
-bash ../scripts/test-ref auto-ensure-no-unused-opts/r8 ./test-auto-ensure-no-unused-opts -test-count 3 -sum-n 10 -min-value 10
-bash ../scripts/test-ref auto-ensure-no-unused-opts/r9 ./test-auto-ensure-no-unused-opts -test-count 5 -sum-n 100 -min-n 3 -min-value 10 -max-value 20 -value-bias -3
-
-rm -f test-auto-ensure-no-unused-opts test-auto-ensure-no-unused-opts.exe

+ 1 - 1
tests/test-004_use-test.h/tests/test-opts.cpp

@@ -1,5 +1,5 @@
 TEST(opts) {
-    supressEnsureNoUnusedOpts();
+    suppressEnsureNoUnusedOpts();
     {
         const char* args[] = {"test"};
         prepareOpts(sizeof(args) / sizeof(const char*), (char **)args);

+ 1 - 2
tests/test-004_use-test.h/test-auto-ensure-no-unused-opts.cpp → tests/test-005_opts/files/test-auto-ensure-no-unused-opts.cpp

@@ -1,4 +1,5 @@
 #include "testlib.h"
+
 using namespace std;
 
 int main(int argc, char** argv) {
@@ -18,6 +19,4 @@ int main(int argc, char** argv) {
     println("min-value =", min_value);
     println("max-value =", max_value);
     println("value-bias =", value_bias);
-    
-    return 0;
 }

+ 23 - 0
tests/test-005_opts/files/test-suppress-auto-ensure-no-unused-opts.cpp

@@ -0,0 +1,23 @@
+#include "testlib.h"
+
+using namespace std;
+
+int main(int argc, char** argv) {
+    registerGen(argc, argv, 1);
+    suppressEnsureNoUnusedOpts();
+    
+    int test_count = opt<int>("test-count");
+    int sum_n = opt<int>("sum-n");
+    int min_n = opt<int>("min-n", 1);
+    
+    int min_value = opt<int>("min-value", 1);
+    int max_value = opt<int>("max-value", 1000 * 1000 * 1000);
+    int value_bias = opt<int>("value-bias", 0);
+    
+    println("test-count =", test_count);
+    println("sum-n =", sum_n);
+    println("min-n =", min_n);
+    println("min-value =", min_value);
+    println("max-value =", max_value);
+    println("value-bias =", value_bias);
+}

+ 0 - 0
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r1/exit_code → tests/test-005_opts/refs/auto-ensure-no-unused-opts/r1/exit_code


+ 1 - 1
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r1/stderr → tests/test-005_opts/refs/auto-ensure-no-unused-opts/r1/stderr

@@ -1 +1 @@
-FAIL Opts: unknown key 'test-count'
+FAIL Opts: unknown key 'test-count'

+ 0 - 0
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r2/stdout → tests/test-005_opts/refs/auto-ensure-no-unused-opts/r1/stdout


+ 0 - 0
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r2/exit_code → tests/test-005_opts/refs/auto-ensure-no-unused-opts/r2/exit_code


+ 1 - 1
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r2/stderr → tests/test-005_opts/refs/auto-ensure-no-unused-opts/r2/stderr

@@ -1 +1 @@
-FAIL Opts: unknown key 'sum-n'
+FAIL Opts: unknown key 'sum-n'

+ 0 - 0
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r7/stderr → tests/test-005_opts/refs/auto-ensure-no-unused-opts/r2/stdout


+ 0 - 0
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r3/exit_code → tests/test-005_opts/refs/auto-ensure-no-unused-opts/r3/exit_code


+ 1 - 0
tests/test-005_opts/refs/auto-ensure-no-unused-opts/r3/stderr

@@ -0,0 +1 @@
+FAIL Opts: unused key 'min-val'

+ 6 - 6
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r3/stdout → tests/test-005_opts/refs/auto-ensure-no-unused-opts/r3/stdout

@@ -1,6 +1,6 @@
-test-count = 3
-sum-n = 10
-min-n = 1
-min-value = 1
-max-value = 1000000000
-value-bias = 0
+test-count = 3
+sum-n = 10
+min-n = 1
+min-value = 1
+max-value = 1000000000
+value-bias = 0

+ 0 - 0
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r4/exit_code → tests/test-005_opts/refs/auto-ensure-no-unused-opts/r4/exit_code


+ 1 - 0
tests/test-005_opts/refs/auto-ensure-no-unused-opts/r4/stderr

@@ -0,0 +1 @@
+FAIL Opts: unused key 'max-val'

+ 6 - 6
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r4/stdout → tests/test-005_opts/refs/auto-ensure-no-unused-opts/r4/stdout

@@ -1,6 +1,6 @@
-test-count = 3
-sum-n = 10
-min-n = 1
-min-value = 10
-max-value = 1000000000
-value-bias = 0
+test-count = 3
+sum-n = 10
+min-n = 1
+min-value = 10
+max-value = 1000000000
+value-bias = 0

+ 0 - 0
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r5/exit_code → tests/test-005_opts/refs/auto-ensure-no-unused-opts/r5/exit_code


+ 1 - 0
tests/test-005_opts/refs/auto-ensure-no-unused-opts/r5/stderr

@@ -0,0 +1 @@
+FAIL Opts: unused key 'min-length'

+ 6 - 6
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r5/stdout → tests/test-005_opts/refs/auto-ensure-no-unused-opts/r5/stdout

@@ -1,6 +1,6 @@
-test-count = 3
-sum-n = 10
-min-n = 1
-min-value = 10
-max-value = 20
-value-bias = 0
+test-count = 3
+sum-n = 10
+min-n = 1
+min-value = 10
+max-value = 20
+value-bias = 0

+ 0 - 0
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r6/exit_code → tests/test-005_opts/refs/auto-ensure-no-unused-opts/r6/exit_code


+ 1 - 0
tests/test-005_opts/refs/auto-ensure-no-unused-opts/r6/stderr

@@ -0,0 +1 @@
+FAIL Opts: unused key 'bias-value'

+ 6 - 6
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r6/stdout → tests/test-005_opts/refs/auto-ensure-no-unused-opts/r6/stdout

@@ -1,6 +1,6 @@
-test-count = 3
-sum-n = 10
-min-n = 3
-min-value = 10
-max-value = 20
-value-bias = 0
+test-count = 3
+sum-n = 10
+min-n = 3
+min-value = 10
+max-value = 20
+value-bias = 0

+ 0 - 0
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r7/exit_code → tests/test-005_opts/refs/auto-ensure-no-unused-opts/r7/exit_code


+ 0 - 0
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r8/stderr → tests/test-005_opts/refs/auto-ensure-no-unused-opts/r7/stderr


+ 6 - 6
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r7/stdout → tests/test-005_opts/refs/auto-ensure-no-unused-opts/r7/stdout

@@ -1,6 +1,6 @@
-test-count = 3
-sum-n = 10
-min-n = 1
-min-value = 1
-max-value = 1000000000
-value-bias = 0
+test-count = 3
+sum-n = 10
+min-n = 1
+min-value = 1
+max-value = 1000000000
+value-bias = 0

+ 0 - 0
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r8/exit_code → tests/test-005_opts/refs/auto-ensure-no-unused-opts/r8/exit_code


+ 0 - 0
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r9/stderr → tests/test-005_opts/refs/auto-ensure-no-unused-opts/r8/stderr


+ 6 - 6
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r8/stdout → tests/test-005_opts/refs/auto-ensure-no-unused-opts/r8/stdout

@@ -1,6 +1,6 @@
-test-count = 3
-sum-n = 10
-min-n = 1
-min-value = 10
-max-value = 1000000000
-value-bias = 0
+test-count = 3
+sum-n = 10
+min-n = 1
+min-value = 10
+max-value = 1000000000
+value-bias = 0

+ 0 - 0
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r9/exit_code → tests/test-005_opts/refs/auto-ensure-no-unused-opts/r9/exit_code


+ 0 - 0
tests/test-005_opts/refs/auto-ensure-no-unused-opts/r9/stderr


+ 6 - 6
tests/test-004_use-test.h/refs/auto-ensure-no-unused-opts/r9/stdout → tests/test-005_opts/refs/auto-ensure-no-unused-opts/r9/stdout

@@ -1,6 +1,6 @@
-test-count = 5
-sum-n = 100
-min-n = 3
-min-value = 10
-max-value = 20
-value-bias = -3
+test-count = 5
+sum-n = 100
+min-n = 3
+min-value = 10
+max-value = 20
+value-bias = -3

+ 1 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r1/exit_code

@@ -0,0 +1 @@
+3

+ 1 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r1/stderr

@@ -0,0 +1 @@
+FAIL Opts: unknown key 'test-count'

+ 0 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r1/stdout


+ 1 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r2/exit_code

@@ -0,0 +1 @@
+3

+ 1 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r2/stderr

@@ -0,0 +1 @@
+FAIL Opts: unknown key 'sum-n'

+ 0 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r2/stdout


+ 1 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r3/exit_code

@@ -0,0 +1 @@
+0

+ 0 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r3/stderr


+ 6 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r3/stdout

@@ -0,0 +1,6 @@
+test-count = 3
+sum-n = 10
+min-n = 1
+min-value = 1
+max-value = 1000000000
+value-bias = 0

+ 1 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r4/exit_code

@@ -0,0 +1 @@
+0

+ 0 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r4/stderr


+ 6 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r4/stdout

@@ -0,0 +1,6 @@
+test-count = 3
+sum-n = 10
+min-n = 1
+min-value = 10
+max-value = 1000000000
+value-bias = 0

+ 1 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r5/exit_code

@@ -0,0 +1 @@
+0

+ 0 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r5/stderr


+ 6 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r5/stdout

@@ -0,0 +1,6 @@
+test-count = 3
+sum-n = 10
+min-n = 1
+min-value = 10
+max-value = 20
+value-bias = 0

+ 1 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r6/exit_code

@@ -0,0 +1 @@
+0

+ 0 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r6/stderr


+ 6 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r6/stdout

@@ -0,0 +1,6 @@
+test-count = 3
+sum-n = 10
+min-n = 3
+min-value = 10
+max-value = 20
+value-bias = 0

+ 1 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r7/exit_code

@@ -0,0 +1 @@
+0

+ 0 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r7/stderr


+ 6 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r7/stdout

@@ -0,0 +1,6 @@
+test-count = 3
+sum-n = 10
+min-n = 1
+min-value = 1
+max-value = 1000000000
+value-bias = 0

+ 1 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r8/exit_code

@@ -0,0 +1 @@
+0

+ 0 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r8/stderr


+ 6 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r8/stdout

@@ -0,0 +1,6 @@
+test-count = 3
+sum-n = 10
+min-n = 1
+min-value = 10
+max-value = 1000000000
+value-bias = 0

+ 1 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r9/exit_code

@@ -0,0 +1 @@
+0

+ 0 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r9/stderr


+ 6 - 0
tests/test-005_opts/refs/suppress-auto-ensure-no-unused-opts/r9/stdout

@@ -0,0 +1,6 @@
+test-count = 5
+sum-n = 100
+min-n = 3
+min-value = 10
+max-value = 20
+value-bias = -3

+ 26 - 0
tests/test-005_opts/run.sh

@@ -0,0 +1,26 @@
+#!/bin/bash
+set -eo pipefail
+
+bash ../scripts/compile files/test-auto-ensure-no-unused-opts.cpp
+bash ../scripts/test-ref auto-ensure-no-unused-opts/r1 "$VALGRIND" ./test-auto-ensure-no-unused-opts
+bash ../scripts/test-ref auto-ensure-no-unused-opts/r2 "$VALGRIND" ./test-auto-ensure-no-unused-opts -test-count 3
+bash ../scripts/test-ref auto-ensure-no-unused-opts/r3 "$VALGRIND" ./test-auto-ensure-no-unused-opts -test-count 3 -sum-n 10 -min-val 1
+bash ../scripts/test-ref auto-ensure-no-unused-opts/r4 "$VALGRIND" ./test-auto-ensure-no-unused-opts -test-count 3 -sum-n 10 -min-value 10 -max-val 20
+bash ../scripts/test-ref auto-ensure-no-unused-opts/r5 "$VALGRIND" ./test-auto-ensure-no-unused-opts -test-count 3 -sum-n 10 -min-length 3 -min-value 10 -max-value 20
+bash ../scripts/test-ref auto-ensure-no-unused-opts/r6 "$VALGRIND" ./test-auto-ensure-no-unused-opts -test-count 3 -sum-n 10 -min-n 3 -min-value 10 -max-value 20 -bias-value 3
+bash ../scripts/test-ref auto-ensure-no-unused-opts/r7 "$VALGRIND" ./test-auto-ensure-no-unused-opts -test-count 3 -sum-n 10
+bash ../scripts/test-ref auto-ensure-no-unused-opts/r8 "$VALGRIND" ./test-auto-ensure-no-unused-opts -test-count 3 -sum-n 10 -min-value 10
+bash ../scripts/test-ref auto-ensure-no-unused-opts/r9 "$VALGRIND" ./test-auto-ensure-no-unused-opts -test-count 5 -sum-n 100 -min-n 3 -min-value 10 -max-value 20 -value-bias -3
+rm -f test-auto-ensure-no-unused-opts test-auto-ensure-no-unused-opts.exe
+
+bash ../scripts/compile files/test-suppress-auto-ensure-no-unused-opts.cpp
+bash ../scripts/test-ref suppress-auto-ensure-no-unused-opts/r1 "$VALGRIND" ./test-suppress-auto-ensure-no-unused-opts
+bash ../scripts/test-ref suppress-auto-ensure-no-unused-opts/r2 "$VALGRIND" ./test-suppress-auto-ensure-no-unused-opts -test-count 3
+bash ../scripts/test-ref suppress-auto-ensure-no-unused-opts/r3 "$VALGRIND" ./test-suppress-auto-ensure-no-unused-opts -test-count 3 -sum-n 10 -min-val 1
+bash ../scripts/test-ref suppress-auto-ensure-no-unused-opts/r4 "$VALGRIND" ./test-suppress-auto-ensure-no-unused-opts -test-count 3 -sum-n 10 -min-value 10 -max-val 20
+bash ../scripts/test-ref suppress-auto-ensure-no-unused-opts/r5 "$VALGRIND" ./test-suppress-auto-ensure-no-unused-opts -test-count 3 -sum-n 10 -min-length 3 -min-value 10 -max-value 20
+bash ../scripts/test-ref suppress-auto-ensure-no-unused-opts/r6 "$VALGRIND" ./test-suppress-auto-ensure-no-unused-opts -test-count 3 -sum-n 10 -min-n 3 -min-value 10 -max-value 20 -bias-value 3
+bash ../scripts/test-ref suppress-auto-ensure-no-unused-opts/r7 "$VALGRIND" ./test-suppress-auto-ensure-no-unused-opts -test-count 3 -sum-n 10
+bash ../scripts/test-ref suppress-auto-ensure-no-unused-opts/r8 "$VALGRIND" ./test-suppress-auto-ensure-no-unused-opts -test-count 3 -sum-n 10 -min-value 10
+bash ../scripts/test-ref suppress-auto-ensure-no-unused-opts/r9 "$VALGRIND" ./test-suppress-auto-ensure-no-unused-opts -test-count 5 -sum-n 100 -min-n 3 -min-value 10 -max-value 20 -value-bias -3
+rm -f test-suppress-auto-ensure-no-unused-opts test-suppress-auto-ensure-no-unused-opts.exe