Jelajahi Sumber

some cleanup

blueloveTH 2 tahun lalu
induk
melakukan
74ffb3f6ed
7 mengubah file dengan 14 tambahan dan 18 penghapusan
  1. 4 13
      .gitignore
  2. 0 1
      LICENSE
  3. 1 0
      build.sh
  4. 3 0
      compile_flags.txt
  5. 2 4
      prebuild.py
  6. 2 0
      run_c_binding_test.sh
  7. 2 0
      run_tests.sh

+ 4 - 13
.gitignore

@@ -5,22 +5,19 @@ __pycache__/
 .coverage
 .coverage
 .idea
 .idea
 
 
-src/main
 gmon.out
 gmon.out
 gprof.txt
 gprof.txt
-/pocketpy
 amalgamated
 amalgamated
 web/lib
 web/lib
 
 
 *.a
 *.a
 *.so
 *.so
 *.dll
 *.dll
+*.dylib
+
 plugins/unity/
 plugins/unity/
 plugins/macos/pocketpy/pocketpy.*
 plugins/macos/pocketpy/pocketpy.*
 include/pocketpy/_generated.h
 include/pocketpy/_generated.h
-profile.sh
-test
-src/httplib.h
 main.exe
 main.exe
 main.obj
 main.obj
 pocketpy.exp
 pocketpy.exp
@@ -28,13 +25,7 @@ pocketpy.lib
 APPS
 APPS
 build
 build
 
 
-pocketpy.dSYM
 main
 main
-
-pypi/
-libpocketpy.dylib
-
-.xmake/
-
+pocketpy.dSYM
 libpocketpy.dylib.dSYM/
 libpocketpy.dylib.dSYM/
-main.dSYM/
+main.dSYM/

+ 0 - 1
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,
 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
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 SOFTWARE.
-

+ 1 - 0
build.sh

@@ -31,6 +31,7 @@ SRC=$(find src/ -name "*.cpp")
 echo "> Compiling and linking source files... "
 echo "> Compiling and linking source files... "
 
 
 FLAGS="-std=c++17 -O1 -stdlib=libc++ -Wfatal-errors -Iinclude"
 FLAGS="-std=c++17 -O1 -stdlib=libc++ -Wfatal-errors -Iinclude"
+
 if [[ "$OSTYPE" == "darwin"* ]]; then
 if [[ "$OSTYPE" == "darwin"* ]]; then
     LIB_EXTENSION=".dylib"
     LIB_EXTENSION=".dylib"
     FLAGS="$FLAGS -undefined dynamic_lookup"
     FLAGS="$FLAGS -undefined dynamic_lookup"

+ 3 - 0
compile_flags.txt

@@ -1,8 +1,11 @@
 -xc++
 -xc++
+
 -Wall
 -Wall
 -W*
 -W*
+
 -std=c++17
 -std=c++17
 -stdlib=libc++
 -stdlib=libc++
+
 -Iinclude/
 -Iinclude/
 -I3rd/cjson/include/
 -I3rd/cjson/include/
 -I3rd/lua_bridge/include/
 -I3rd/lua_bridge/include/

+ 2 - 4
prebuild.py

@@ -1,5 +1,4 @@
 import os
 import os
-from datetime import datetime
 
 
 def generate_python_sources():
 def generate_python_sources():
     sources = {}
     sources = {}
@@ -15,10 +14,9 @@ def generate_python_sources():
                 new_value.append("\\x" + value[i:i+2])
                 new_value.append("\\x" + value[i:i+2])
         sources[key] = "".join(new_value)
         sources[key] = "".join(new_value)
 
 
-    timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
-
     header = '''#pragma once
     header = '''#pragma once
-// generated on ''' + timestamp + '''
+// generated by prebuild.py
+
 #include <map>
 #include <map>
 #include <string>
 #include <string>
 
 

+ 2 - 0
run_c_binding_test.sh

@@ -6,8 +6,10 @@ cmake ..
 cmake --build . --config Release
 cmake --build . --config Release
 
 
 ./test_c_bindings > binding_test_scratch
 ./test_c_bindings > binding_test_scratch
+
 echo "checking results (they should be identical)"
 echo "checking results (they should be identical)"
 diff -q -s  binding_test_scratch ../test_answers.txt
 diff -q -s  binding_test_scratch ../test_answers.txt
+
 if [ $? -eq 1 ]
 if [ $? -eq 1 ]
 then
 then
     echo "ERROR: c binding test failed"
     echo "ERROR: c binding test failed"

+ 2 - 0
run_tests.sh

@@ -11,8 +11,10 @@ fi
 rm -rf .coverage
 rm -rf .coverage
 mkdir .coverage
 mkdir .coverage
 rm pocketpy_c.gcno
 rm pocketpy_c.gcno
+
 UNITS=$(find ./ -name "*.gcno")
 UNITS=$(find ./ -name "*.gcno")
 llvm-cov-15 gcov ${UNITS} -r -s include/ -r -s src/ >> .coverage/coverage.txt
 llvm-cov-15 gcov ${UNITS} -r -s include/ -r -s src/ >> .coverage/coverage.txt
+
 mv *.gcov .coverage
 mv *.gcov .coverage
 rm *.gcda
 rm *.gcda
 rm *.gcno
 rm *.gcno