source: tests/io/manipulatorsInput-uchunk.extra.sh @ 2980ccb8

Last change on this file since 2980ccb8 was 406c806, checked in by Michael Brooks <mlbrooks@…>, 3 months ago

Attempt to fix Promote build by naming recently added test data files in a more typical way.

  • Property mode set to 100755
File size: 2.4 KB
Line 
1#!/usr/bin/env bash
2
3# A utility for manual ...
4# (a) validation: helping you agree that what's in .expect is right
5# (b) failure replay: helping you debug one subcase, without using parent--child processes
6
7# Usage:
8# mkdir ~/uchunk-temp
9# cd ~/uchunk-temp
10# rm *
11# ~/mywork/cfa-cc/tests/io/manipulatorsInput-uchunk.extra.sh
12# ls
13# diff -y all-noend.expect.txt all-noend.cpp-actual.txt | nl
14# ./uchunk-getline-cfa < ~/mywork/cfa-cc/tests/io/.in/manipulatorsInput-uchunk.getline.1.txt
15
16SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
17cfa=${cfa:-cfa}
18CXX=${CXX:-g++}
19
20set -v
21$CXX -x c++ $SCRIPT_DIR/manipulatorsInput-uchunk.cfa -DIN_DIR=$SCRIPT_DIR/.in/ -o uchunk-all-cpp
22$cfa        $SCRIPT_DIR/manipulatorsInput-uchunk.cfa -DIN_DIR=$SCRIPT_DIR/.in/ -o uchunk-all-cfa
23
24$CXX -x c++ $SCRIPT_DIR/manipulatorsInput-uchunk.cfa -DSUBCASE_ISOLATION=default -o uchunk-default-cpp
25$cfa        $SCRIPT_DIR/manipulatorsInput-uchunk.cfa -DSUBCASE_ISOLATION=default -o uchunk-default-cfa
26$CXX -x c++ $SCRIPT_DIR/manipulatorsInput-uchunk.cfa -DSUBCASE_ISOLATION=getline -o uchunk-getline-cpp
27$cfa        $SCRIPT_DIR/manipulatorsInput-uchunk.cfa -DSUBCASE_ISOLATION=getline -o uchunk-getline-cfa
28
29
30cp $SCRIPT_DIR/.expect/manipulatorsInput-uchunk.txt all.expect.txt
31./uchunk-all-cpp > all.cpp-actual.txt
32./uchunk-all-cfa > all.cfa-actual.txt
33
34sed 's/^END.*/END -/g' < all.expect.txt      > all-noend.expect.txt
35sed 's/^END.*/END -/g' < all.cpp-actual.txt  > all-noend.cpp-actual.txt
36sed 's/^END.*/END -/g' < all.cfa-actual.txt  > all-noend.cfa-actual.txt
37
38ls -v $SCRIPT_DIR/.in/manipulatorsInput-uchunk* | xargs -n 1 -I {} bash -c 'echo {}; printf \"; cat {}; echo \"' > all.in.txt
39
40diff -q all-noend.expect.txt all-noend.cpp-actual.txt
41diff -q all.expect.txt all.cfa-actual.txt
42diff -q all.cpp-actual.txt all.cfa-actual.txt  # noisy: shows getline's cfa--cpp END semantic difference
43diff -q all-noend.cpp-actual.txt all-noend.cfa-actual.txt
44
45ls
46
47set +v
48
49echo Done.  Further useful commands might include:
50echo cat all.in.txt
51echo diff -y all-noend.expect.txt all-noend.cpp-actual.txt '|' nl
52echo diff -y all.expect.txt all.cfa-actual.txt '|' nl
53echo diff -y all.cpp-actual.txt all.cfa-actual.txt '|' nl
54echo diff -y all-noend.cpp-actual.txt all-noend.cfa-actual.txt '|' nl
55echo './uchunk-getline-cfa <' $SCRIPT_DIR/.in/manipulatorsInput-uchunk.getline.1.txt
56echo './uchunk-default-cfa <' $SCRIPT_DIR/.in/manipulatorsInput-uchunk.default.1.txt
Note: See TracBrowser for help on using the repository browser.