aboutsummaryrefslogtreecommitdiff
path: root/testsuite (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'busybox' into mergeRon Yorston2020-01-082-0/+40
|\
| * bc: fix comparison bug, closes 12336Denys Vlasenko2019-11-231-0/+5
| | | | | | | | | | | | | | function old new delta bc_num_cmp 249 259 +10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * dc: Parse error & fix out of bounds read in xc_program_printStringBrian Foley2019-09-051-0/+20
| | | | | | | | | | | | | | | | function old new delta xc_program_print 712 735 +23 Signed-off-by: Brian Foley <bpfoley@google.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * dc: Fix segfault when executing strings generated using asciifyBrian Foley2019-09-051-0/+5
| | | | | | | | | | | | | | | | function old new delta zxc_vm_process 6884 6891 +7 Signed-off-by: Brian Foley <bpfoley@google.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * dc: execute shouldn't pop if stack head is not a stringBrian Foley2019-09-051-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This matches the behaviour of both GNU dc (as specified in its man page), and BSD dc (where stack_popstring() pops only if the head is a string.) Add a couple of tests to verify this behavior. function old new delta zxc_vm_process 6882 6884 +2 Signed-off-by: Brian Foley <bpfoley@google.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | testsuite: ensure tests work when directory name has spacesFRP-3244-g48128b9aaRon Yorston2019-08-162-4/+4
| |
* | Merge branch 'busybox' into mergeRon Yorston2019-08-163-76/+6
|\|
| * expand,unexpand: drop broken test, add FIXME commentDenys Vlasenko2019-06-082-76/+0
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * awk: fix testsuiteDenys Vlasenko2019-06-081-0/+6
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2019-05-272-1/+7
|\|
| * testsuite: fix bunzip2.tests expectationsDenys Vlasenko2019-05-261-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sed: fix /regex/,+N match triggering only once, closes 11871Denys Vlasenko2019-05-131-0/+6
| | | | | | | | | | | | | | function old new delta process_files 2235 2246 +11 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | testsuite: added test cases for the shebangNiklas DAHLQUIST2019-05-031-0/+90
| | | | | | | | | | | | Signed-off-by: Niklas DAHLQUIST <niklas.dahlquist@st.com> Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@st.com> Signed-off-by: Ron Yorston <rmy@pobox.com>
* | testsuite: allow tests to work on Microsoft WindowsRon Yorston2019-05-032-6/+31
|/ | | | Signed-off-by: Ron Yorston <rmy@pobox.com>
* dc.tests: fix two test case to also depend on DC_BIGChen Qi2019-04-191-3/+3
| | | | | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* grep: fix -x -v with certain pattern ordersAri Sundholm2019-01-291-0/+7
| | | | | | | | | | | | | | | | | | | | | | We found out that busybox -x -v is a bit broken: ari@ari-thinkpad:~/busybox$ echo ' aa bb cc' | ./busybox grep -x -e 'aa.*' -e '.*bb.*' aa bb cc ari@ari-thinkpad:~/busybox$ echo ' aa bb cc' | ./busybox grep -x -v -e 'aa.*' -e '.*bb.*' ari@ari-thinkpad:~/busybox$ echo ' aa bb cc' | ./busybox grep -x -e '.*aa.*' -e 'bb.*' aa bb cc ari@ari-thinkpad:~/busybox$ echo ' aa bb cc' | ./busybox grep -x -v -e '.*aa.*' -e 'bb.*' aa bb cc Last one is wrong. This patch fixes the issue by making sure that the variable 'found' never makes a transition from 1 to 0, as this would mean that grep previously found a match on this input line. Signed-off-by: Ari Sundholm <ari@tuxera.com> Signed-off-by: Niko Vähäsarja <niko@tuxera.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bc: implement pass-by-reference code from upstreamDenys Vlasenko2019-01-252-0/+318
| | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta zxc_program_popResultAndCopyToVar 298 493 +195 bc_vec_pushIndex - 75 +75 zxc_vm_process 859 928 +69 xc_program_dereference - 66 +66 bc_vec_npush - 65 +65 zbc_num_s 239 249 +10 zxc_program_num 1024 1032 +8 zbc_num_divmod 150 156 +6 xc_program_search 143 146 +3 zxc_program_assign 392 389 -3 zdc_program_execStr 520 517 -3 xc_program_pushVar 198 195 -3 zxc_program_exec 4101 4092 -9 zbc_program_call 318 308 -10 zbc_func_insert 120 104 -16 zbc_parse_stmt_possibly_auto 1460 1439 -21 bc_vec_push 53 12 -41 xc_parse_pushIndex 61 18 -43 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 6/9 up/down: 497/-149) Total: 348 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: Fix overly permissive func arg list parsingBrian Foley2019-01-211-0/+12
| | | | | | | | | | | | | | | It allows things like 'func f(a b)' and 'func f(a,)' which GNU awk forbids. function old new delta parse_program 327 367 +40 chain_expr 40 67 +27 parse_expr 891 915 +24 EMSG_TOO_FEW_ARGS 30 18 -12 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/1 up/down: 91/-12) Total: 79 bytes Signed-off-by: Brian Foley <bpfoley@google.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: Syntax error if delete isn't given an arg.Brian Foley2019-01-211-2/+5
| | | | | | | | Unlike exit and return, delete strictly requires an arg, and derefs a null pointer if executed without one. Signed-off-by: Brian Foley <bpfoley@google.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* awk: Guard pointer chasing when parsing ternary expressions.Brian Foley2019-01-211-0/+3
| | | | | | | | | Avoids an uninit pointer deref for some malformed ternary exprs. Add a test that would crash in busybox before this fix. Signed-off-by: Brian Foley <bpfoley@google.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* start-stop-daemon: fix "both -x and -a" case: -a does override argv[0]Denys Vlasenko2019-01-141-0/+7
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* start-stop-daemon: create pidfile before parent exits, closes 8596Denys Vlasenko2019-01-141-0/+5
| | | | | | | | | | | | | | | | | | | This removes DAEMON_DOUBLE_FORK flag from bb_daemonize_or_rexec(), as SSD was the only user. Also includes fix for -S: now works without -a and -x, does not print pids (compat with "start-stop-daemon (OpenRC) 0.34.11 (Gentoo Linux)"). function old new delta start_stop_daemon_main 1018 1084 +66 add_interface 99 103 +4 fail_hunk 139 136 -3 bb_daemonize_or_rexec 205 183 -22 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/2 up/down: 70/-25) Total: 45 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bc: support void functions (GNU compat)Denys Vlasenko2019-01-041-0/+17
| | | | | | | | | | | | | | | | function old new delta xc_program_print - 689 +689 zxc_vm_process 814 869 +55 zxc_program_exec 4098 4116 +18 zxc_program_assign 385 392 +7 bc_result_free 43 46 +3 zxc_program_binOpPrep 243 245 +2 zdc_program_execStr 518 520 +2 zxc_program_print 683 - -683 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 6/0 up/down: 776/-683) Total: 93 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* dc: fit returning of stringDenys Vlasenko2019-01-041-0/+5
| | | | | | | function old new delta zxc_program_exec 4087 4098 +11 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* dc: fix '?'Denys Vlasenko2019-01-041-0/+5
| | | | | | | | | | function old new delta zdc_parse_expr 470 479 +9 zxc_vm_process 839 814 -25 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 9/-25) Total: -16 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bc: fix "...; return}" to work, disallow "return ()"Denys Vlasenko2019-01-032-3/+6
| | | | | | | | | | | function old new delta zbc_parse_expr 24 1865 +1841 zbc_parse_stmt_possibly_auto 1425 1413 -12 bc_parse_expr_empty_ok 1843 - -1843 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/1 up/down: 1841/-1855) Total: -14 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bc: generate large bc tests on the fly, -5 mbytes in the git treeDenys Vlasenko2019-01-022-11/+43
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bc: speed up string printing, fix print ""Denys Vlasenko2019-01-021-0/+6
| | | | | | | | | | | | | function old new delta static.esc - 9 +9 zxc_program_print 681 683 +2 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/0 up/down: 11/0) Total: 11 bytes text data bss dec hex filename 979144 485 7296 986925 f0f2d busybox_old 979062 485 7296 986843 f0edb busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bc: upstream fixesDenys Vlasenko2019-01-011-0/+16
| | | | | | | | | | | | | | | | | function old new delta bc_parse_expr_empty_ok 1764 1843 +79 bc_error_at - 62 +62 bc_parse_inst_isLeaf - 30 +30 zbc_func_insert 100 120 +20 bc_error_bad_function_definition - 10 +10 bc_error_bad_assignment - 10 +10 zxc_lex_next 1608 1614 +6 ok_in_expr 30 - -30 zxc_vm_process 874 839 -35 ------------------------------------------------------------------------------ (add/remove: 4/1 grow/shrink: 3/1 up/down: 217/-65) Total: 152 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bc: support ibase up to 36 (GNU compat)Denys Vlasenko2018-12-311-0/+5
| | | | | | | function old new delta zxc_program_num 995 1018 +23 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bc: more fixes for unusual input basesDenys Vlasenko2018-12-292-0/+68
| | | | | | | | | | function old new delta zxc_program_num 990 1020 +30 zxc_lex_number 172 202 +30 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 60/0) Total: 60 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bc: fix handling of "digits" above 9Denys Vlasenko2018-12-292-0/+40
| | | | | | | | | | | | function old new delta zxc_lex_next 1573 1608 +35 xc_parse_pushIndex 58 56 -2 xc_program_index 71 63 -8 zxc_program_num 1022 990 -32 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/3 up/down: 35/-42) Total: -7 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bc: rename config optionsDenys Vlasenko2018-12-283-2/+7
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bc: prepare for char-by-char input handlingDenys Vlasenko2018-12-261-4/+4
| | | | | | | | | | | | | | | | | | | function old new delta peek_inbuf - 292 +292 parse_lex_by_checking_eq_sign - 26 +26 eat_inbuf - 22 +22 zbc_vm_execute_FILE 52 61 +9 bc_lex_lineComment 29 30 +1 zbc_lex_number 174 172 -2 bc_vm_run 104 99 -5 zbc_num_divmod 156 150 -6 bc_lex_file 24 - -24 bc_lex_assign 26 - -26 zbc_lex_next 1982 1587 -395 ------------------------------------------------------------------------------ (add/remove: 3/2 grow/shrink: 2/4 up/down: 350/-458) Total: -108 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bc: fix interactive handling of comments in strings and quotes in commentsDenys Vlasenko2018-12-251-2/+14
| | | | | | | function old new delta zbc_lex_next 1965 1979 +14 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* dc: add two testsDenys Vlasenko2018-12-251-0/+10
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bc: allow {break} and {continue} (allow RBRACE to terminate them)Denys Vlasenko2018-12-251-1/+6
| | | | | | | function old new delta zbc_parse_stmt_possibly_auto 1599 1560 -39 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* dc: unbreak interactive mode - was trying to get next tokens instead of ↵Denys Vlasenko2018-12-221-0/+15
| | | | | | | | | | | | | | | | | | | | executing function old new delta zbc_program_read - 268 +268 zdc_program_printStream - 146 +146 zbc_program_exec 4046 4182 +136 zdc_program_execStr 472 512 +40 zdc_parse_exprs_until_eof - 26 +26 zbc_vm_process 740 765 +25 zbc_lex_next 2225 2240 +15 zdc_parse_expr 569 535 -34 zbc_program_pushArray 147 - -147 zdc_program_asciify 370 - -370 ------------------------------------------------------------------------------ (add/remove: 3/2 grow/shrink: 4/1 up/down: 656/-551) Total: 105 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bc: unbreak read(), remove checks for nested read()Denys Vlasenko2018-12-221-0/+15
| | | | | | | | | | | | | | | | | | | function old new delta zbc_parse_pushSTR - 65 +65 common_parse_expr - 32 +32 bc_error_nested_read_call 10 - -10 bc_parse_expr_empty_ok 1977 1963 -14 zdc_parse_expr 635 615 -20 zcommon_parse_expr 32 - -32 zbc_program_exec 4064 4023 -41 bc_parse_pushSTR 65 - -65 ------------------------------------------------------------------------------ (add/remove: 2/3 grow/shrink: 0/3 up/down: 97/-182) Total: -85 bytes text data bss dec hex filename 981661 485 7296 989442 f1902 busybox_old 981540 485 7296 989321 f1889 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bc: fix for() to not leave data on stackDenys Vlasenko2018-12-211-0/+15
| | | | | | | | | | | | | function old new delta zbc_parse_stmt_possibly_auto 1665 1697 +32 zbc_vm_process 672 701 +29 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 61/0) Total: 61 bytes text data bss dec hex filename 981656 485 7296 989437 f18fd busybox_old 981748 485 7296 989529 f1959 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bc: for(;;) fix from upstreamDenys Vlasenko2018-12-211-0/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bc: fix keyword matching to not think "ifz" is the "if" keywordDenys Vlasenko2018-12-201-0/+5
| | | | | | | function old new delta zbc_lex_next 2224 2225 +1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bc: fix "echo -n '#foo' | bc" not eating last 'o'Denys Vlasenko2018-12-181-0/+5
| | | | | | | | | | | | | function old new delta zdc_parse_expr 656 653 -3 bc_lex_lineComment 39 36 -3 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-6) Total: -6 bytes text data bss dec hex filename 981424 485 7296 989205 f1815 busybox_old 981418 485 7296 989199 f180f busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bc: remove "error after expression parsing" checkDenys Vlasenko2018-12-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | It is misplaced: caller knows better what can or cannot follow the expression. Sometimes even caller's caller: "if (1) return a+b else..." - parser of "return" does not know that "else" after it is valid, parser of stmt does not know it either, - only parser of "if" knows it! The removed code balked on e.g. "{ print 1 }" statement. This does not break any valid programs, but starts accepting some invalid ones, e.g. "print 1 print 2" would work. function old new delta zcommon_parse_expr 40 32 -8 zbc_parse_name 509 494 -15 zbc_parse_stmt_possibly_auto 1678 1638 -40 bc_parse_expr_empty_ok 2025 1977 -48 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/4 up/down: 0/-111) Total: -111 bytes text data bss dec hex filename 981599 485 7296 989380 f18c4 busybox_old 981488 485 7296 989269 f1855 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bc: store only index in p->exits, it's the only thing used thereDenys Vlasenko2018-12-161-0/+17
| | | | | | | | | | | | function old new delta zbc_parse_stmt_possibly_auto 1967 1964 -3 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-3) Total: -3 bytes text data bss dec hex filename 981937 485 7296 989718 f1a16 busybox_old 981934 485 7296 989715 f1a13 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bc: remove redundant JUMP generation when parsing 'while'Denys Vlasenko2018-12-161-0/+27
| | | | | | | | | | | | function old new delta zbc_parse_stmt_possibly_auto 2065 2025 -40 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-40) Total: -40 bytes text data bss dec hex filename 982035 485 7296 989816 f1a78 busybox_old 981995 485 7296 989776 f1a50 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bc: simplify use of "ip" in loop parsing functionsDenys Vlasenko2018-12-161-0/+31
| | | | | | | | | | | | function old new delta zbc_parse_stmt_possibly_auto 2106 2065 -41 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-41) Total: -41 bytes text data bss dec hex filename 982076 485 7296 989857 f1aa1 busybox_old 982035 485 7296 989816 f1a78 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bc: fix "print 1,2,3" parsingDenys Vlasenko2018-12-161-0/+5
| | | | | | | | | | | | function old new delta zbc_parse_stmt_possibly_auto 2245 2180 -65 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-65) Total: -65 bytes text data bss dec hex filename 982237 485 7296 990018 f1b42 busybox_old 982152 485 7296 989933 f1aed busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bc: fold zbc_parse_else() into its only callerDenys Vlasenko2018-12-161-0/+5
| | | | | | While at it, allow newline between "else" and its body Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* bc: fixes for multi-line if/while/forDenys Vlasenko2018-12-161-0/+10
| | | | | | | | | | | | | | | | | | | | function old new delta zbc_vm_process 561 589 +28 zbc_lex_next_and_skip_NLINE - 22 +22 zbc_parse_stmt_possibly_auto 2232 2253 +21 zbc_lex_skip_if_at_NLINE - 14 +14 zbc_lex_number 192 200 +8 zbc_num_divmod 150 156 +6 bc_vm_run 134 139 +5 bc_vm_init 757 760 +3 bc_num_printNewline 51 54 +3 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 7/0 up/down: 110/0) Total: 110 bytes text data bss dec hex filename 982138 485 7296 989919 f1adf busybox_old 982275 485 7296 990056 f1b68 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>