-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc01c5c
commit 715e3d3
Showing
7 changed files
with
91 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ AC_PREREQ([2.71]) | |
|
||
AC_INIT( | ||
[liblnk], | ||
[20230928], | ||
[20231001], | ||
[[email protected]]) | ||
|
||
AC_CONFIG_SRCDIR( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* The internal libcpath header | ||
* The libcpath header wrapper | ||
* | ||
* Copyright (C) 2009-2022, Joachim Metz <[email protected]> | ||
* Copyright (C) 2009-2023, Joachim Metz <[email protected]> | ||
* | ||
* Refer to AUTHORS for acknowledgements. | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,29 +2,36 @@ | |
# | ||
# Script to run Python test scripts. | ||
# | ||
# Copyright (C) 2009-2023, Joachim Metz <[email protected]> | ||
# | ||
# Refer to AUTHORS for acknowledgements. | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Lesser General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
# Version: 20231001 | ||
|
||
import glob | ||
import os | ||
import sys | ||
import unittest | ||
|
||
|
||
test_profile = ".pylnk" | ||
input_glob = "*.lnk" | ||
option_sets = [] | ||
|
||
|
||
def ReadIgnoreList(test_profile): | ||
"""Reads the test profile ignore file if it exists. | ||
Args: | ||
test_profile (str): test profile. | ||
Returns: | ||
set[str]: ignore list. | ||
""" | ||
ignore_file_path = os.path.join("tests", "input", test_profile, "ignore") | ||
if os.path.isfile(ignore_file_path): | ||
with open(ignore_file_path, "r", encoding="utf-8") as file_object: | ||
return set([line.strip() for line in file_object.readlines()]) | ||
|
||
return set() | ||
|
||
|
||
if __name__ == "__main__": | ||
print(f"Using Python version {sys.version!s}") | ||
|
||
|
@@ -33,30 +40,37 @@ | |
|
||
test_scripts = test_loader.discover("tests", pattern="*.py") | ||
|
||
test_profile = ".pylnk" | ||
input_glob = "*.lnk" | ||
|
||
ignore_list = set() | ||
|
||
ignore_file_path = f"tests/input/{test_profile}/ignore" | ||
if os.path.isfile(ignore_file_path): | ||
with open(ignore_file_path, "r", encoding="utf-8") as file_object: | ||
ignore_list = set([line.strip() for line in file_object.readlines()]) | ||
ignore_list = ReadIgnoreList(test_profile) | ||
|
||
test_set = None | ||
source_file = None | ||
|
||
for test_set in glob.glob("tests/input/*"): | ||
test_set = test_set.rsplit('/', maxsplit=1)[-1] | ||
for test_set in glob.glob(os.path.join("tests", "input", "*")): | ||
test_set = test_set.rsplit(os.path.sep, maxsplit=1)[-1] | ||
if not test_set or test_set[0] == '.' or test_set in ignore_list: | ||
continue | ||
|
||
source_files = glob.glob(f"tests/input/{test_set:s}/{input_glob:s}") | ||
source_files = glob.glob(os.path.join( | ||
"tests", "input", test_set, input_glob)) | ||
if source_files: | ||
source_file = source_files[0] | ||
break | ||
|
||
setattr(unittest, "source", source_file) | ||
|
||
for option_set in option_sets: | ||
test_options = None | ||
|
||
test_file = os.path.basename(source_file) | ||
test_options_file_path = os.path.join( | ||
"tests", "input", test_profile, test_set, | ||
f"{test_file:s}.{option_set:s}") | ||
if os.path.isfile(test_options_file_path): | ||
with open(test_options_file_path, "r", encoding="utf-8") as file_object: | ||
test_options = file_object.read().strip() | ||
|
||
setattr(unittest, option_set, test_options) | ||
|
||
test_results = test_runner.run(test_scripts) | ||
if not test_results.wasSuccessful(): | ||
sys.exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters