summaryrefslogtreecommitdiff
path: root/test/integrations/anonymous_parsed/test.sh
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-10-09 01:47:43 -0600
committerJosh Rahm <joshuarahm@gmail.com>2024-10-09 01:47:43 -0600
commit9832f887e1772e1c0f546371584be323ae440fb8 (patch)
treeb17ab95110ca45c673594db21ee2f73042163d1c /test/integrations/anonymous_parsed/test.sh
parentbc404348ec9012eb08e08e29e8caf80dda73247f (diff)
downloadfiddle-9832f887e1772e1c0f546371584be323ae440fb8.tar.gz
fiddle-9832f887e1772e1c0f546371584be323ae440fb8.tar.bz2
fiddle-9832f887e1772e1c0f546371584be323ae440fb8.zip
Add system to spec for running integration shell scirpts.
The spec will recursively go through the test directories and look for `test.sh` files. If it finds one, it will run it. If the script returns 0, then the test passes, otherwise the test fails.
Diffstat (limited to 'test/integrations/anonymous_parsed/test.sh')
-rwxr-xr-xtest/integrations/anonymous_parsed/test.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/integrations/anonymous_parsed/test.sh b/test/integrations/anonymous_parsed/test.sh
new file mode 100755
index 0000000..9bcb6a6
--- /dev/null
+++ b/test/integrations/anonymous_parsed/test.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+source "$(git rev-parse --show-toplevel)/test/integrations/common.sh"
+
+output=$(
+ stack run -- --dump-parsed input.fdl |
+ jq '..
+ | objects
+ | select(._con == "RegisterBitsAnonymousType")
+ | .anonBitsType
+ .anonEnumBody[0]
+ .enumConsts[0]
+ .directedSubtree
+ .enumConstIdent')
+
+assert_eq "$output" '"on"'
+
+finish