tests: cram: add uci import testing on fuzzer corpus
[project/uci.git] / tests / cram / test_uci_import.t
diff --git a/tests/cram/test_uci_import.t b/tests/cram/test_uci_import.t
new file mode 100644 (file)
index 0000000..8d5ab74
--- /dev/null
@@ -0,0 +1,15 @@
+check that uci import is producing expected results:
+
+  $ [ -n "$BUILD_BIN_DIR" ] && export PATH="$BUILD_BIN_DIR:$PATH"
+  $ export TEST_INPUTS="$TESTDIR/inputs"
+  $ export FUZZ_CORPUS="$TESTDIR/../fuzz/corpus"
+
+  $ for file in $(LC_ALL=C find $FUZZ_CORPUS -type f | sort ); do
+  >   valgrind --quiet --leak-check=full uci import -f $file; \
+  > done
+  uci: I/O error
+  uci: Parse error (invalid command) at line 0, byte 0
+  uci: Parse error (invalid command) at line 1, byte 18
+  uci: I/O error
+  uci: I/O error
+  [1]