From 44af6a2c04295f7b62d531258bd7176462970f07 Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Mon, 7 Oct 2019 20:57:43 -0700 Subject: [PATCH] Finish removing old tests and old "test" framework. --- CMakeLists.txt | 10 ---- pycdc_rt_test.sh | 55 ---------------------- pycdc_test.sh | 41 ---------------- tests/34_test_func.pyc | Bin 232 -> 0 bytes tests/compiled/test_functions_py3.3.0.pyc | Bin 0 -> 1481 bytes tests/compiled/test_functions_py3.3.4.pyc | Bin 0 -> 1097 bytes tests/input/test_functions_py3.py | 26 ++++++++++ tests/tokenized/test_functions_py3.txt | 35 ++++++++++++++ tests/xfail/test_functions_py3.3.7.pyc | Bin 0 -> 1089 bytes 9 files changed, 61 insertions(+), 106 deletions(-) delete mode 100755 pycdc_rt_test.sh delete mode 100755 pycdc_test.sh delete mode 100644 tests/34_test_func.pyc create mode 100644 tests/compiled/test_functions_py3.3.0.pyc create mode 100644 tests/compiled/test_functions_py3.3.4.pyc create mode 100644 tests/input/test_functions_py3.py create mode 100644 tests/tokenized/test_functions_py3.txt create mode 100644 tests/xfail/test_functions_py3.3.7.pyc diff --git a/CMakeLists.txt b/CMakeLists.txt index bd33b46..2af0bf8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,16 +57,6 @@ target_link_libraries(pycdc pycxx) install(TARGETS pycdc RUNTIME DESTINATION bin) -add_custom_target(dc_test "${CMAKE_CURRENT_SOURCE_DIR}/pycdc_test.sh" - "${CMAKE_CURRENT_SOURCE_DIR}/tests" - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") -add_dependencies(dc_test pycdc) - -add_custom_target(rt_test "${CMAKE_CURRENT_SOURCE_DIR}/pycdc_rt_test.sh" - "${CMAKE_CURRENT_BINARY_DIR}/tests" - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") -add_dependencies(rt_test dc_test) - add_custom_target(check "${CMAKE_CURRENT_SOURCE_DIR}/tests/all_tests.sh" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") add_dependencies(check pycdc) diff --git a/pycdc_rt_test.sh b/pycdc_rt_test.sh deleted file mode 100755 index ce4b936..0000000 --- a/pycdc_rt_test.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash - -testdir="$1" -srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -startdir="$(pwd)" - -if [[ -z "$testdir" ]]; then - echo "Missing required parameter: testdir" >&2 - exit 1 -fi - -if [[ ! -d "$testdir" ]]; then - echo "Test directory $testdir does not exist" >&2 - exit 1 -fi -cd "$testdir" - -# Run any .pyc.src files in $testdir back through its respective python compiler -fails=0 -files=() -errors=() - -shopt -s nullglob -rtsources=(*.pyc.src.py) -shopt -u nullglob - -if (( ${#rtsources[@]} == 0 )); then - echo "No decompyled sources found in $testdir" - exit 1 -fi - -for srcf in "${rtsources[@]}"; do - # There's probably a better way... - srcver=$(grep '# File: .* (Python [0-9]\.[0-9]\+)$' "$srcf" | sed -e 's/.* (Python //' -e 's/)//') - - base="$(basename "$srcf")" - "$srcdir"/scripts/pymultic "$srcver" "$srcf" 2> "$base.rterr" - if (( $? )) || [[ -s "$base.rterr" ]]; then - let fails+=1 - files+=("$srcf") - errors+=("$(cat "$base.rterr")") - fi -done - -if (( $fails == 0 )) -then - echo -e "\n\nAll tests passed!" -else - echo -e "\n\n$fails tests failed:" - for ((i=0; i<${#files[@]}; i++)) - do - echo -e "\t\033[31m${files[i]}\033[m" - echo -e "${errors[i]}\n" - done -fi diff --git a/pycdc_test.sh b/pycdc_test.sh deleted file mode 100755 index e0d0038..0000000 --- a/pycdc_test.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -testdir="$1" - -if [[ -z "$testdir" ]] -then - echo "Missing required parameter: testdir" >&2 - exit 1 -fi - -mkdir -p tests - -fails=0 -files=() -errors=() -for f in "$testdir"/*.pyc -do - base="tests/$(basename "$f")" - ./pycdc "$f" 2>"$base.err" 1>"$base.src.py" - if (( $? )) || [[ -s "$base.err" ]] - then - let fails+=1 - files+=("$f") - errors+=("$(cat "$base.err")") - echo -ne "\033[31m.\033[m" - else - echo -ne "\033[32m.\033[m" - fi -done - -if (( $fails == 0 )) -then - echo -e "\n\nAll tests passed!" -else - echo -e "\n\n$fails tests failed:" - for ((i=0; i<${#files[@]}; i++)) - do - echo -e "\t\033[31m${files[i]}\033[m" - echo -e "${errors[i]}\n" - done -fi diff --git a/tests/34_test_func.pyc b/tests/34_test_func.pyc deleted file mode 100644 index 081a297b466cefe2fc719c396cc2cb52a344aa8b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 232 zcmaFI!^>s9swc#Pfq~&M5W@izkmUfx#o|CB1&A0KS{N9j7#LC+7@8Rv7*m)Sf;E|w z8G*7O0HQ%!oPoHQ4@i`NwKOvVRWbloGWk{UdZgy$*|xS4 ziU`|u-@Lcmo!QxiyIQ?^Yks}ClxYUzM}C7TcYn#j2udj32ZE!Mr}Vl8!^vT9?A0FX2n7!46`E*Sz_XzrKIYZA-wPe%Job7ZtyXoM6thhg`o?XS#vDb=|yM*=yW4jJk z(Uy4h{gd53irA@R@h#%S?$?`__D{*iK81uE3R8{-Ez}kl0t|4hnP%z|KSTc8$ZC70Jp1Rq|do=ZhQma C|MHCh literal 0 HcmV?d00001 diff --git a/tests/compiled/test_functions_py3.3.4.pyc b/tests/compiled/test_functions_py3.3.4.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a8e14f756d172fe759363e1ecae1657a7ffac4e4 GIT binary patch literal 1097 zcmaKq&rZTX5XPt7@*fn6nt1Wv3kq^H#zYejCV22hVod3xF)ENLM7SCr!x!+CxO(E^ z19)=2C4~lx3p@QX-Tm!1v;8TS@?Q4y{>mcyrr2;qU&stUBxw0tG$m?_ut_VUEz%C@ zl+lt*lg=2eNM}jsjFts?(gmYaq>H3Wq<2W~($uE5Y*}Q=q$?(qi83zfs>ujykM6wv zKzuBRxTQ;(A#94fJI`u;5hJ|{zely&@pEr58Xgb3;qc*c)C-2s{a*Mmn4H!IlbJm} z!H&?DKo%>B0TLK^Vy>TJ@SZhue1590&SEeGScjnqm=YZrxClJA18v5}HmHqFY9k{r zBWhaovKf)hYb=O0BW^QX2deR@pN|oIcocXdDhcG@K p#(gs`$n=v@D#H(Bee4QMi_AS_&))ia^x8c~DnyY*wfecrRew+Oh-3f& literal 0 HcmV?d00001 diff --git a/tests/input/test_functions_py3.py b/tests/input/test_functions_py3.py new file mode 100644 index 0000000..c73c948 --- /dev/null +++ b/tests/input/test_functions_py3.py @@ -0,0 +1,26 @@ +def x0(): + pass + +def x1(arg1): + pass + +def x2(arg1, arg2): + pass + +def x3a(*args): + pass + +def x3b(**kwargs): + pass + +def x3c(*args, **kwargs): + pass + +def x4a(foo, bar = 1, bla = 2, *args): + pass + +def x4b(foo, bar = 1, bla = 2, **kwargs): + pass + +def x4c(foo, bar = 1, bla = 2, *args, **kwargs): + pass diff --git a/tests/tokenized/test_functions_py3.txt b/tests/tokenized/test_functions_py3.txt new file mode 100644 index 0000000..93f7f00 --- /dev/null +++ b/tests/tokenized/test_functions_py3.txt @@ -0,0 +1,35 @@ +def x0 ( ) : + +pass + +def x1 ( arg1 ) : + +pass + +def x2 ( arg1 , arg2 ) : + +pass + +def x3a ( * args ) : + +pass + +def x3b ( ** kwargs ) : + +pass + +def x3c ( * args , ** kwargs ) : + +pass + +def x4a ( foo , bar = 1 , bla = 2 , * args ) : + +pass + +def x4b ( foo , bar = 1 , bla = 2 , ** kwargs ) : + +pass + +def x4c ( foo , bar = 1 , bla = 2 , * args , ** kwargs ) : + +pass diff --git a/tests/xfail/test_functions_py3.3.7.pyc b/tests/xfail/test_functions_py3.3.7.pyc new file mode 100644 index 0000000000000000000000000000000000000000..02d664948e739965d004e521485aa3b974d47790 GIT binary patch literal 1089 zcmaKq%}&BV5XZOO0;LEdeqX$E0TGVI7&Y-=qKV!}3@IHjLyK^#xa|$f)(iQa2V*e%VPTOU%ItS4R==%QKlV<*Z9erSX_|JybXh5 zH+0fyAIM_FFG;-M