diff --git a/bin/test b/bin/test index c8cd8d6..791d808 100755 --- a/bin/test +++ b/bin/test @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python import os import sys @@ -26,14 +26,14 @@ def doTest(bin_dir, regex_file): print regex_file, "*** FAIL" sys.exit(1) +def main(): + bin_dir = os.path.abspath(os.path.dirname(__file__)) + test_dir = os.path.join(bin_dir, '..', 'tests') + test_files_mask = os.path.join(test_dir, '*.regex') + test_files_mask = os.path.realpath(test_files_mask) -bin_dir = os.path.abspath(os.path.dirname(__file__)) -test_dir = os.path.join(bin_dir, '..', 'tests') -test_files_mask = os.path.join(test_dir, '*.regex') -test_files_mask = os.path.realpath(test_files_mask) + test_files = glob.glob(test_files_mask) + for test_file in test_files: + doTest(bin_dir, test_file) -test_files = glob.glob(test_files_mask) -for test_file in test_files: - doTest(bin_dir, test_file) - -sys.exit(0) + sys.exit(0)