summaryrefslogtreecommitdiffstats
path: root/BaseTools/Tests
Commit message (Collapse)AuthorAgeFilesLines
* Revert "BaseTools:code of test python module is moved to edksetup"Fan, ZhijuX2019-05-091-0/+8
| | | | | | | | | | | | | This reverts commit df7c81b5b219c9aee776baa466dd64c9d318dd80. In commint df7c81b5b219c9,used a function to test python module But the Boolean value of the return value of this function is the opposite of the Correct result, resulting in an unexpected result Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools:The code used to test python module is moved to edksetupFan, ZhijuX2019-05-081-8/+0
| | | | | | | | | | | | | | | BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1582 testing for presence of python modules should be done in edksetup to reduce impact on subsequent build times. This code currently exists in BaseTools/Tests/RunTest.py. This patch is going to fix this issue. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-0910-70/+10
| | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Add python3-distutils Ubuntu package checkingFeng, Bob C2019-03-011-0/+7
| | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1509 Add python3-distutils Ubuntu package checking. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* BaseTools: Various typoAntoine Coeur2019-02-141-1/+1
| | | | | | | | Various typo in BaseTools. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Coeur <coeur@gmx.fr> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Update PYTHON env to PYTHON_COMMANDLiming Gao2019-02-012-1/+16
| | | | | | | | | | Update PYTHON env to PYTHON_COMMAND. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Update windows and linux run scripts file to use Python3Zhijux Fan2019-02-011-1/+1
| | | | | | | | | | | | | | | Modify windows script, PosixLike script, edksetup.sh, edksetup.bat to use Python3 based on PYTHON3_ENABLE environment. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools:TestTools character encoding issueZhiju Fan2019-02-011-1/+2
| | | | | | | | | | | | | Specifies encoding when opening a file using codecs Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: update Test scripts support python3Zhijux Fan2019-02-013-9/+12
| | | | | | | | | | | | | | update Test scripts support python2 and python3 Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Fix PcdArray issueFeng, Bob C2018-12-181-0/+54
| | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1390 1. support hex number for array index 2. support Non-Dynamic Pcd for array data type 3. support {} and {CODE()} for array data type 4. Change GetStructurePcdMaxSize to be a static function since it need to be called in another static function. And this function does not depend on it's class instance. 5. Add unittest for RemoveCComments function and ArrayIndex regular expression. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Philippe Mathieu-Daud? <philmd@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* Revert BaseTools: PYTHON3 migrationLiming Gao2018-10-153-12/+10
| | | | | | | | | | | | | | This reverts commit 6693f359b3c213513c5096a06c6f67244a44dc52.. 678f85131238622e576705117e299d81cff755c9. Python3 migration is the fundamental change. It requires every developer to install Python3. Before this migration, the well communication and wide verification must be done. But now, most people is not aware of this change, and not try it. So, Python3 migration is reverted and be moved to edk2-staging Python3 branch for the edk2 user evaluation. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com>
* BaseTools/Tests: Update GNUmakefile to use python3 variableYonghong Zhu2018-10-141-1/+1
| | | | | | | | | | | | | Cover the case user do make -C BaseTools before run the .edksetup.sh file. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Leif Lindholm <leif.lindholm@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* BaseTools: update Test scripts support python3Yunhua Feng2018-10-133-10/+12
| | | | | | | | | | update Test scripts support python3 Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Clean up source filesLiming Gao2018-07-092-4/+4
| | | | | | | | | | | 1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Adjust the spaces around commas and colonsGary Lin2018-06-271-1/+1
| | | | | | | | | | Based on "futurize -f lib2to3.fixes.fix_ws_comma" Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Remove types.TypeTypeGary Lin2018-06-271-2/+1
| | | | | | | | | | | "types.TypeType" is now an alias of the built-in "type" and is not compatible with python 3. Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Refactor python print statementsGary Lin2018-06-272-4/+6
| | | | | | | | | | | Refactor print statements to be compatible with python 3. Based on "futurize -f libfuturize.fixes.fix_print_with_import" Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Refactor python except statementsGary Lin2018-06-271-1/+1
| | | | | | | | | | | Convert "except ... ," to "except ... as" to be compatible with python3. Based on "futurize -f lib2to3.fixes.fix_except" Contributed-under: TianoCore Contribution Agreement 1.1 Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Use python2 if available in Tests/GNUmakefileCharles Duffy2016-01-201-1/+1
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Charles Duffy <chaduffy@cisco.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19696 6f19259b-4bc3-4df7-8a09-765794883524
* BaseTools/Tests: Verify supported UTF-8 data is allowedJordan Justen2015-06-231-0/+11
| | | | | | | | | | | | We test a simple case of UTF-8 with and without the UTF-8 BOM. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17699 6f19259b-4bc3-4df7-8a09-765794883524
* BaseTools/Tests: Verify unsupported UTF-8 data is rejectedJordan Justen2015-06-231-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | Surrogate pair characters can be encoded in UTF-8 files, but they are not valid UCS-2 characters. For example, this python interpreter code: >>> import codecs >>> codecs.encode(u'\ud801', 'utf-8') '\xed\xa0\x81' But, the range of 0xd800 - 0xdfff should be rejected as unicode code points because they are reserved for the surrogate pair usage in UTF-16 files. We test that this case is rejected for UTF-8 with and without the UTF-8 BOM. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17698 6f19259b-4bc3-4df7-8a09-765794883524
* BaseTools/Tests: Verify 32-bit UTF-8 chars are rejectedJordan Justen2015-06-231-0/+25
| | | | | | | | | | | | | | Since UTF-8 .uni unicode files might contain strings with unicode code points larger than 16-bits, and UEFI only supports UCS-2 characters, we need to make sure that BaseTools rejects these characters in UTF-8 .uni source files. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17697 6f19259b-4bc3-4df7-8a09-765794883524
* BaseTools/Tests: Verify unsupported UTF-16 are rejectedJordan Justen2015-06-231-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Supplementary Plane characters can exist in UTF-16 files, but they are not valid UCS-2 characters. For example, this python interpreter code: >>> import codecs >>> codecs.encode(u'\U00010300', 'utf-16') '\xff\xfe\x00\xd8\x00\xdf' Therefore the UCS-4 0x00010300 character is encoded as two 16-bit numbers (0xd800 0xdf00) in a little endian UTF-16 file. For more information, see: http://en.wikipedia.org/wiki/UTF-16#U.2B10000_to_U.2B10FFFF This test checks to make sure that BaseTools will reject these characters in UTF-16 files. The range of 0xd800 - 0xdfff should also be rejected as unicode code points because they are reserved for the surrogate pair usage in UTF-16 files. This test was fixed by the previous commit: "BaseTools/UniClassObject: Verify valid UCS-2 chars in UTF-16 .uni files" Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17695 6f19259b-4bc3-4df7-8a09-765794883524
* BaseTools/Tests: Add unit test for AutoGen.UniClassObjectJordan Justen2015-06-232-1/+91
| | | | | | | | | | | | This verifies that a UTF-16 data (with BOM) .uni file is successfully read. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17693 6f19259b-4bc3-4df7-8a09-765794883524
* BaseTools/Tests: Always add BaseTools source to import pathJordan Justen2015-06-232-3/+8
| | | | | | | | | | | | | | | | | | | This allows unit tests to easily include BaseTools python modules. This is very useful for writing unit tests. Actually, previously, we would do this when RunTests.py was executed, so unit tests could easily import BaseTools modules, so long as they were executed via RunTests. This change allows running the unit test files individually which can be faster for developing the new unit test cases. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17691 6f19259b-4bc3-4df7-8a09-765794883524
* Sync BaseTool trunk (version r2649) into EDKII BaseTools.Gao, Liming2014-01-276-434/+434
| | | | | | | Signed-off-by: Gao, Liming <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15188 6f19259b-4bc3-4df7-8a09-765794883524
* Sync BaseTool trunk (version r2599) into EDKII BaseTools.Liming Gao2013-08-231-1/+1
| | | | | | | | Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Heshen Chen <chen.heshen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14591 6f19259b-4bc3-4df7-8a09-765794883524
* Sync BaseTools Trunk (version r2518) to EDKII main trunk.lgao42012-04-101-14/+21
| | | | | | | Signed-off-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13178 6f19259b-4bc3-4df7-8a09-765794883524
* Sync EDKII BaseTools to BaseTools project r1971lgao42010-05-187-14/+14
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10502 6f19259b-4bc3-4df7-8a09-765794883524
* Sync EDKII BaseTools to BaseTools project r1913.qhuang82010-03-041-9/+21
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10193 6f19259b-4bc3-4df7-8a09-765794883524
* Sync tool code to BuildTools project r1783.lgao42009-12-291-0/+5
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9623 6f19259b-4bc3-4df7-8a09-765794883524
* Sync basetools' source and binary files with r1707 of the basetools project.vanjeff2009-09-111-2/+2
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9257 6f19259b-4bc3-4df7-8a09-765794883524
* Check In tool source code based on Build tool project revision r1655.lgao42009-07-177-0/+431
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8964 6f19259b-4bc3-4df7-8a09-765794883524