From 3c2b39a06b80cde1a579c212c8ef42f6a428d66d Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Sun, 22 Nov 2015 20:55:04 +0000 Subject: [PATCH] run_tests.sh: fix the order of files in test results. 'sort' behavior depends on current locale; set 'LC_ALL=C LANG=C' before doing locale-sensitive things. Updated test results. --- re2c/run_tests.sh.in | 10 +++++++--- re2c/test/condition_05.cgitcondition_05.cgit.h.c | 12 ++++++------ re2c/test/condition_05.cgtcondition_05.cgt.h.c | 14 +++++++------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/re2c/run_tests.sh.in b/re2c/run_tests.sh.in index b0740451..9d65ff95 100644 --- a/re2c/run_tests.sh.in +++ b/re2c/run_tests.sh.in @@ -20,6 +20,10 @@ detect_cpu_count () { fi } +lc_run() { + LANG=C LC_ALL=C "$@" +} + valgrind="" skeleton=0 keep_tmp_files=0 @@ -118,7 +122,7 @@ run_pack() { # filename (dot short* (long arg?)*)? ext # must keep to POSIX standard: no syntactic sugar like +,?, etc. # if you change this regexp, try it with 'sed --posix' - local switches=`basename "$x" | LC_ALL=C sed \ + local switches=`basename "$x" | lc_run sed \ -e 's/^[^.]*\.re$//g' \ -e 's/^[^.]*\.\(.*\)\.re$/\1/g' \ -e 's/^\([^-]\)/-\1/' \ @@ -157,9 +161,9 @@ run_pack() { $valgrind $wine ../../$re2c $switches "$outx" 2>"$outc.stderr" 1>&2 # paste all files dropped by re2c into output file rm "$outx" && find . -type f \ - | sort \ + | lc_run sort \ | xargs cat \ - | LC_ALL=C sed -e 's,/\* Generated by re2c .*\*/,/\* Generated by re2c \*/,g' \ + | lc_run sed -e 's,/\* Generated by re2c .*\*/,/\* Generated by re2c \*/,g' \ >> "../$outc" # cleanup sandbox cd .. \ diff --git a/re2c/test/condition_05.cgitcondition_05.cgit.h.c b/re2c/test/condition_05.cgitcondition_05.cgit.h.c index 6a7bde3f..2d3ca180 100644 --- a/re2c/test/condition_05.cgitcondition_05.cgit.h.c +++ b/re2c/test/condition_05.cgitcondition_05.cgit.h.c @@ -1,4 +1,10 @@ /* Generated by re2c */ + +enum YYCONDTYPE { + yycnormal, + yyccomment, +}; +/* Generated by re2c */ #include #include #include @@ -136,9 +142,3 @@ int main(int argc, char **argv) } return 0; } -/* Generated by re2c */ - -enum YYCONDTYPE { - yycnormal, - yyccomment, -}; diff --git a/re2c/test/condition_05.cgtcondition_05.cgt.h.c b/re2c/test/condition_05.cgtcondition_05.cgt.h.c index 81441912..f6a4e1bb 100644 --- a/re2c/test/condition_05.cgtcondition_05.cgt.h.c +++ b/re2c/test/condition_05.cgtcondition_05.cgt.h.c @@ -1,4 +1,11 @@ /* Generated by re2c */ +#line 3 "condition_05.cgt.h" + +enum YYCONDTYPE { + yycnormal, + yyccomment, +}; +/* Generated by re2c */ #line 1 "condition_05.cgtcondition_05.cgt.h.re" #include #include @@ -147,10 +154,3 @@ int main(int argc, char **argv) } return 0; } -/* Generated by re2c */ -#line 3 "condition_05.cgt.h" - -enum YYCONDTYPE { - yycnormal, - yyccomment, -}; -- 2.40.0