From 74ffb3f6edfe84d00c7c5ed7384e635ff88cc42a Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sat, 20 Jan 2024 22:52:30 +0800 Subject: [PATCH] some cleanup --- .gitignore | 17 ++++------------- LICENSE | 1 - build.sh | 1 + compile_flags.txt | 3 +++ prebuild.py | 6 ++---- run_c_binding_test.sh | 2 ++ run_tests.sh | 2 ++ 7 files changed, 14 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 1905b6dd..b7e99216 100644 --- a/.gitignore +++ b/.gitignore @@ -5,22 +5,19 @@ __pycache__/ .coverage .idea -src/main gmon.out gprof.txt -/pocketpy amalgamated web/lib *.a *.so *.dll +*.dylib + plugins/unity/ plugins/macos/pocketpy/pocketpy.* include/pocketpy/_generated.h -profile.sh -test -src/httplib.h main.exe main.obj pocketpy.exp @@ -28,13 +25,7 @@ pocketpy.lib APPS build -pocketpy.dSYM main - -pypi/ -libpocketpy.dylib - -.xmake/ - +pocketpy.dSYM libpocketpy.dylib.dSYM/ -main.dSYM/ \ No newline at end of file +main.dSYM/ diff --git a/LICENSE b/LICENSE index 5c14294a..4e1dc70c 100644 --- a/LICENSE +++ b/LICENSE @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/build.sh b/build.sh index edd0bca5..c72d5a32 100644 --- a/build.sh +++ b/build.sh @@ -31,6 +31,7 @@ SRC=$(find src/ -name "*.cpp") echo "> Compiling and linking source files... " FLAGS="-std=c++17 -O1 -stdlib=libc++ -Wfatal-errors -Iinclude" + if [[ "$OSTYPE" == "darwin"* ]]; then LIB_EXTENSION=".dylib" FLAGS="$FLAGS -undefined dynamic_lookup" diff --git a/compile_flags.txt b/compile_flags.txt index 9f8df7e9..6a6ce7ea 100644 --- a/compile_flags.txt +++ b/compile_flags.txt @@ -1,8 +1,11 @@ -xc++ + -Wall -W* + -std=c++17 -stdlib=libc++ + -Iinclude/ -I3rd/cjson/include/ -I3rd/lua_bridge/include/ diff --git a/prebuild.py b/prebuild.py index 013b3c6b..6d697620 100644 --- a/prebuild.py +++ b/prebuild.py @@ -1,5 +1,4 @@ import os -from datetime import datetime def generate_python_sources(): sources = {} @@ -15,10 +14,9 @@ def generate_python_sources(): new_value.append("\\x" + value[i:i+2]) sources[key] = "".join(new_value) - timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S") - header = '''#pragma once -// generated on ''' + timestamp + ''' +// generated by prebuild.py + #include #include diff --git a/run_c_binding_test.sh b/run_c_binding_test.sh index a587c366..0f90d15a 100644 --- a/run_c_binding_test.sh +++ b/run_c_binding_test.sh @@ -6,8 +6,10 @@ cmake .. cmake --build . --config Release ./test_c_bindings > binding_test_scratch + echo "checking results (they should be identical)" diff -q -s binding_test_scratch ../test_answers.txt + if [ $? -eq 1 ] then echo "ERROR: c binding test failed" diff --git a/run_tests.sh b/run_tests.sh index d2a4a74f..6ce5f06e 100644 --- a/run_tests.sh +++ b/run_tests.sh @@ -11,8 +11,10 @@ fi rm -rf .coverage mkdir .coverage rm pocketpy_c.gcno + UNITS=$(find ./ -name "*.gcno") llvm-cov-15 gcov ${UNITS} -r -s include/ -r -s src/ >> .coverage/coverage.txt + mv *.gcov .coverage rm *.gcda rm *.gcno