@voxgig/sdkgen 4.8.2 → 4.9.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/bin/voxgig-sdkgen +1 -1
- package/dist/action/doctor.d.ts +1 -0
- package/dist/action/doctor.js +50 -2
- package/dist/action/doctor.js.map +1 -1
- package/dist/helpers/naming.js +4 -2
- package/dist/helpers/naming.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/model/sdkgen.aon +21 -0
- package/package.json +1 -1
- package/project/.sdk/model/feature/secrets.aon +120 -18
- package/project/.sdk/model/target/c.aon +10 -0
- package/project/.sdk/model/target/clojure.aon +13 -0
- package/project/.sdk/model/target/cpp.aon +10 -0
- package/project/.sdk/model/target/csharp.aon +9 -0
- package/project/.sdk/model/target/dart.aon +10 -0
- package/project/.sdk/model/target/elixir.aon +9 -0
- package/project/.sdk/model/target/go.aon +13 -0
- package/project/.sdk/model/target/java.aon +9 -0
- package/project/.sdk/model/target/js.aon +7 -0
- package/project/.sdk/model/target/kotlin.aon +9 -0
- package/project/.sdk/model/target/lean.aon +17 -0
- package/project/.sdk/model/target/lua.aon +8 -0
- package/project/.sdk/model/target/ocaml.aon +9 -0
- package/project/.sdk/model/target/perl.aon +8 -0
- package/project/.sdk/model/target/php.aon +8 -0
- package/project/.sdk/model/target/py.aon +13 -0
- package/project/.sdk/model/target/rb.aon +8 -0
- package/project/.sdk/model/target/rust.aon +10 -0
- package/project/.sdk/model/target/scala.aon +21 -2
- package/project/.sdk/model/target/swift.aon +18 -0
- package/project/.sdk/model/target/ts.aon +13 -0
- package/project/.sdk/model/target/zig.aon +9 -0
- package/project/.sdk/src/cmp/clojure/Package_clojure.ts +9 -2
- package/project/.sdk/src/cmp/cpp/Gitignore_cpp.ts +3 -0
- package/project/.sdk/src/cmp/dart/Test_dart.ts +2 -0
- package/project/.sdk/src/cmp/elixir/Package_elixir.ts +4 -1
- package/project/.sdk/src/cmp/go/Config_go.ts +59 -2
- package/project/.sdk/src/cmp/go/Main_go.ts +8 -2
- package/project/.sdk/src/cmp/java/Test_java.ts +6 -5
- package/project/.sdk/src/cmp/kotlin/Test_kotlin.ts +6 -5
- package/project/.sdk/src/cmp/lean/Package_lean.ts +23 -0
- package/project/.sdk/src/cmp/lean/ReadmeInstall_lean.ts +1 -0
- package/project/.sdk/src/cmp/lean/ReadmeTopTest_lean.ts +1 -0
- package/project/.sdk/src/cmp/ocaml/Gitignore_ocaml.ts +1 -0
- package/project/.sdk/src/cmp/ocaml/Main_ocaml.ts +7 -3
- package/project/.sdk/src/cmp/py/Config_py.ts +82 -1
- package/project/.sdk/src/cmp/py/Main_py.ts +44 -0
- package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +2 -0
- package/project/.sdk/src/cmp/swift/Main_swift.ts +10 -0
- package/project/.sdk/src/cmp/swift/Package_swift.ts +13 -1
- package/project/.sdk/src/cmp/ts/Config_ts.ts +42 -17
- package/project/.sdk/src/cmp/ts/fragment/Config.data.fragment.ts +13 -1
- package/project/.sdk/src/cmp/ts/fragment/Config.fragment.ts +13 -1
- package/project/.sdk/src/cmp/zig/Package_zig.ts +15 -11
- package/project/.sdk/src/cmp/zig/fragment/Entity.fragment.zig +3 -3
- package/project/.sdk/src/cmp/zig/fragment/EntityListOp.fragment.zig +3 -3
- package/project/.sdk/src/cmp/zig/fragment/Main.fragment.zig +3 -3
- package/project/.sdk/src/cmp/zig/utility_zig.ts +50 -1
- package/project/.sdk/tm/c/Makefile +38 -3
- package/project/.sdk/tm/c/tests/omni_resolver.h +361 -0
- package/project/.sdk/tm/c/tests/omni_smoke_test.c +237 -0
- package/project/.sdk/tm/c/tests/primary_corpus_test.c +205 -284
- package/project/.sdk/tm/c/tests/struct_corpus_test.c +292 -212
- package/project/.sdk/tm/c/tests/vendor/omni/json.c +811 -0
- package/project/.sdk/tm/c/tests/vendor/omni/omni.h +240 -0
- package/project/.sdk/tm/c/tests/vendor/omni/runner.c +940 -0
- package/project/.sdk/tm/c/tests/vendor/omni/util.c +351 -0
- package/project/.sdk/tm/c/utility/struct/utility.c +7 -2
- package/project/.sdk/tm/clojure/test/sdk/test/omni.clj +401 -0
- package/project/.sdk/tm/clojure/test/sdk/test/omni_smoke.clj +81 -0
- package/project/.sdk/tm/clojure/test/sdk/test/primary.clj +92 -58
- package/project/.sdk/tm/clojure/test/sdk/test/struct_corpus.clj +122 -149
- package/project/.sdk/tm/clojure/test/sdk/test_runner.clj +8 -3
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/json.clj +145 -0
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/runner.clj +445 -0
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/util.clj +145 -0
- package/project/.sdk/tm/cpp/Makefile +5 -1
- package/project/.sdk/tm/cpp/test/omni_resolver.hpp +473 -0
- package/project/.sdk/tm/cpp/test/omni_smoke_test.cpp +209 -0
- package/project/.sdk/tm/cpp/test/primary_utility_test.cpp +243 -184
- package/project/.sdk/tm/cpp/test/runner_support.hpp +68 -181
- package/project/.sdk/tm/cpp/test/struct_corpus_test.cpp +183 -56
- package/project/.sdk/tm/cpp/test/vendor/omni/json.hpp +406 -0
- package/project/.sdk/tm/cpp/test/vendor/omni/omni.hpp +751 -0
- package/project/.sdk/tm/cpp/test/vendor/omni/util.hpp +256 -0
- package/project/.sdk/tm/cpp/utility/pipeline.hpp +7 -1
- package/project/.sdk/tm/csharp/test/OmniResolver.cs +491 -0
- package/project/.sdk/tm/csharp/test/OmniSmokeTest.cs +106 -0
- package/project/.sdk/tm/csharp/test/PrimaryUtilityTest.cs +299 -316
- package/project/.sdk/tm/csharp/test/Runner.cs +104 -269
- package/project/.sdk/tm/csharp/test/StructUtilityTest.cs +535 -724
- package/project/.sdk/tm/csharp/test/vendor/omni/Runner.cs +864 -0
- package/project/.sdk/tm/csharp/test/vendor/omni/Util.cs +347 -0
- package/project/.sdk/tm/csharp/utility/MakeSpec.cs +3 -1
- package/project/.sdk/tm/csharp/utility/PrepareMethod.cs +6 -1
- package/project/.sdk/tm/csharp/utility/struct/Struct.cs +21 -5
- package/project/.sdk/tm/dart/test/omni.dart +520 -0
- package/project/.sdk/tm/dart/test/omni_smoke_test.dart +143 -0
- package/project/.sdk/tm/dart/test/primary_test.dart +86 -28
- package/project/.sdk/tm/dart/test/struct_test.dart +438 -11
- package/project/.sdk/tm/dart/test/vendor/omni/omni.dart +7 -0
- package/project/.sdk/tm/dart/test/vendor/omni/runner.dart +653 -0
- package/project/.sdk/tm/dart/test/vendor/omni/util.dart +232 -0
- package/project/.sdk/tm/elixir/Makefile +11 -3
- package/project/.sdk/tm/elixir/test/omni_smoke_test.exs +117 -0
- package/project/.sdk/tm/elixir/test/primary_utility_test.exs +341 -16
- package/project/.sdk/tm/elixir/test/struct_corpus_test.exs +554 -9
- package/project/.sdk/tm/elixir/test/support/omni.ex +377 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/json.ex +122 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/runner.ex +623 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/util.ex +187 -0
- package/project/.sdk/tm/go/core/context.go +32 -16
- package/project/.sdk/tm/go/feature/secrets/plugin/capability.go +261 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/catalog.go +78 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/config.go +652 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/depend.go +250 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/env.go +194 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/export.go +80 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/graph.go +238 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/host.go +1575 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/order.go +248 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/point.go +184 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/ref.go +123 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/resolve.go +79 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/types.go +296 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/util.go +87 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/version.go +161 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/aws/aws.go +292 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/aws/sigv4.go +201 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/azuresecrets/azuresecrets.go +187 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/boru/boru.go +184 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/doppler/doppler.go +114 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/gcpsecrets/gcpsecrets.go +156 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/hashicorp/hashicorp.go +208 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/httpjson/httpjson.go +241 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/infisical/infisical.go +150 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/onepassword/onepassword.go +152 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/secretspec/secretspec.go +143 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/addr.go +120 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/providers.go +442 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/sekreto.go +714 -0
- package/project/.sdk/tm/go/feature/secrets_feature.go +675 -0
- package/project/.sdk/tm/go/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/go/test/feature/secrets/secrets_feature_test.go +799 -0
- package/project/.sdk/tm/go/test/omni/omni.go +902 -0
- package/project/.sdk/tm/go/test/omni/util.go +381 -0
- package/project/.sdk/tm/go/test/omniresolver_test.go +748 -0
- package/project/.sdk/tm/go/test/omnismoke_test.go +112 -0
- package/project/.sdk/tm/go/test/primary_utility_test.go +123 -191
- package/project/.sdk/tm/go/test/struct_utility_test.go +323 -16
- package/project/.sdk/tm/go/test/testsupport_test.go +294 -0
- package/project/.sdk/tm/go/utility/make_options.go +8 -1
- package/project/.sdk/tm/go/utility/prepare_method.go +5 -1
- package/project/.sdk/tm/go/utility/struct/voxgigstruct.go +2 -2
- package/project/.sdk/tm/java/test/OmniResolver.java +355 -0
- package/project/.sdk/tm/java/test/OmniSmokeTest.java +99 -0
- package/project/.sdk/tm/java/test/PrimaryUtilityTest.java +254 -280
- package/project/.sdk/tm/java/test/RunnerSupport.java +9 -194
- package/project/.sdk/tm/java/test/StructCorpusTest.java +119 -42
- package/project/.sdk/tm/java/test/vendor/omni/Json.java +287 -0
- package/project/.sdk/tm/java/test/vendor/omni/Runner.java +851 -0
- package/project/.sdk/tm/java/test/vendor/omni/Util.java +322 -0
- package/project/.sdk/tm/java/utility/MakeSpec.java +3 -1
- package/project/.sdk/tm/java/utility/PrepareMethod.java +5 -5
- package/project/.sdk/tm/java/utility/struct/Struct.java +17 -4
- package/project/.sdk/tm/js/src/utility/StructUtility.js +3 -3
- package/project/.sdk/tm/js/test/omni.js +251 -0
- package/project/.sdk/tm/js/test/omni.test.js +105 -0
- package/project/.sdk/tm/js/test/utility/PrimaryUtility.test.js +6 -2
- package/project/.sdk/tm/js/test/utility/StructUtility.test.js +27 -2
- package/project/.sdk/tm/js/test/vendor/omni/index.js +77 -0
- package/project/.sdk/tm/js/test/vendor/omni/runner.js +628 -0
- package/project/.sdk/tm/js/test/vendor/omni/util.js +229 -0
- package/project/.sdk/tm/kotlin/core/Utility.kt +1 -1
- package/project/.sdk/tm/kotlin/test/OmniResolver.kt +343 -0
- package/project/.sdk/tm/kotlin/test/OmniSmokeTest.kt +100 -0
- package/project/.sdk/tm/kotlin/test/PrimaryUtilityTest.kt +244 -262
- package/project/.sdk/tm/kotlin/test/RunnerSupport.kt +9 -178
- package/project/.sdk/tm/kotlin/test/StructCorpusTest.kt +121 -32
- package/project/.sdk/tm/kotlin/test/vendor/omni/Json.kt +264 -0
- package/project/.sdk/tm/kotlin/test/vendor/omni/Runner.kt +615 -0
- package/project/.sdk/tm/kotlin/test/vendor/omni/Util.kt +139 -0
- package/project/.sdk/tm/kotlin/utility/MakeSpecUrl.kt +6 -3
- package/project/.sdk/tm/kotlin/utility/Prepare.kt +6 -6
- package/project/.sdk/tm/kotlin/utility/struct/Struct.kt +18 -2
- package/project/.sdk/tm/lean/Makefile +12 -5
- package/project/.sdk/tm/lean/src/SdkUtility.lean +14 -1
- package/project/.sdk/tm/lean/test/OmniResolver.lean +358 -0
- package/project/.sdk/tm/lean/test/OmniSmoke.lean +174 -0
- package/project/.sdk/tm/lean/test/StructCorpus.lean +245 -574
- package/project/.sdk/tm/lean/test/TPrimaryUtility.lean +155 -291
- package/project/.sdk/tm/lean/test/vendor/omni/Omni.lean +997 -0
- package/project/.sdk/tm/lua/test/omni.lua +456 -0
- package/project/.sdk/tm/lua/test/omni_smoke_test.lua +103 -0
- package/project/.sdk/tm/lua/test/primary_utility_test.lua +250 -509
- package/project/.sdk/tm/lua/test/struct_utility_test.lua +161 -70
- package/project/.sdk/tm/lua/test/vendor/omni/json.lua +268 -0
- package/project/.sdk/tm/lua/test/vendor/omni/regex.lua +385 -0
- package/project/.sdk/tm/lua/test/vendor/omni/runner.lua +641 -0
- package/project/.sdk/tm/lua/test/vendor/omni/util.lua +282 -0
- package/project/.sdk/tm/lua/utility/prepare_method.lua +5 -1
- package/project/.sdk/tm/lua/utility/struct/regex.lua +663 -0
- package/project/.sdk/tm/lua/utility/struct/struct.lua +660 -420
- package/project/.sdk/tm/ocaml/Makefile +37 -12
- package/project/.sdk/tm/ocaml/test/omni_resolver.ml +284 -0
- package/project/.sdk/tm/ocaml/test/omni_smoke_test.ml +169 -0
- package/project/.sdk/tm/ocaml/test/primary_utility_test.ml +84 -100
- package/project/.sdk/tm/ocaml/test/struct_corpus.ml +225 -201
- package/project/.sdk/tm/ocaml/test/vendor/omni/omni.ml +1157 -0
- package/project/.sdk/tm/perl/lib/Voxgig/Struct.pm +88 -12
- package/project/.sdk/tm/perl/t/omni.pm +647 -0
- package/project/.sdk/tm/perl/t/omni_smoke.t +87 -0
- package/project/.sdk/tm/perl/t/primary_utility.t +189 -487
- package/project/.sdk/tm/perl/t/struct_utility.t +455 -389
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Runner.pm +649 -0
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Util.pm +253 -0
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni.pm +24 -0
- package/project/.sdk/tm/perl/utility/prepare_method.pm +7 -2
- package/project/.sdk/tm/php/test/Omni.php +691 -0
- package/project/.sdk/tm/php/test/OmniSmokeTest.php +93 -0
- package/project/.sdk/tm/php/test/PrimaryUtilityTest.php +210 -571
- package/project/.sdk/tm/php/test/StructUtilityTest.php +320 -342
- package/project/.sdk/tm/php/test/vendor/omni/Runner.php +644 -0
- package/project/.sdk/tm/php/test/vendor/omni/Util.php +283 -0
- package/project/.sdk/tm/php/utility/MakeSpec.php +10 -3
- package/project/.sdk/tm/php/utility/PrepareBody.php +7 -1
- package/project/.sdk/tm/php/utility/PrepareMethod.php +6 -2
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/__init__.py +36 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/capability.py +141 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/catalog.py +50 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/config.py +333 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/depend.py +198 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/env.py +147 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/export.py +52 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/graph.py +139 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/host.py +1053 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/order.py +171 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/point.py +95 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/ref.py +116 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/resolve.py +59 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/types.py +87 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/version.py +112 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/__init__.py +76 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/addr.py +116 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/aws.py +192 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/azuresecrets.py +120 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/boru.py +140 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/doppler.py +62 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/gcpsecrets.py +101 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/hashicorp.py +151 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/httpjson.py +115 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/infisical.py +90 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/onepassword.py +101 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/secretspec.py +119 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/sigv4.py +125 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/providers.py +211 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/sekreto.py +475 -0
- package/project/.sdk/tm/py/pkg/feature/secrets_feature.py +467 -0
- package/project/.sdk/tm/py/pkg/utility/prepare_method.py +5 -1
- package/project/.sdk/tm/py/pkg/utility/voxgig_struct/__init__.py +0 -2
- package/project/.sdk/tm/py/pkg/utility/voxgig_struct/voxgig_struct.py +780 -529
- package/project/.sdk/tm/py/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/py/test/feature/__init__.py +0 -0
- package/project/.sdk/tm/py/test/feature/secrets/__init__.py +0 -0
- package/project/.sdk/tm/py/test/feature/secrets/test_secrets.py +337 -0
- package/project/.sdk/tm/py/test/omni.py +415 -0
- package/project/.sdk/tm/py/test/test_omni_smoke.py +74 -0
- package/project/.sdk/tm/py/test/test_primary_utility.py +144 -668
- package/project/.sdk/tm/py/test/test_struct_utility.py +74 -27
- package/project/.sdk/tm/py/test/voxgig_omni/__init__.py +62 -0
- package/project/.sdk/tm/py/test/voxgig_omni/runner.py +580 -0
- package/project/.sdk/tm/py/test/voxgig_omni/util.py +252 -0
- package/project/.sdk/tm/rb/test/omni.rb +505 -0
- package/project/.sdk/tm/rb/test/omni_smoke_test.rb +72 -0
- package/project/.sdk/tm/rb/test/primary_utility_test.rb +174 -560
- package/project/.sdk/tm/rb/test/struct_utility_test.rb +13 -7
- package/project/.sdk/tm/rb/test/vendor/omni/runner.rb +493 -0
- package/project/.sdk/tm/rb/test/vendor/omni/util.rb +199 -0
- package/project/.sdk/tm/rb/test/vendor/omni/voxgig_omni.rb +15 -0
- package/project/.sdk/tm/rb/utility/prepare_method.rb +5 -1
- package/project/.sdk/tm/rust/tests/common/mod.rs +19 -242
- package/project/.sdk/tm/rust/tests/omni_resolver/mod.rs +888 -0
- package/project/.sdk/tm/rust/tests/omni_smoke_test.rs +286 -0
- package/project/.sdk/tm/rust/tests/primary_utility_test.rs +318 -312
- package/project/.sdk/tm/rust/tests/struct_utility_test.rs +66 -28
- package/project/.sdk/tm/rust/tests/vendor/omni/json.rs +412 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/mod.rs +38 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/regex.rs +392 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/runner.rs +1001 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/util.rs +161 -0
- package/project/.sdk/tm/rust/utility/prepare_method.rs +5 -1
- package/project/.sdk/tm/scala/Makefile +16 -6
- package/project/.sdk/tm/scala/sdktest/OmniResolver.scala +497 -0
- package/project/.sdk/tm/scala/sdktest/OmniSmoke.scala +192 -0
- package/project/.sdk/tm/scala/sdktest/PrimaryCorpus.scala +47 -19
- package/project/.sdk/tm/scala/sdktest/StructCorpus.scala +0 -0
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Json.scala +229 -0
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Runner.scala +552 -0
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Util.scala +104 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Constants.swift +10 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Inject.swift +28 -5
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Injection.swift +5 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Minor.swift +4 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Validate.swift +15 -5
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Prepare.swift +6 -1
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniResolver.swift +474 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniSmokeTest.swift +107 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +141 -178
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/Runner.swift +17 -113
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/StructUtilityTest.swift +295 -446
- package/project/.sdk/tm/swift/Tests/vendor/omni/Json.swift +364 -0
- package/project/.sdk/tm/swift/Tests/vendor/omni/Runner.swift +730 -0
- package/project/.sdk/tm/swift/Tests/vendor/omni/Util.swift +162 -0
- package/project/.sdk/tm/ts/src/feature/secrets/SecretsFeature.ts +7 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Capability.ts +148 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Catalog.ts +55 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Config.ts +344 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Depend.ts +205 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Env.ts +138 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Export.ts +46 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/FeatureHost.ts +349 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Graph.ts +181 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Host.ts +1132 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Order.ts +177 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Point.ts +119 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Ref.ts +102 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Resolve.ts +61 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Types.ts +112 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Version.ts +100 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/index.ts +37 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/Sekreto.ts +163 -30
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/index.ts +27 -22
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/aws.ts +26 -36
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/azuresecrets.ts +19 -21
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/boru.ts +36 -17
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/doppler.ts +14 -21
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/gcpsecrets.ts +27 -27
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/hashicorp.ts +25 -39
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/httpjson.ts +99 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/infisical.ts +14 -16
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/onepassword.ts +15 -22
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/secretspec.ts +98 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{Sigv4.ts → plugins/sigv4.ts} +7 -6
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/addr.ts +97 -23
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/builtin.ts +37 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/dotenv.ts +4 -17
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/env.ts +4 -16
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/file.ts +11 -25
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/memory.ts +6 -23
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/support.ts +106 -39
- package/project/.sdk/tm/ts/src/utility/StructUtility.ts +3 -3
- package/project/.sdk/tm/ts/test/omni.ts +104 -32
- package/project/.sdk/tm/ts/test/utility/StructUtility.test.ts +27 -0
- package/project/.sdk/tm/ts/test/vendor/omni/Runner.ts +32 -5
- package/project/.sdk/tm/ts/test/vendor/omni/Util.ts +2 -2
- package/project/.sdk/tm/ts/test/vendor/omni/index.ts +2 -2
- package/project/.sdk/tm/zig/Makefile +15 -1
- package/project/.sdk/tm/zig/build.zig +23 -5
- package/project/.sdk/tm/zig/core/helpers.zig +52 -11
- package/project/.sdk/tm/zig/core/mem.zig +17 -1
- package/project/.sdk/tm/zig/core/utility.zig +23 -19
- package/project/.sdk/tm/zig/feature/audit.zig +2 -2
- package/project/.sdk/tm/zig/feature/cache.zig +2 -2
- package/project/.sdk/tm/zig/feature/debug.zig +5 -5
- package/project/.sdk/tm/zig/feature/netsim.zig +2 -2
- package/project/.sdk/tm/zig/feature/paging.zig +2 -2
- package/project/.sdk/tm/zig/feature/proxy.zig +15 -8
- package/project/.sdk/tm/zig/feature/streaming.zig +5 -5
- package/project/.sdk/tm/zig/feature/support.zig +3 -3
- package/project/.sdk/tm/zig/feature/telemetry.zig +5 -5
- package/project/.sdk/tm/zig/feature/test.zig +10 -5
- package/project/.sdk/tm/zig/test/fh.zig +10 -10
- package/project/.sdk/tm/zig/test/gotcha_test.zig +5 -5
- package/project/.sdk/tm/zig/test/omniresolver.zig +515 -0
- package/project/.sdk/tm/zig/test/omnismoke_test.zig +284 -0
- package/project/.sdk/tm/zig/test/pipeline_test.zig +8 -8
- package/project/.sdk/tm/zig/test/primary_utility_test.zig +145 -155
- package/project/.sdk/tm/zig/test/struct_corpus.zig +264 -187
- package/project/.sdk/tm/zig/test/vendor/omni/omni.zig +1314 -0
- package/project/.sdk/tm/zig/test/vendor/omni/regex.zig +446 -0
- package/project/.sdk/tm/zig/utility/voxgigstruct/regex.zig +7 -4
- package/project/.sdk/tm/zig/utility/voxgigstruct/struct.zig +356 -157
- package/project/sdkgen-package.json +1 -1
- package/src/action/doctor.ts +66 -2
- package/src/helpers/naming.ts +4 -2
- package/project/.sdk/tm/c/tests/runner.h +0 -274
- package/project/.sdk/tm/cpp/test/struct_runner.hpp +0 -314
- package/project/.sdk/tm/csharp/test/StructRunner.cs +0 -276
- package/project/.sdk/tm/dart/test/runner.dart +0 -406
- package/project/.sdk/tm/dart/test/struct_corpus.dart +0 -531
- package/project/.sdk/tm/elixir/test/support/struct_corpus.ex +0 -1088
- package/project/.sdk/tm/go/test/runner_test.go +0 -629
- package/project/.sdk/tm/go/test/struct_runner_test.go +0 -1094
- package/project/.sdk/tm/java/test/StructRunner.java +0 -281
- package/project/.sdk/tm/js/test/runner.js +0 -387
- package/project/.sdk/tm/kotlin/test/StructRunner.kt +0 -177
- package/project/.sdk/tm/lua/test/struct_runner.lua +0 -602
- package/project/.sdk/tm/ocaml/test/corpus_runner.ml +0 -185
- package/project/.sdk/tm/perl/t/struct_runner.pm +0 -275
- package/project/.sdk/tm/php/test/StructRunner.php +0 -275
- package/project/.sdk/tm/py/test/struct_runner.py +0 -411
- package/project/.sdk/tm/rb/test/struct_runner.rb +0 -309
- package/project/.sdk/tm/rust/tests/struct_runner/mod.rs +0 -424
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/Registry.ts +0 -90
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/http.ts +0 -66
- package/project/.sdk/tm/ts/test/vendor/omni/compat.ts +0 -188
- package/project/.sdk/tm/zig/test/struct_runner.zig +0 -464
|
@@ -0,0 +1,751 @@
|
|
|
1
|
+
// VENDORED: @voxgig/omni sdk-20260907-0029-0 (cpp/src/omni.hpp)
|
|
2
|
+
// Source: https://github.com/voxgig/omni @ 274708cc2d12b21707d975543953f845f8444be0 [tag: sdk-20260907-0029-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
// Omni: the shared multi-language test runner (C++ port).
|
|
5
|
+
//
|
|
6
|
+
// A test spec is plain JSON. The same spec file drives the same tests in
|
|
7
|
+
// every language that ships an omni port.
|
|
8
|
+
//
|
|
9
|
+
// Port of the canonical TypeScript implementation
|
|
10
|
+
// (typescript/src/Runner.ts). Behaviour must match, case for case.
|
|
11
|
+
//
|
|
12
|
+
// Header-only, C++17, standard library only.
|
|
13
|
+
|
|
14
|
+
#ifndef VOXGIG_OMNI_HPP
|
|
15
|
+
#define VOXGIG_OMNI_HPP
|
|
16
|
+
|
|
17
|
+
#include <algorithm>
|
|
18
|
+
#include <cmath>
|
|
19
|
+
#include <functional>
|
|
20
|
+
#include <map>
|
|
21
|
+
#include <memory>
|
|
22
|
+
#include <regex>
|
|
23
|
+
#include <stdexcept>
|
|
24
|
+
#include <string>
|
|
25
|
+
#include <vector>
|
|
26
|
+
|
|
27
|
+
#include "json.hpp"
|
|
28
|
+
#include "util.hpp"
|
|
29
|
+
|
|
30
|
+
namespace omni {
|
|
31
|
+
|
|
32
|
+
// The function under test. Arguments arrive as JSON values; failure is
|
|
33
|
+
// reported by throwing.
|
|
34
|
+
using Subject = std::function<Json(const std::vector<Json>&)>;
|
|
35
|
+
|
|
36
|
+
// A subject that may MUTATE its arguments, which `match.args` can then assert
|
|
37
|
+
// on. `minor/setpath` is the case in point: eight of its nine entries assert
|
|
38
|
+
// that the store was rewritten in place, and `merge/integrity` all six.
|
|
39
|
+
//
|
|
40
|
+
// Separate from `Subject` rather than replacing it, because a signature change
|
|
41
|
+
// would break every consumer for a capability most subjects do not need. A
|
|
42
|
+
// subject that only reads its arguments keeps using `Subject`.
|
|
43
|
+
//
|
|
44
|
+
// Dynamic-language ports have no equivalent: their shims write the mutation
|
|
45
|
+
// back into omni's own object after the call, because the value is shared. A
|
|
46
|
+
// C++ consumer holds a converted COPY and cannot - `Json` is a value type.
|
|
47
|
+
using SubjectArgs = std::function<Json(std::vector<Json>&)>;
|
|
48
|
+
|
|
49
|
+
// A test failure (or a malformed spec). Distinct from an exception thrown
|
|
50
|
+
// by the subject under test, which is a candidate for an `err` expectation.
|
|
51
|
+
class OmniError : public std::runtime_error {
|
|
52
|
+
public:
|
|
53
|
+
explicit OmniError(const std::string& message) : std::runtime_error(message) {}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// Run-time options for a set of test entries.
|
|
57
|
+
struct Flags {
|
|
58
|
+
bool null = true; // Convert JSON nulls to NULLMARK.
|
|
59
|
+
std::string name; // Label used in failure messages.
|
|
60
|
+
|
|
61
|
+
static Flags nonull() {
|
|
62
|
+
Flags flags;
|
|
63
|
+
flags.null = false;
|
|
64
|
+
return flags;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
// The host of the system under test. Every hook is optional.
|
|
69
|
+
struct Provider {
|
|
70
|
+
// Resolve a test subject by name.
|
|
71
|
+
std::function<Subject(const std::string&)> subject;
|
|
72
|
+
// Build a sub-provider from a DEF.client entry's options.
|
|
73
|
+
std::function<std::shared_ptr<Provider>(const Json&)> client;
|
|
74
|
+
// Wrap a map argument as a call context.
|
|
75
|
+
std::function<Json(const Json&)> contextify;
|
|
76
|
+
// Resolve references in client options against the store.
|
|
77
|
+
std::function<Json(const Json&, const Json&)> inject;
|
|
78
|
+
// Build the `match.err` base from the failure, REPLACING `errify`.
|
|
79
|
+
//
|
|
80
|
+
// C++ reports a subject failure as its message and nothing else, so a
|
|
81
|
+
// library whose errors carry a code has no other way to put one in the
|
|
82
|
+
// base. The hook receives that message and returns the base, letting a
|
|
83
|
+
// spec assert `match: {err: {code: "x"}}` instead of pattern-matching
|
|
84
|
+
// prose. Empty for the default.
|
|
85
|
+
std::function<Json(const std::string&)> errify;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// The newest spec format version this runner understands. A spec with no
|
|
89
|
+
// OMNI block is version 0: the original, lenient format, frozen forever.
|
|
90
|
+
// Version 1 turns on strict entry validation (see checkentry).
|
|
91
|
+
inline const int SPECVERSION = 1;
|
|
92
|
+
|
|
93
|
+
// Capability strings this runner supports beyond the version baseline. A
|
|
94
|
+
// spec's OMNI.requires list is checked against this: an unknown capability
|
|
95
|
+
// refuses the spec loudly at load time, instead of a lagging port silently
|
|
96
|
+
// mis-running it. (Empty today; future format features mint a string here.)
|
|
97
|
+
inline const std::vector<std::string> CAPABILITIES = {};
|
|
98
|
+
|
|
99
|
+
// The complete set of fields an entry may carry. Under version 1 anything
|
|
100
|
+
// else is an error: an unrecognised key is almost always a typo'd
|
|
101
|
+
// assertion, and a typo'd assertion is a test that silently stopped
|
|
102
|
+
// testing.
|
|
103
|
+
inline const std::vector<std::string> ENTRYFIELDS = {
|
|
104
|
+
"in", "args", "ctx", "out", "err", "match", "client", "id", "doc"};
|
|
105
|
+
|
|
106
|
+
// Read the spec's format version from its optional top-level OMNI block,
|
|
107
|
+
// and refuse a spec this runner cannot faithfully run: a version newer
|
|
108
|
+
// than SPECVERSION, or a required capability not in CAPABILITIES.
|
|
109
|
+
inline int resolveversion(const Json& alltests) {
|
|
110
|
+
Json meta = alltests.ismap() ? alltests.get("OMNI") : Json::absent();
|
|
111
|
+
|
|
112
|
+
if (meta.isabsent()) {
|
|
113
|
+
return 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
Json version = meta.get("version");
|
|
117
|
+
if (!meta.ismap() || !version.isnum() || version.numval != std::floor(version.numval)) {
|
|
118
|
+
throw OmniError("omni: malformed OMNI version block");
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (version.numval < 0 || SPECVERSION < version.numval) {
|
|
122
|
+
throw OmniError("omni: unsupported spec version: " + numstr(version.numval));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
Json reqlist = meta.get("requires");
|
|
126
|
+
if (!reqlist.isabsent()) {
|
|
127
|
+
if (!reqlist.islist()) {
|
|
128
|
+
throw OmniError("omni: malformed OMNI requires list");
|
|
129
|
+
}
|
|
130
|
+
for (const auto& cap : reqlist.listval) {
|
|
131
|
+
bool known = cap.isstr() &&
|
|
132
|
+
CAPABILITIES.end() != std::find(CAPABILITIES.begin(), CAPABILITIES.end(), cap.strval);
|
|
133
|
+
if (!known) {
|
|
134
|
+
throw OmniError("omni: spec requires unsupported capability: " + stringify(cap));
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return static_cast<int>(version.numval);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// ---- internals -------------------------------------------------------
|
|
143
|
+
|
|
144
|
+
// Nulls (and absent values) become NULLMARK. Always a fresh copy.
|
|
145
|
+
inline Json fixjson(const Json& val, bool donull) {
|
|
146
|
+
if (val.isnone()) {
|
|
147
|
+
// Canonical returns the value UNCHANGED when donull is false
|
|
148
|
+
// (typescript/src/Runner.ts): absent stays absent and null stays null.
|
|
149
|
+
// Answering null for both collapsed two states the corpus distinguishes,
|
|
150
|
+
// so a subject that correctly returned nothing was compared against null
|
|
151
|
+
// and marked wrong. Same defect the other ports carried (voxgig/omni#17,
|
|
152
|
+
// #23); this one was missed because no consumer had exercised it.
|
|
153
|
+
return donull ? Json::str(NULLMARK) : val;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (val.islist()) {
|
|
157
|
+
Json out = Json::list();
|
|
158
|
+
for (const auto& entry : val.listval) {
|
|
159
|
+
out.push(fixjson(entry, donull));
|
|
160
|
+
}
|
|
161
|
+
return out;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (val.ismap()) {
|
|
165
|
+
Json out = Json::map();
|
|
166
|
+
for (const auto& entry : val.mapval) {
|
|
167
|
+
out.set(entry.first, fixjson(entry.second, donull));
|
|
168
|
+
}
|
|
169
|
+
return out;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return val;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// The JSON form of an error: always at least {name,message}.
|
|
176
|
+
inline Json errify(const std::string& message) {
|
|
177
|
+
Json out = Json::map();
|
|
178
|
+
out.set("name", Json::str("Error"));
|
|
179
|
+
out.set("message", Json::str(message));
|
|
180
|
+
return out;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// The spec-defined part of an entry (drop runner bookkeeping).
|
|
184
|
+
inline Json entrysummary(const Json& entry) {
|
|
185
|
+
if (!entry.ismap()) {
|
|
186
|
+
return entry;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
Json out = Json::map();
|
|
190
|
+
for (const auto& field : entry.mapval) {
|
|
191
|
+
if ("res" != field.first && "thrown" != field.first && "ctx" != field.first) {
|
|
192
|
+
out.set(field.first, field.second);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return out;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// The label of one entry, for failure messages.
|
|
199
|
+
inline std::string entryref(const Flags& flags, size_t index, const Json& entry) {
|
|
200
|
+
std::string label = flags.name.empty() ? "set" : flags.name;
|
|
201
|
+
Json id = entry.get("id");
|
|
202
|
+
std::string idpart = id.isabsent() ? "" : " (" + stringify(id) + ")";
|
|
203
|
+
return label + "[" + std::to_string(index) + "]" + idpart;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
inline OmniError fail(const Flags& flags, size_t index, const Json& entry,
|
|
207
|
+
const std::string& reason, const std::string* expected = nullptr,
|
|
208
|
+
const std::string* actual = nullptr) {
|
|
209
|
+
std::string message = "omni: " + entryref(flags, index, entry) + ": " + reason;
|
|
210
|
+
|
|
211
|
+
if (nullptr != expected) {
|
|
212
|
+
message += "\n expected: " + *expected;
|
|
213
|
+
}
|
|
214
|
+
if (nullptr != actual) {
|
|
215
|
+
message += "\n actual: " + *actual;
|
|
216
|
+
}
|
|
217
|
+
message += "\n entry: " + stringify(entrysummary(entry));
|
|
218
|
+
|
|
219
|
+
return OmniError(message);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// Strict entry validation, applied when the spec declares version 1 or
|
|
223
|
+
// later. The lenient format converts each of these mistakes into a silent
|
|
224
|
+
// pass or a dead field; here they fail with the entry named.
|
|
225
|
+
inline void checkentry(const Flags& flags, size_t index, const Json& entry) {
|
|
226
|
+
if (!entry.ismap()) {
|
|
227
|
+
throw fail(flags, index, entry, "entry is not a map");
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
for (const auto& field : entry.mapval) {
|
|
231
|
+
if (ENTRYFIELDS.end() == std::find(ENTRYFIELDS.begin(), ENTRYFIELDS.end(), field.first)) {
|
|
232
|
+
throw fail(flags, index, entry, "unknown entry field: " + field.first);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
int argsources = 0;
|
|
237
|
+
for (const char* key : {"in", "args", "ctx"}) {
|
|
238
|
+
if (entry.has(key)) {
|
|
239
|
+
argsources++;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
if (1 < argsources) {
|
|
243
|
+
throw fail(flags, index, entry, "entry has more than one of in, args, ctx");
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
if (!entry.get("err").isnone() && entry.has("out")) {
|
|
247
|
+
throw fail(flags, index, entry, "entry has both err and out");
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// Presence, not definedness: a present `id: null` is malformed, not a
|
|
251
|
+
// sentinel to skip. Test against genuine absence, never `isnone()`.
|
|
252
|
+
Json id = entry.get("id");
|
|
253
|
+
if (!id.isabsent() && !id.isstr()) {
|
|
254
|
+
throw fail(flags, index, entry, "entry id is not a string");
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// Validate a version-1 group up front, against the AUTHORED entries -
|
|
259
|
+
// null-normalisation would otherwise rewrite an authored null (e.g.
|
|
260
|
+
// id: null) into a sentinel string and hide it from validation. A
|
|
261
|
+
// malformed spec is a spec error, not a test result, so it fails before
|
|
262
|
+
// any subject runs. Absorbs the empty-set check too.
|
|
263
|
+
inline void checkset(const Flags& flags, const Json& testspec, const Json& normalset) {
|
|
264
|
+
Json rawset = testspec.ismap() ? testspec.get("set") : Json::absent();
|
|
265
|
+
Json origset = rawset.islist() ? rawset : normalset;
|
|
266
|
+
|
|
267
|
+
Json emptyflag = testspec.ismap() ? testspec.get("empty") : Json::absent();
|
|
268
|
+
bool marked = emptyflag.isbool() && emptyflag.boolval;
|
|
269
|
+
|
|
270
|
+
if (origset.listval.empty() && !marked) {
|
|
271
|
+
throw OmniError("omni: empty test set: " + flags.name);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
for (size_t index = 0; index < origset.listval.size(); index++) {
|
|
275
|
+
checkentry(flags, index, origset.listval[index]);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// An entry with no `out` expects a null (or absent) result.
|
|
280
|
+
inline void resolveentry(Json& entry, const Flags& flags) {
|
|
281
|
+
if (flags.null && entry.get("out").isnone()) {
|
|
282
|
+
entry.set("out", Json::str(NULLMARK));
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// Match one leaf: /regex/ or case-insensitive substring for strings.
|
|
287
|
+
inline bool matchval(const Json& check, const Json& base) {
|
|
288
|
+
if (deepequal(check, base)) {
|
|
289
|
+
return true;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
Json want = check;
|
|
293
|
+
if (want.isstr() && (UNDEFMARK == want.strval || NULLMARK == want.strval)) {
|
|
294
|
+
want = Json::null();
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (want.isnone()) {
|
|
298
|
+
return base.isnone() || (base.isstr() && NULLMARK == base.strval);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if (want.isstr()) {
|
|
302
|
+
std::string basestr = stringify(base);
|
|
303
|
+
const std::string& text = want.strval;
|
|
304
|
+
|
|
305
|
+
// An empty want is a substring of everything, so it would match any
|
|
306
|
+
// value. Require the base to be the empty string too.
|
|
307
|
+
if (text.empty()) {
|
|
308
|
+
return base.isstr() && base.strval.empty();
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
if (2 < text.size() && '/' == text.front() && '/' == text.back()) {
|
|
312
|
+
try {
|
|
313
|
+
std::regex pattern(text.substr(1, text.size() - 2), std::regex::ECMAScript);
|
|
314
|
+
return std::regex_search(basestr, pattern);
|
|
315
|
+
} catch (const std::regex_error&) {
|
|
316
|
+
return false;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
std::string lowbase = basestr;
|
|
321
|
+
std::string lowwant = text;
|
|
322
|
+
std::transform(lowbase.begin(), lowbase.end(), lowbase.begin(), ::tolower);
|
|
323
|
+
std::transform(lowwant.begin(), lowwant.end(), lowwant.begin(), ::tolower);
|
|
324
|
+
|
|
325
|
+
return std::string::npos != lowbase.find(lowwant);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
return deepequal(want, base);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
// Check that every leaf of `check` is present, and matches, in `base`.
|
|
332
|
+
inline void matchcheck(const Flags& flags, size_t index, const Json& entry, const Json& check,
|
|
333
|
+
const Json& base, std::vector<std::string> path = {}) {
|
|
334
|
+
if (check.islist()) {
|
|
335
|
+
for (size_t at = 0; at < check.listval.size(); at++) {
|
|
336
|
+
std::vector<std::string> childpath = path;
|
|
337
|
+
childpath.push_back(std::to_string(at));
|
|
338
|
+
matchcheck(flags, index, entry, check.listval[at], base, childpath);
|
|
339
|
+
}
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
if (check.ismap()) {
|
|
344
|
+
for (const auto& field : check.mapval) {
|
|
345
|
+
std::vector<std::string> childpath = path;
|
|
346
|
+
childpath.push_back(field.first);
|
|
347
|
+
matchcheck(flags, index, entry, field.second, base, childpath);
|
|
348
|
+
}
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
Json baseval = getpath(base, path);
|
|
353
|
+
std::string where = path.empty() ? "<root>" : pathify(path);
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
// The sentinels are tested BEFORE the identity check below. Otherwise
|
|
357
|
+
// a subject returning the literal string "__UNDEF__" satisfies an
|
|
358
|
+
// assertion that the key is absent - two mutually exclusive states
|
|
359
|
+
// passing one check. A sentinel that accepts its own literal is not a
|
|
360
|
+
// sentinel. (NULLMARK still accepts NULLMARK: under the default null
|
|
361
|
+
// flag a real null has already been normalised to it, so the two are
|
|
362
|
+
// genuinely indistinguishable here - that one needs a raw-value
|
|
363
|
+
// escape, not an ordering change.)
|
|
364
|
+
|
|
365
|
+
// Explicitly absent: satisfied only by a genuinely missing key, never
|
|
366
|
+
// by a present null (the distinction the sentinels exist to keep).
|
|
367
|
+
if (check.isstr() && UNDEFMARK == check.strval) {
|
|
368
|
+
if (baseval.isabsent()) {
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
std::string expected = "absent";
|
|
372
|
+
std::string actual = stringify(baseval);
|
|
373
|
+
throw fail(flags, index, entry, "expected absent at " + where, &expected, &actual);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
// Explicitly null: satisfied only by a present null.
|
|
377
|
+
if (check.isstr() && NULLMARK == check.strval) {
|
|
378
|
+
if (baseval.isnull() || (baseval.isstr() && NULLMARK == baseval.strval)) {
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
std::string expected = "null";
|
|
382
|
+
std::string actual = stringify(baseval);
|
|
383
|
+
throw fail(flags, index, entry, "expected null at " + where, &expected, &actual);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
// Explicitly present: any present value, including null.
|
|
387
|
+
if (check.isstr() && EXISTSMARK == check.strval) {
|
|
388
|
+
if (!baseval.isabsent()) {
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
std::string expected = "present";
|
|
392
|
+
std::string actual = "absent";
|
|
393
|
+
throw fail(flags, index, entry, "expected present at " + where, &expected, &actual);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
// Identical values match. This sits below the sentinel branches on
|
|
397
|
+
// purpose - see the note above.
|
|
398
|
+
if (deepequal(check, baseval)) {
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// A concrete expectation never matches a missing key - a match leaf
|
|
403
|
+
// against an absent value must fail, not substring-match "undefined".
|
|
404
|
+
if (baseval.isabsent()) {
|
|
405
|
+
std::string expected = stringify(check);
|
|
406
|
+
std::string actual = "absent";
|
|
407
|
+
throw fail(flags, index, entry, "match failed at " + where, &expected, &actual);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
if (matchval(check, baseval)) {
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
std::string expected = stringify(check);
|
|
415
|
+
std::string actual = stringify(baseval);
|
|
416
|
+
|
|
417
|
+
throw fail(flags, index, entry, "match failed at " + where, &expected, &actual);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// ---- runner ----------------------------------------------------------
|
|
421
|
+
|
|
422
|
+
class RunPack {
|
|
423
|
+
public:
|
|
424
|
+
Json spec;
|
|
425
|
+
Subject subject;
|
|
426
|
+
std::shared_ptr<Provider> client;
|
|
427
|
+
|
|
428
|
+
RunPack(const Json& spec, const Subject& subject, const std::shared_ptr<Provider>& provider,
|
|
429
|
+
const std::map<std::string, std::shared_ptr<Provider>>& clients,
|
|
430
|
+
const std::string& name, int specversion)
|
|
431
|
+
: spec(spec), subject(subject), client(provider), provider_(provider), clients_(clients),
|
|
432
|
+
name_(name), specversion_(specversion) {}
|
|
433
|
+
|
|
434
|
+
// A named group of the resolved spec.
|
|
435
|
+
Json set(const std::string& name) const { return spec.get(name); }
|
|
436
|
+
|
|
437
|
+
// Run one set of test entries.
|
|
438
|
+
void runset(const Json& testspec, const Subject& testsubject = nullptr) const {
|
|
439
|
+
runsetflags(testspec, Flags(), testsubject);
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
// Run one set of test entries with flags.
|
|
443
|
+
void runsetflags(const Json& testspec, Flags flags,
|
|
444
|
+
const Subject& testsubject = nullptr) const {
|
|
445
|
+
const Subject& usesubject = testsubject ? testsubject : subject;
|
|
446
|
+
SubjectArgs wrapped;
|
|
447
|
+
if (usesubject) {
|
|
448
|
+
wrapped = [&usesubject](std::vector<Json>& args) { return usesubject(args); };
|
|
449
|
+
}
|
|
450
|
+
drive(testspec, flags, wrapped);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
// Run one set of test entries whose subject may mutate its arguments.
|
|
454
|
+
// Everything else is identical to `runsetflags`.
|
|
455
|
+
void runsetflags_args(const Json& testspec, Flags flags, const SubjectArgs& testsubject) const {
|
|
456
|
+
drive(testspec, flags, testsubject);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
private:
|
|
460
|
+
void drive(const Json& testspec, Flags flags, const SubjectArgs& usesubject) const {
|
|
461
|
+
if (flags.name.empty()) {
|
|
462
|
+
flags.name = name_.empty() ? "set" : name_;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
if (!usesubject) {
|
|
466
|
+
throw OmniError("omni: no test subject for: " + flags.name);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
Json testspecmap = fixjson(testspec, flags.null);
|
|
470
|
+
Json testset = testspecmap.get("set");
|
|
471
|
+
|
|
472
|
+
if (!testset.islist()) {
|
|
473
|
+
throw OmniError("omni: test spec has no set: " + flags.name);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
// Validated against the AUTHORED (pre-fixjson) group - see checkset.
|
|
477
|
+
if (1 <= specversion_) {
|
|
478
|
+
checkset(flags, testspec, testset);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
for (size_t index = 0; index < testset.listval.size(); index++) {
|
|
482
|
+
Json entry = testset.listval[index];
|
|
483
|
+
|
|
484
|
+
resolveentry(entry, flags);
|
|
485
|
+
|
|
486
|
+
SubjectArgs entrysubject = usesubject;
|
|
487
|
+
Json clientname = entry.get("client");
|
|
488
|
+
|
|
489
|
+
if (clientname.isstr()) {
|
|
490
|
+
auto found = clients_.find(clientname.strval);
|
|
491
|
+
if (clients_.end() == found) {
|
|
492
|
+
throw OmniError("omni: unknown client: " + clientname.strval);
|
|
493
|
+
}
|
|
494
|
+
if (found->second->subject) {
|
|
495
|
+
Subject clientsubject = found->second->subject(name_);
|
|
496
|
+
if (clientsubject) {
|
|
497
|
+
entrysubject = [clientsubject](std::vector<Json>& args) { return clientsubject(args); };
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
std::vector<Json> args = resolveargs(entry);
|
|
503
|
+
|
|
504
|
+
Json res;
|
|
505
|
+
try {
|
|
506
|
+
res = entrysubject(args);
|
|
507
|
+
} catch (const OmniError&) {
|
|
508
|
+
throw;
|
|
509
|
+
} catch (const std::exception& err) {
|
|
510
|
+
handleerror(flags, index, entry, err.what());
|
|
511
|
+
continue;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
res = fixjson(res, flags.null);
|
|
515
|
+
entry.set("res", res);
|
|
516
|
+
|
|
517
|
+
checkresult(flags, index, entry, args, res);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
std::shared_ptr<Provider> provider_;
|
|
522
|
+
std::map<std::string, std::shared_ptr<Provider>> clients_;
|
|
523
|
+
std::string name_;
|
|
524
|
+
int specversion_ = 0;
|
|
525
|
+
|
|
526
|
+
// Build the argument list: `ctx`, `args`, or `in`.
|
|
527
|
+
std::vector<Json> resolveargs(Json& entry) const {
|
|
528
|
+
std::vector<Json> args;
|
|
529
|
+
|
|
530
|
+
bool hasctx = entry.has("ctx");
|
|
531
|
+
bool hasargs = entry.has("args");
|
|
532
|
+
|
|
533
|
+
if (hasctx) {
|
|
534
|
+
args.push_back(entry.get("ctx"));
|
|
535
|
+
} else if (hasargs) {
|
|
536
|
+
Json rawargs = entry.get("args");
|
|
537
|
+
if (rawargs.islist()) {
|
|
538
|
+
args = rawargs.listval;
|
|
539
|
+
} else {
|
|
540
|
+
args.push_back(rawargs);
|
|
541
|
+
}
|
|
542
|
+
} else {
|
|
543
|
+
args.push_back(entry.get("in"));
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
if ((hasctx || hasargs) && !args.empty() && args[0].ismap()) {
|
|
547
|
+
Json first = args[0];
|
|
548
|
+
if (provider_ && provider_->contextify) {
|
|
549
|
+
first = provider_->contextify(first);
|
|
550
|
+
}
|
|
551
|
+
if (first.ismap()) {
|
|
552
|
+
// The resolved client is a live Provider (closures over the system
|
|
553
|
+
// under test), and this port's Json carries no host-object variant
|
|
554
|
+
// to hold one - so canonical's `first.client = testpack.client`
|
|
555
|
+
// becomes presence, not identity: enough for a subject to prove the
|
|
556
|
+
// runner attached a client at all.
|
|
557
|
+
first.set("client", Json::boolean(true));
|
|
558
|
+
}
|
|
559
|
+
args[0] = first;
|
|
560
|
+
entry.set("ctx", first);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
return args;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
void checkresult(const Flags& flags, size_t index, const Json& entry,
|
|
567
|
+
const std::vector<Json>& args, const Json& res) const {
|
|
568
|
+
bool matched = false;
|
|
569
|
+
|
|
570
|
+
Json entryerr = entry.get("err");
|
|
571
|
+
if (!entryerr.isnone()) {
|
|
572
|
+
std::string expected = stringify(entryerr);
|
|
573
|
+
std::string actual = stringify(res);
|
|
574
|
+
throw fail(flags, index, entry, "expected error did not occur", &expected, &actual);
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
Json check = entry.get("match");
|
|
578
|
+
if (!check.isnone()) {
|
|
579
|
+
Json base = Json::map();
|
|
580
|
+
base.set("in", entry.get("in"));
|
|
581
|
+
|
|
582
|
+
Json arglist = Json::list();
|
|
583
|
+
for (const auto& arg : args) {
|
|
584
|
+
arglist.push(arg);
|
|
585
|
+
}
|
|
586
|
+
base.set("args", arglist);
|
|
587
|
+
base.set("out", entry.get("res"));
|
|
588
|
+
base.set("ctx", entry.get("ctx"));
|
|
589
|
+
|
|
590
|
+
matchcheck(flags, index, entry, check, base);
|
|
591
|
+
matched = true;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
Json out = entry.get("out");
|
|
595
|
+
|
|
596
|
+
if (deepequal(res, out)) {
|
|
597
|
+
return;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
// NOTE: a match with no explicit out is a complete check on its own.
|
|
601
|
+
if (matched && (out.isnone() || (out.isstr() && NULLMARK == out.strval))) {
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
std::string expected = stringify(out);
|
|
606
|
+
std::string actual = stringify(res);
|
|
607
|
+
throw fail(flags, index, entry, "result mismatch", &expected, &actual);
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
// The error base a `match.err` sees: the provider's own, when it has one.
|
|
611
|
+
Json errbase(const std::string& message) const {
|
|
612
|
+
if (provider_ && provider_->errify) {
|
|
613
|
+
return provider_->errify(message);
|
|
614
|
+
}
|
|
615
|
+
return errify(message);
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
void handleerror(const Flags& flags, size_t index, const Json& entry,
|
|
619
|
+
const std::string& message) const {
|
|
620
|
+
Json entryerr = entry.get("err");
|
|
621
|
+
|
|
622
|
+
if (!entryerr.isnone()) {
|
|
623
|
+
bool istrue = entryerr.isbool() && entryerr.boolval;
|
|
624
|
+
|
|
625
|
+
if (istrue || matchval(entryerr, Json::str(message))) {
|
|
626
|
+
Json check = entry.get("match");
|
|
627
|
+
if (!check.isnone()) {
|
|
628
|
+
Json base = Json::map();
|
|
629
|
+
base.set("in", entry.get("in"));
|
|
630
|
+
base.set("out", entry.get("res"));
|
|
631
|
+
base.set("ctx", entry.get("ctx"));
|
|
632
|
+
base.set("err", errbase(message));
|
|
633
|
+
matchcheck(flags, index, entry, check, base);
|
|
634
|
+
}
|
|
635
|
+
return;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
std::string expected = stringify(entryerr);
|
|
639
|
+
throw fail(flags, index, entry, "error mismatch", &expected, &message);
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
throw fail(flags, index, entry, "unexpected error", nullptr, &message);
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
|
|
646
|
+
// Load a spec: a path to a JSON file.
|
|
647
|
+
inline Json loadspec(const std::string& path) { return Json::parsefile(path); }
|
|
648
|
+
|
|
649
|
+
// Convert NULLMARK sentinels back into real nulls. Use as a walk callback
|
|
650
|
+
// when a spec value must reach the subject as an actual null.
|
|
651
|
+
inline Json nullmodifier(const Json& val) {
|
|
652
|
+
if (!val.isstr()) {
|
|
653
|
+
return val;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
if (NULLMARK == val.strval) {
|
|
657
|
+
return Json::null();
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
std::string text = val.strval;
|
|
661
|
+
std::string mark = NULLMARK;
|
|
662
|
+
size_t at = text.find(mark);
|
|
663
|
+
while (std::string::npos != at) {
|
|
664
|
+
text = text.substr(0, at) + "null" + text.substr(at + mark.size());
|
|
665
|
+
at = text.find(mark, at + 4);
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
return Json::str(text);
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
// Find `primary.<name>`, then `<name>`, then the whole spec.
|
|
672
|
+
inline Json resolvespec(const std::string& name, const Json& alltests) {
|
|
673
|
+
if (name.empty()) {
|
|
674
|
+
return alltests;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
Json section = alltests.get("primary").get(name);
|
|
678
|
+
if (!section.isabsent()) {
|
|
679
|
+
return section;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
section = alltests.get(name);
|
|
683
|
+
if (!section.isabsent()) {
|
|
684
|
+
return section;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
return alltests;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
// A loaded spec plus its provider.
|
|
691
|
+
class Runner {
|
|
692
|
+
public:
|
|
693
|
+
// Fail fast: resolveversion runs immediately after the spec is loaded, so
|
|
694
|
+
// a version this runner cannot faithfully run is refused before any entry
|
|
695
|
+
// in it gets a chance to run.
|
|
696
|
+
Runner(const Json& alltests, const std::shared_ptr<Provider>& provider)
|
|
697
|
+
: alltests_(alltests),
|
|
698
|
+
specversion_(resolveversion(alltests)),
|
|
699
|
+
provider_(provider ? provider : std::make_shared<Provider>()) {}
|
|
700
|
+
|
|
701
|
+
// Resolve one named section of the spec.
|
|
702
|
+
RunPack runner(const std::string& name, const Json& store = Json::absent()) const {
|
|
703
|
+
Json spec = resolvespec(name, alltests_);
|
|
704
|
+
|
|
705
|
+
std::map<std::string, std::shared_ptr<Provider>> clients;
|
|
706
|
+
|
|
707
|
+
Json defclient = spec.get("DEF").get("client");
|
|
708
|
+
|
|
709
|
+
// A spec may define clients that a given test run never references.
|
|
710
|
+
if (defclient.ismap() && provider_->client) {
|
|
711
|
+
for (const auto& entry : defclient.mapval) {
|
|
712
|
+
Json copts = entry.second.get("test").get("options");
|
|
713
|
+
if (copts.isabsent()) {
|
|
714
|
+
copts = Json::map();
|
|
715
|
+
}
|
|
716
|
+
if (provider_->inject && store.ismap()) {
|
|
717
|
+
copts = provider_->inject(copts, store);
|
|
718
|
+
}
|
|
719
|
+
clients[entry.first] = provider_->client(copts);
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
Subject subject;
|
|
724
|
+
if (provider_->subject && !name.empty()) {
|
|
725
|
+
subject = provider_->subject(name);
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
return RunPack(spec, subject, provider_, clients, name, specversion_);
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
private:
|
|
732
|
+
Json alltests_;
|
|
733
|
+
int specversion_;
|
|
734
|
+
std::shared_ptr<Provider> provider_;
|
|
735
|
+
};
|
|
736
|
+
|
|
737
|
+
// Make a runner for a spec file path and a provider.
|
|
738
|
+
inline Runner makeRunner(const std::string& path,
|
|
739
|
+
const std::shared_ptr<Provider>& provider = nullptr) {
|
|
740
|
+
return Runner(Json::parsefile(path), provider);
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
// Make a runner for an in-memory spec and a provider.
|
|
744
|
+
inline Runner makeRunner(const Json& spec,
|
|
745
|
+
const std::shared_ptr<Provider>& provider = nullptr) {
|
|
746
|
+
return Runner(spec, provider);
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
} // namespace omni
|
|
750
|
+
|
|
751
|
+
#endif // VOXGIG_OMNI_HPP
|