mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
After generating the Python file with definitions try to run it, so
we catch errors during the build process in stead of later during runtime.
This commit is contained in:
parent
81204152d4
commit
87eea88b5a
27 changed files with 54 additions and 0 deletions
|
|
@ -20,6 +20,8 @@ def main():
|
||||||
scanner = AppleEventsScanner(input, output, defsoutput)
|
scanner = AppleEventsScanner(input, output, defsoutput)
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done Scanning and Generating, now doing 'import aesupport' ==="
|
print "=== Done Scanning and Generating, now doing 'import aesupport' ==="
|
||||||
import aesupport
|
import aesupport
|
||||||
print "=== Done 'import aesupport'. It's up to you to compile AEmodule.c ==="
|
print "=== Done 'import aesupport'. It's up to you to compile AEmodule.c ==="
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ def main():
|
||||||
scanner = MyScanner(input, output, defsoutput)
|
scanner = MyScanner(input, output, defsoutput)
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done scanning and generating, now importing the generated code... ==="
|
print "=== Done scanning and generating, now importing the generated code... ==="
|
||||||
exec "import " + SHORT + "support"
|
exec "import " + SHORT + "support"
|
||||||
print "=== Done. It's up to you to compile it now! ==="
|
print "=== Done. It's up to you to compile it now! ==="
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ def main():
|
||||||
scanner = CarbonEvents_Scanner(input, output, defsoutput)
|
scanner = CarbonEvents_Scanner(input, output, defsoutput)
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "--done scanning, importing--"
|
print "--done scanning, importing--"
|
||||||
import CarbonEvtsupport
|
import CarbonEvtsupport
|
||||||
print "done"
|
print "done"
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,8 @@ def main():
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.gentypetest(SHORT+"typetest.py")
|
scanner.gentypetest(SHORT+"typetest.py")
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done scanning and generating, now importing the generated code... ==="
|
print "=== Done scanning and generating, now importing the generated code... ==="
|
||||||
exec "import " + SHORT + "support"
|
exec "import " + SHORT + "support"
|
||||||
print "=== Done. It's up to you to compile it now! ==="
|
print "=== Done. It's up to you to compile it now! ==="
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,8 @@ def main():
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.gentypetest(SHORT+"typetest.py")
|
scanner.gentypetest(SHORT+"typetest.py")
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done scanning and generating, now importing the generated code... ==="
|
print "=== Done scanning and generating, now importing the generated code... ==="
|
||||||
exec "import " + SHORT + "support"
|
exec "import " + SHORT + "support"
|
||||||
print "=== Done. It's up to you to compile it now! ==="
|
print "=== Done. It's up to you to compile it now! ==="
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ def main():
|
||||||
scanner = MyScanner(input, output, defsoutput)
|
scanner = MyScanner(input, output, defsoutput)
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done scanning and generating, now importing the generated code... ==="
|
print "=== Done scanning and generating, now importing the generated code... ==="
|
||||||
exec "import " + SHORT + "support"
|
exec "import " + SHORT + "support"
|
||||||
print "=== Done. It's up to you to compile it now! ==="
|
print "=== Done. It's up to you to compile it now! ==="
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ def main():
|
||||||
scanner = MyScanner(input, output, defsoutput)
|
scanner = MyScanner(input, output, defsoutput)
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done scanning and generating, now doing 'import ctlsupport' ==="
|
print "=== Done scanning and generating, now doing 'import ctlsupport' ==="
|
||||||
import ctlsupport
|
import ctlsupport
|
||||||
print "=== Done. It's up to you to compile Ctlmodule.c ==="
|
print "=== Done. It's up to you to compile Ctlmodule.c ==="
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@ def main():
|
||||||
scanner = MyScanner(input, output, defsoutput)
|
scanner = MyScanner(input, output, defsoutput)
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done scanning and generating, now importing the generated code... ==="
|
print "=== Done scanning and generating, now importing the generated code... ==="
|
||||||
exec "import " + SHORT + "support"
|
exec "import " + SHORT + "support"
|
||||||
print "=== Done. It's up to you to compile it now! ==="
|
print "=== Done. It's up to you to compile it now! ==="
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ def main():
|
||||||
scanner = MyScanner(input, output, defsoutput)
|
scanner = MyScanner(input, output, defsoutput)
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done scanning and generating, now doing 'import dragsupport' ==="
|
print "=== Done scanning and generating, now doing 'import dragsupport' ==="
|
||||||
import dragsupport
|
import dragsupport
|
||||||
print "=== Done. It's up to you to compile Dragmodule.c ==="
|
print "=== Done. It's up to you to compile Dragmodule.c ==="
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ def main():
|
||||||
scanner = MyScanner(input, output, defsoutput)
|
scanner = MyScanner(input, output, defsoutput)
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done scanning and generating, now importing the generated code... ==="
|
print "=== Done scanning and generating, now importing the generated code... ==="
|
||||||
exec "import " + SHORT + "support"
|
exec "import " + SHORT + "support"
|
||||||
print "=== Done. It's up to you to compile it now! ==="
|
print "=== Done. It's up to you to compile it now! ==="
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ def main():
|
||||||
scanner = MyScanner(input, output, defsoutput)
|
scanner = MyScanner(input, output, defsoutput)
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done scanning and generating, now importing the generated code... ==="
|
print "=== Done scanning and generating, now importing the generated code... ==="
|
||||||
exec "import " + SHORT + "support"
|
exec "import " + SHORT + "support"
|
||||||
print "=== Done. It's up to you to compile it now! ==="
|
print "=== Done. It's up to you to compile it now! ==="
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ def main():
|
||||||
scanner = MyScanner(input, output, defsoutput)
|
scanner = MyScanner(input, output, defsoutput)
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done scanning and generating, now importing the generated code... ==="
|
print "=== Done scanning and generating, now importing the generated code... ==="
|
||||||
exec "import " + SHORT + "support"
|
exec "import " + SHORT + "support"
|
||||||
print "=== Done. It's up to you to compile it now! ==="
|
print "=== Done. It's up to you to compile it now! ==="
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ def main():
|
||||||
scanner = MyScanner(input, output, defsoutput)
|
scanner = MyScanner(input, output, defsoutput)
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done scanning and generating, now importing the generated code... ==="
|
print "=== Done scanning and generating, now importing the generated code... ==="
|
||||||
exec "import " + SHORT + "support"
|
exec "import " + SHORT + "support"
|
||||||
print "=== Done. It's up to you to compile it now! ==="
|
print "=== Done. It's up to you to compile it now! ==="
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ def main():
|
||||||
scanner = IBCarbon_Scanner(input, output, defsoutput)
|
scanner = IBCarbon_Scanner(input, output, defsoutput)
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "--done scanning, importing--"
|
print "--done scanning, importing--"
|
||||||
import IBCarbonsupport
|
import IBCarbonsupport
|
||||||
print "done"
|
print "done"
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ def main():
|
||||||
scanner = MyScanner(input, output, defsoutput)
|
scanner = MyScanner(input, output, defsoutput)
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done scanning and generating, now importing the generated code... ==="
|
print "=== Done scanning and generating, now importing the generated code... ==="
|
||||||
exec "import " + SHORT + "support"
|
exec "import " + SHORT + "support"
|
||||||
print "=== Done. It's up to you to compile it now! ==="
|
print "=== Done. It's up to you to compile it now! ==="
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ def main():
|
||||||
scanner = MyScanner(input, output, defsoutput)
|
scanner = MyScanner(input, output, defsoutput)
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done scanning and generating, now importing the generated code... ==="
|
print "=== Done scanning and generating, now importing the generated code... ==="
|
||||||
exec "import " + SHORT + "support"
|
exec "import " + SHORT + "support"
|
||||||
print "=== Done. It's up to you to compile it now! ==="
|
print "=== Done. It's up to you to compile it now! ==="
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,8 @@ def main():
|
||||||
scanner = MyScanner(input, output, defsoutput)
|
scanner = MyScanner(input, output, defsoutput)
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done scanning and generating, now doing 'import menusupport' ==="
|
print "=== Done scanning and generating, now doing 'import menusupport' ==="
|
||||||
import menusupport
|
import menusupport
|
||||||
print "=== Done. It's up to you to compile Menumodule.c ==="
|
print "=== Done. It's up to you to compile Menumodule.c ==="
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ def main():
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.gentypetest(SHORT+"typetest.py")
|
scanner.gentypetest(SHORT+"typetest.py")
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done scanning and generating, now importing the generated code... ==="
|
print "=== Done scanning and generating, now importing the generated code... ==="
|
||||||
exec "import " + SHORT + "support"
|
exec "import " + SHORT + "support"
|
||||||
print "=== Done. It's up to you to compile it now! ==="
|
print "=== Done. It's up to you to compile it now! ==="
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,8 @@ def main():
|
||||||
ifp.close()
|
ifp.close()
|
||||||
ofp.close()
|
ofp.close()
|
||||||
|
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done scanning and generating, now importing the generated code... ==="
|
print "=== Done scanning and generating, now importing the generated code... ==="
|
||||||
import qdsupport
|
import qdsupport
|
||||||
print "=== Done. It's up to you to compile it now! ==="
|
print "=== Done. It's up to you to compile it now! ==="
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,8 @@ def main():
|
||||||
scanner = MyScanner(input, output, defsoutput)
|
scanner = MyScanner(input, output, defsoutput)
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done scanning and generating, now importing the generated code... ==="
|
print "=== Done scanning and generating, now importing the generated code... ==="
|
||||||
import qdoffssupport
|
import qdoffssupport
|
||||||
print "=== Done. It's up to you to compile it now! ==="
|
print "=== Done. It's up to you to compile it now! ==="
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ def main():
|
||||||
scanner = MyScanner(input, output, defsoutput)
|
scanner = MyScanner(input, output, defsoutput)
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done scanning and generating, now importing the generated code... ==="
|
print "=== Done scanning and generating, now importing the generated code... ==="
|
||||||
exec "import " + SHORT + "support"
|
exec "import " + SHORT + "support"
|
||||||
print "=== Done. It's up to you to compile it now! ==="
|
print "=== Done. It's up to you to compile it now! ==="
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ def main():
|
||||||
scanner = ResourcesScanner(input, output, defsoutput)
|
scanner = ResourcesScanner(input, output, defsoutput)
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done scanning and generating, now doing 'import ressupport' ==="
|
print "=== Done scanning and generating, now doing 'import ressupport' ==="
|
||||||
import ressupport
|
import ressupport
|
||||||
print "=== Done 'import ressupport'. It's up to you to compile Resmodule.c ==="
|
print "=== Done 'import ressupport'. It's up to you to compile Resmodule.c ==="
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ def main():
|
||||||
scanner = MyScanner(input, output, defsoutput)
|
scanner = MyScanner(input, output, defsoutput)
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done scanning and generating, now importing the generated code... ==="
|
print "=== Done scanning and generating, now importing the generated code... ==="
|
||||||
exec "import " + SHORT + "support"
|
exec "import " + SHORT + "support"
|
||||||
print "=== Done. It's up to you to compile it now! ==="
|
print "=== Done. It's up to you to compile it now! ==="
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ def main():
|
||||||
scanner = SoundScanner(input, output, defsoutput)
|
scanner = SoundScanner(input, output, defsoutput)
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done scanning and generating, now doing 'import sndsupport' ==="
|
print "=== Done scanning and generating, now doing 'import sndsupport' ==="
|
||||||
import sndsupport
|
import sndsupport
|
||||||
print "=== Done. It's up to you to compile Sndmodule.c ==="
|
print "=== Done. It's up to you to compile Sndmodule.c ==="
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ def main():
|
||||||
scanner = MyScanner(input, output, defsoutput)
|
scanner = MyScanner(input, output, defsoutput)
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done scanning and generating, now importing the generated code... ==="
|
print "=== Done scanning and generating, now importing the generated code... ==="
|
||||||
exec "import " + SHORT + "support"
|
exec "import " + SHORT + "support"
|
||||||
print "=== Done. It's up to you to compile it now! ==="
|
print "=== Done. It's up to you to compile it now! ==="
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,8 @@ def main():
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
## scanner.gentypetest(SHORT+"typetest.py")
|
## scanner.gentypetest(SHORT+"typetest.py")
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done scanning and generating, now importing the generated code... ==="
|
print "=== Done scanning and generating, now importing the generated code... ==="
|
||||||
exec "import " + SHORT + "support"
|
exec "import " + SHORT + "support"
|
||||||
print "=== Done. It's up to you to compile it now! ==="
|
print "=== Done. It's up to you to compile it now! ==="
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,8 @@ def main():
|
||||||
scanner = MyScanner(input, output, defsoutput)
|
scanner = MyScanner(input, output, defsoutput)
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
print "=== Testing definitions output code ==="
|
||||||
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done scanning and generating, now importing the generated code... ==="
|
print "=== Done scanning and generating, now importing the generated code... ==="
|
||||||
import winsupport
|
import winsupport
|
||||||
print "=== Done. It's up to you to compile it now! ==="
|
print "=== Done. It's up to you to compile it now! ==="
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue