Skip to content

Commit f7902c9

Browse files
committed
added tests/test_json.sh
1 parent b3cde2e commit f7902c9

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

tests/test_json.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
# vim:ts=4:sts=4:sw=4:et
3+
#
4+
# Author: Hari Sekhon
5+
# Date: 2015-11-05 23:29:15 +0000 (Thu, 05 Nov 2015)
6+
#
7+
# https://github.com/harisekhon/pytools
8+
#
9+
# License: see accompanying Hari Sekhon LICENSE file
10+
#
11+
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help improve or steer this or other code I publish
12+
#
13+
# http://www.linkedin.com/in/harisekhon
14+
#
15+
16+
set -eu
17+
srcdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
18+
19+
echo "
20+
# ================== #
21+
# Testing JSON Files
22+
# ================== #
23+
"
24+
25+
cd "$srcdir/..";
26+
27+
. tests/travis.sh
28+
29+
find . -iname '*.json' |
30+
grep -v '/spark-.*-bin-hadoop.*/' |
31+
# ignore multi-line json data file for spark testing
32+
grep -v 'tests/test.json' |
33+
while read jsonFile; do
34+
echo "testing json file: $jsonFile"
35+
python -mjson.tool < "$jsonFile" > /dev/null
36+
done
37+
38+
echo
39+
echo

0 commit comments

Comments
 (0)