X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=t%2Fpy-compile-basedir.sh;h=2675361ec338877a792b5a6c1c8d91fe57f43628;hb=a7c00e1935726a32dca6871dd0f1b7eda28d0a5b;hp=f2cef307ac64801c46749bec02b7cfe93d8f9410;hpb=26c7b8f50a02749e49135cac58c793bde97ec8fc;p=platform%2Fupstream%2Fautomake.git diff --git a/t/py-compile-basedir.sh b/t/py-compile-basedir.sh old mode 100755 new mode 100644 index f2cef30..2675361 --- a/t/py-compile-basedir.sh +++ b/t/py-compile-basedir.sh @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2011-2012 Free Software Foundation, Inc. +# Copyright (C) 2011-2013 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ # Test the '--basedir' option of the 'py-compile' script, required=python -. ./defs || exit 1 +. test-init.sh # We'll need to create files in '..', so we need one more subdirectory # level in order not to clutter up the top-level tests directory. @@ -38,13 +38,17 @@ for d in foo foo/bar "$(pwd)/foo" . .. ../foo ''; do : > "$d2/$f.py" : > "$d2/sub/$f.py" ./py-compile --basedir "$d" "$f.py" "sub/$f.py" - ls -l "$d2" "$d2/sub" # For debugging. - test -f "$d2/$f.pyc" - test -f "$d2/$f.pyo" - test -f "$d2/sub/$f.pyc" - test -f "$d2/sub/$f.pyo" - rm -f "$d2/$f.pyc" "$d2/$f.pyo" "$d2/sub/$f.pyc" "$d2/sub/$f.pyo" - find . | grep '\.py[co]$' && exit 1 + find "$d2" # For debugging. + py_installed "$d2/$f.pyc" + py_installed "$d2/$f.pyo" + py_installed "$d2/sub/$f.pyc" + py_installed "$d2/sub/$f.pyo" + files=$(find "$d2" | grep '\.py[co]$') + test $(echo "$files" | wc -l) -eq 4 + case $d2 in + .|..) rm -f $files;; + *) rm -rf "$d2";; + esac done :