From 9424e382ece5181f00f70f79219e3248a468eeaa Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Fri, 13 Jan 2023 14:22:07 -0500 Subject: Moved tests up. --- .github/workflows/build.yml | 7 +++---- manifest.json | 2 +- t/run.lua | 11 +++++++++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 312bb14..9dd10c6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,9 @@ jobs: sudo apt-get install musl-tools musl musl-dev CC=musl-gcc ./build.sh -DLPM_STATIC -DLPM_VERSION='"'$FULL_VERSION-x86_64-linux'"' -static && tar -czvf lpm-$FULL_VERSION-x86_64-linux.tar.gz lpm cp lpm lpm.x86_64-linux - cp lpm /tmp/lpm + - name: Run Tests + run: | + ./lpm && gcc -O3 -Ilib/lua lib/lua/onelua.c -DMAKE_LUA -DLUA_USE_LINUX -lm -ldl -o lua && ./lua t/run.lua # - name: Package Debian/Ubuntu # env: { ARCH: "amd64", DESCRIPTION: "A plugin manager for the lite-xl text editor.", MAINTAINER: "Adam Harrison " } # run: | @@ -31,9 +33,6 @@ jobs: run: | sudo apt-get install mingw-w64 && ./build.sh clean && CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-gcc-ar WINDRES=x86_64-w64-mingw32-windres CMAKE_DEFAULT_FLAGS="-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=NEVER -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_INCLUDE_PATH=/usr/share/mingw-w64/include" LZMA_CONFIGURE="--host=x86_64-w64-mingw32" GIT2_CONFIGURE="-DDLLTOOL=x86_64-w64-mingw32-dlltool" ./build.sh -DLPM_STATIC -DLPM_VERSION='"'$VERSION-x86_64-windows'"' && zip -r lpm-$VERSION-x86_64-windows.zip lpm.exe cp lpm.exe lpm.x86_64-windows.exe - - name: Run Tests - run: | - cp /tmp/lpm lpm && gcc -O3 -Ilib/lua lib/lua/onelua.c -DMAKE_LUA -DLUA_USE_LINUX -lm -ldl -o lua && ./lua t/run.lua - name: Create Release(s) env: { GITHUB_TOKEN: "${{ github.token }}" } run: | diff --git a/manifest.json b/manifest.json index c3858ed..2b030d8 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,5 @@ { - "plugins": [ + "addons": [ { "id": "plugin_manager", "version": "0.1", diff --git a/t/run.lua b/t/run.lua index 9ea462f..8c60b9c 100644 --- a/t/run.lua +++ b/t/run.lua @@ -77,6 +77,11 @@ local tests = { break end end + end, + ["07_manifest"] = function() + local results = json.decode(io.open("manifest.json", "rb"):read("*all")) + assert(#results["remotes"] == 2) + assert(#results["addons"] == 2) end } @@ -118,8 +123,10 @@ local function run_tests(tests, arg) print("[FAIL]: " .. debug.traceback(err, 2)) print() print() - print("Last Command: " .. last_command) - print(json.encode(last_command_result)) + if last_command then + print("Last Command: " .. last_command) + print(json.encode(last_command_result)) + end fail_count = fail_count + 1 failed = true end) -- cgit v1.2.3