87 Commits

Author SHA1 Message Date
Kay Hayen
46527eb455 Cleanup, attach copyright during code generation for specialiations
* This also enhances the formatting for almost all files by making
  leading and trailing new lines more consistent.

* One C file turns out unused, was probably a left over.
2025-10-10 17:05:56 +02:00
Kay Hayen
718ab60539 Bump copyright year 2025-04-28 11:04:36 +02:00
Kay Hayen
4a0a21ff98 Tests: Remove 2to3 conversion code, we don't want to use it anymore 2024-12-18 11:10:21 +01:00
Kay Hayen
f34f8d0c63 Bump copyright year
* Also split copyright notices between the top and bottom,
  such that readability of just opened files is not harmed
  by license text.
2024-12-18 10:48:16 +01:00
Kay Hayen
d006a644c5 Python3.6+ Fix, didn't catch await on module level
* This is a syntax error that needs to be caught manually just
  like with "yield" where we already did that.
2024-12-18 10:35:17 +01:00
Kay Hayen
909d41f02d Bump copyright year 2023-06-02 15:07:22 +02:00
John Vandenberg
5d15c7c704 Quality: Update and expand auto-formatting tools
* Update auto-formatting tools with newest isort and rstfmt.

* Also format of "tests/*/*.rst" and many test files.
2023-02-13 14:20:27 +01:00
Kay Hayen
4cfdd9f9c0 Bump copyright year 2022-05-23 10:28:11 +02:00
Kay Hayen
81efb5b4ca Cleanup: Major refactoring of import handling
* Give warning about imports not followed only when no options that
  specify what to do are given.

* Make sure we pass module name around and have it in all cases.

* Import nodes now provide what they use, but they do not add detected
  imports immediately to the active module set, instead wait for module
  to be fully optimized, avoiding imports discarded during optimization.

* Stop working with relative paths, instead use absolute ones, getting
  rid of a long standing TODO.
2021-12-09 15:46:04 +01:00
Kay Hayen
5ed76123b8 Tests: Add suite names and minor fixups 2021-12-07 09:38:43 +01:00
Kay Hayen
33dde35bd3 Tests: Fix, the "only" mode wasn't working well
* Also cleanup the API, tests should not have to abort.
2021-04-06 13:40:22 +02:00
Kay Hayen
e43b72e087 Bump copyright year to 2021. 2021-01-22 09:58:00 +01:00
Kay Hayen
dd5a9f2dd5 Cleanup, avoid decimal and string comparisons for version checks
* This is in preparation for 3.10 which will fail to work that work.

* Extended numeric values to be hexadecimal.

* Using tuples over strings in testing.
2020-12-17 09:06:53 +01:00
Kay Hayen
93184f9bd7 Tests: Remove useless output for search and only modes
* The skipping due to not being active output a lot of names
  for no good reason.
2020-03-01 21:23:28 +01:00
Kay Hayen
b2083575cf Bump copyright year to 2020. 2020-02-01 07:42:45 +01:00
Kay Hayen
24948232ee Tests: Minor cleanups 2019-12-16 08:59:17 +01:00
Kay Hayen
1c98935027 Minor cleanups 2019-09-01 12:04:26 +02:00
Kay Hayen
ffb9d07226 Python3.8: More compatible error message for yield in genexp.
* Also cleanup generator expression test to be pylint clean, so
  Visual Code is not as upset.

* Split syntax supported until 3.7 in separate basic test and make
  the 3.8 syntax error a test.
2019-08-04 14:12:08 +02:00
Kay Hayen
54200ed787 Tests: Make sure test runners are pylint and autoformatted too.
* The autoformat had been done partially in the past, but now it
  is complete.

* Covering it with pylint makes sense, but required a lot of
  small changes.
2019-07-08 14:06:57 +02:00
Kay Hayen
e3c44b4ffd Python3.8: Follow syntax changges
* Yield is now forbidden in generator expressions, so check for
  that.

* And continue is now allowed in finally clauses, so allow that.

* Some of the tests were using generator expressions on the module
  level to check for yields on that level, giving conflicting
  results, adapted those tests.
2019-07-08 14:06:57 +02:00
Batakrishna Sahu
b3f5a542a2 Tests: Add search mode "All" (#378)
* Added search mode All

* Added "onErrorDetected()" method to let search mode decide

* Fixes for missing "# isort:start" and autoformat doing runners
2019-07-08 14:06:57 +02:00
Batakrishna Sahu
d8000327ab Tests: Added support for only mode in Test runners (#333) 2019-04-05 09:53:01 +02:00
Kay Hayen
47c99d377e Bump copyright year to 2019. 2019-01-24 16:28:13 +01:00
Kay Hayen
3957ee8628 Updated copyright year to 2018. 2018-04-30 09:46:54 +02:00
Kay Hayen
28e04e639f Python3.6: Detect yield from in coroutines as syntax errors.
* Also added new test to cover that, changing the syntax tests to
  new common testing tools code.
2017-02-13 07:11:24 +01:00
Kay Hayen
dfa23f3a0f Cleanup, remove full compatibility code for unknown encoding.
* No more useful, we just output the best information we have.

* Remove now useless test.
2017-02-05 10:31:34 +01:00
Kay Hayen
47332da901 Cleanup, syntax errors always improved.
* Always output the best syntax error format, and do away with compatible
  syntax errors. Instead make the comparison restricted to the message
  of error only.

* This reduces tedious code and tried to mimic the various Python versions
  errors for no good reasons.
2017-01-14 16:25:46 +01:00
Kay Hayen
064df32ff0 Updated copyright year to 2017. 2017-01-09 07:25:38 +01:00
Kay Hayen
66e5e8439d Compatability: Follow changes for syntax error formatting in 3.5 branch.
* They added a few cases where column carets should be there, we add
  those for improved mode, and detect the need for them.

* This should fix build errors in tests for current Debian unstable.
2017-01-07 12:24:39 +01:00
Kay Hayen
72ac16cfd9 Updated copyright year to 2016 2016-01-04 09:34:48 +01:00
Kay Hayen
f4a27c5a53 Python3.5: Detect yield in coroutines as an error. 2015-12-18 07:21:29 +01:00
Kay Hayen
ac947a9baa Tests: Minor cleanups
* Applied autoformat to more tests.
2015-08-24 23:03:34 +02:00
Kay Hayen
eba3f9978f Tests: Added syntax error test for double stars 2015-07-16 07:39:32 +02:00
Kay Hayen
545330efbc Python3: Fix, was not detecting star assignments from non-tuple or list.
* For Python2, the ast parser already found this, no longer the case with
  Python3, so we get to raise this ourselves.
2015-06-16 10:44:44 +02:00
Kay Hayen
84cf72a916 Tests: Make it possible for "__file__" to depend on run time.
* We need to include "test_common" in reference count tests, or
  else it may not be found.

* Only actual syntax tests should be there, not things that raise
  syntax error at run time, those are not real syntax tests. The
  traceback given then depends on run time.
2015-03-15 08:17:29 +01:00
Kay Hayen
8bdf6e1ede Tests: Migrated more test runners to new style, add support for coverage mode.
* Not all runners were so far using the common test code, and still some
  are not yet.

* The coverage collection aims at determining the amount of coverage we
  have from our tests.

* Also cleanups to how skipped tests are reported, and making sure that
  we do find any test at all, when searching for a match.

* More clean way to whitelist single tests to fail comparison without it
  aborting the test run.

* Now a proper search mode object is used in all cases, booleans are no
  more sufficient.
2015-01-19 07:38:34 +01:00
Kay Hayen
bc8367e3bd Updated copyright year to 2015 2015-01-13 08:43:41 +01:00
Kay Hayen
59b6141af0 Optimization: Make "__future__" imports hard imports
* Wrong future imports are caught by the "ast" module already as
  demonstrated in a new test "FutureUnknown".

* Refactored re-formulation of import statements to a dedicated
  module, further reducing the complexity of "nuitka.Building".

* Make hard module imports not raise exceptions for known good
  cases, "sys.stdout" and "__future__" imports.

* This should give less noise code for future imports amd print
  statements, removing a useless check.
2015-01-12 08:08:45 +01:00
Kay Hayen
590296c702 Typo correction
* "Occured" should be "Occurred", changed across the plate.

* Pretty widespread one.
2015-01-01 10:45:57 +01:00
Kay Hayen
51a8b15844 Tests: Cover non-ascii encoding syntax error output as well.
* This was not covered in a test so far, but ought to be.

* Also cleaned up which tests are run for a given Python version
  to be determined from filenames as per common test code.

* The avoids running tests on Python versions where they are no
  syntax errors, avoiding needless churn.
2014-12-06 00:15:15 +01:00
Kay Hayen
9e34d34000 Tests: More test suite updates. 2014-09-20 10:51:36 +02:00
Kay Hayen
3915ee82a5 Minor cleanups
* Remove "exec" source code references, they are not used currently and
  won't be in the future.
2014-07-10 09:06:13 +02:00
Kay Hayen
0882249318 Fix, adapt to syntax error changes for unknown encodings.
* There is a "msg" attribute to exceptions that can override the
  older "reason" it seems.

* All newer CPython releases started to change the text for the
  unknown encoding error.

* For Python2, the ast.parse module still gives the old text and
  therefore needs to be manually treated there.

* Sadly, the name of the unknown encoding was not displayed, but
  the used in test, this is fixed now.

* In improved mode, the new style error messages will be used.

* Moved these sub version specific checks to a dedicated module
  that is going to host such things in the future.
2014-07-10 08:54:44 +02:00
Kay Hayen
f7681d62dd "Cish", major refactoring
* Use less C++ classes, and generate more C-like code. Temporary variables
  are now used, where previously everything in a statement was wrapped in
  C++ temporary objects.

* Exception handling is now pure C code, no more "throw" at all. That means
  return codes are checked. This gives a huge performance increase for the
  use of Python exceptions.

* Generation of tuples and lists is now done without helper functions, these
  were only increasing code complexity.

* Access to local and global variables with more direct code.

* Less use of templates, more code is manually crafted.

* Moved publishing and preservation of exceptions to node tree.

* Enhanced handling of try/except and try/finally for Python3 by doing
  reformulations for their handler semantics.

* Exception handling as now done via branching.

  Huge simplification for SSA, as exception catching is now explicit
  via normal branch analysis, removing handlers as special cases.

* Many asorted improvements.

* Many, many cleanups.
2014-05-16 23:42:02 +02:00
Kay Hayen
bf480213dd Updated copyright year to 2014 2014-03-02 07:57:59 +01:00
Kay Hayen
09bd2465ed Fix, was not catching syntax error where "except:" default handler is not the last one.
* Also added test to cover this.

* Harmless incompatibility as it only allows illegal code to compile.
2013-12-30 21:59:05 +01:00
Kay Hayen
ec85e06a3e Cleanups only
* Format function and class definitions with no spaces for braces.

* PyLint cleanups
2013-12-28 11:17:33 +01:00
Kay Hayen
0fa789a247 Module recursion corrections and test improvements
* Python3.3: Fix, packages without "__init__.py" didn't have the module
  embedded.

* Tests improvement, make sure programs execute without the imported modules
  accessible.

* Triggered by Issue#114 it became apparent that the programs test case won't
  notice if the recursion does not work at all (which it did on develop at
  some point).

* Also check the flags given to the test runner in order to detect typos.
2013-11-30 08:47:56 +01:00
Kay Hayen
427004c3f4 Test improvements
* This is driven from running the tests concurrently via Buildbot.

* Share common code for tests in a module.

* Flush after every print, for proper ordering of output when redirected
  to a file.

* Enhanced handling of CTRL-C in test running, cleaning up created files
  more reliably.

* Do "2to3" conversion to temporary directory that won't collide with
  multiple instances of the tests running at once.

* Generally make it possible to run multiple instances of the tests at
  once.

* Avoid useless PYTHONPATH addition of current directory.

* Detect if a debug Python might be available even for Windows too.

* Warn about non-debug version used in reference count test.
2013-11-22 20:25:42 +01:00
Kay Hayen
21d3cb77b8 Tests: Minor improvements 2013-11-17 12:30:03 +01:00