File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Generate uniast for all testdata. Must be run from repo root
3+ #
4+ # USAGE:
5+ # 1. Save the uniast to out/
6+ # $ OUTDIR=out/ ./script/run_testdata.sh
7+ #
8+ # 2. Save the uniast to out/ , colorize output for human readable terminal
9+ # OUTDIR=out/ PARALLEL_FLAGS=--ctag ./script/run_testdata.sh
10+ #
11+ # 3. Use a custom abcoder executable
12+ # OUTDIR=out/ ABCEXE="./other_abcoder" ./script/run_testdata.sh
13+
14+ ABCEXE=${ABCEXE:- ./ abcoder}
15+ OUTDIR=${OUTDIR:? Error: OUTDIR is a mandatory environment variable}
16+ PARALLEL_FLAGS=${PARALLEL_FLAGS:- --tag}
17+
18+ LANGS=(go rust python cxx)
19+
20+ detect_jobs () {
21+ local ABCEXE=${1:- $ABCEXE }
22+ for lang in ${LANGS[@]} ; do
23+ for repo in testdata/$lang /* ; do
24+ outname=$( echo $repo | sed ' s/^testdata\///; s/[/:? ]/_/g' )
25+ echo $ABCEXE parse $lang $repo -o $OUTDIR /$outname .json
26+ done
27+ done
28+ }
29+
30+ mkdir -pv " $OUTDIR "
31+ detect_jobs | parallel $PARALLEL_FLAGS echo {}
32+ echo
33+ detect_jobs | parallel $PARALLEL_FLAGS -j$( nproc --all) --jobs 0 " eval {}" 2>&1
You can’t perform that action at this time.
0 commit comments