• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Castle: The best Real-Time/Embedded/HighTech language EVER. Attempt 2


Commit MetaInfo

Revision9e8d9a7552ae4d80974ef529f8d95730eb6d69c9 (tree)
Time2023-02-11 08:25:45
AuthorAlbert Mietus < albert AT mietus DOT nl >
CommiterAlbert Mietus < albert AT mietus DOT nl >

Log Message

asis

Change Summary

Incremental Difference

diff -r 6d8b6474c25e -r 9e8d9a7552ae castle/writers/CC2Cpy/Component.py
--- a/castle/writers/CC2Cpy/Component.py Fri Feb 10 23:20:01 2023 +0100
+++ b/castle/writers/CC2Cpy/Component.py Sat Feb 11 00:25:45 2023 +0100
@@ -36,7 +36,9 @@
3636 elif self.type is None:
3737 return "NULL"
3838 else:
39+ from warnings import warn
3940 tn = self.type if isinstance(self.type, str) else self.type.__name__
41+ warn(f"Using string (or other non CC_Base types) port.types (for >>{tn}<<) is not wise", DeprecationWarning, stacklevel=2)
4042 return f'&cc_P_{tn}'
4143
4244
diff -r 6d8b6474c25e -r 9e8d9a7552ae pytst/writers/CC2Cpy/test_9_genSieve.py
--- a/pytst/writers/CC2Cpy/test_9_genSieve.py Fri Feb 10 23:20:01 2023 +0100
+++ b/pytst/writers/CC2Cpy/test_9_genSieve.py Sat Feb 11 00:25:45 2023 +0100
@@ -7,6 +7,10 @@
77 import logging; logger = logging.getLogger(__name__)
88 import pytest
99
10+from pathlib import Path
11+import os
12+import subprocess
13+
1014
1115 from castle.writers.CC2Cpy.Protocol import *
1216 from castle.writers.CC2Cpy.Event import *
@@ -43,11 +47,6 @@
4347 )
4448
4549
46-from pathlib import Path
47-from tempfile import TemporaryDirectory
48-import os
49-import subprocess
50-
5150
5251 def write_header(f):
5352 f.writelines("""/*(C) Alber Mietus, Generated code*/
@@ -57,8 +56,9 @@
5756 """)
5857
5958 def verify_it_compiles(file, in_dir:Path):
59+ print(f"Compiling {file}")
6060 os.symlink("/Users/albert/work/CCastle2/from_CC-Castle/SRC-EXAMPLE/SIEVE/2.GCD-work/CC", in_dir/"CC")
61- return_code = subprocess.run(["gcc", "-I", in_dir, "-c", file]).returncode
61+ return_code = subprocess.run(["cc", "-arch", "x86_64", "-arch", "arm64", "-I", in_dir, "-c", file], cwd=in_dir).returncode
6262 assert return_code == 0
6363
6464
@@ -69,7 +69,7 @@
6969 f.write(sieveInterface.render())
7070 verify_it_compiles(f.name, tmp_path)
7171
72-@pytest.mark.skip(reason="sieveClass refer to ``cc_B_Sieve_methods`` and ``CC_C_Sieve`` which aren't renderable yet")
72+#@pytest.mark.skip(reason="sieveClass refer to ``cc_B_Sieve_methods`` and ``CC_C_Sieve`` which aren't renderable yet")
7373 def test_0b(simpleSieve, sieveInterface, sieveClass, tmp_path):
7474 with open(tmp_path/"sieve-interface.c", 'w') as f:
7575 write_header(f)
@@ -77,7 +77,7 @@
7777 f.write(sieveInterface.render())
7878 f.write(sieveClass.render())
7979 verify_it_compiles(f.name, tmp_path)
80-
80+
8181
8282 @pytest.mark.skip(reason="More Generate C-file(s)")
8383 def test_more(): pass