From 073b755596ffa4e251744a1d78263f34b05b31b9 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 13:22:08 -0700 Subject: [PATCH 01/40] add basic appveyor config --- appveyor.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000000..f8eb821364 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,6 @@ +platform: + - x86 + - x64 + +build_script: + - C:/cygwin/bin/bash bootstrap.sh From 2a83f33bf5bba09363d314c6ab6eeca2785b9f86 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 13:28:04 -0700 Subject: [PATCH 02/40] use the batch file --- appveyor.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index f8eb821364..93f7ae5a8b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,4 +3,9 @@ platform: - x64 build_script: - - C:/cygwin/bin/bash bootstrap.sh + - git clone -q --depth 1 git://github.com/nim-lang/csources.git csources + - cd csources + - build.bat + - cd .. + - bin/nim koch + - koch boot From 5602c253ed99440f2687344c40d760aae91dfdce Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 13:42:37 -0700 Subject: [PATCH 03/40] set path for msys64 --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 93f7ae5a8b..87c89b3e32 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,6 +3,7 @@ platform: - x64 build_script: + - SET PATH=c:\msys64\bin;%PATH% - git clone -q --depth 1 git://github.com/nim-lang/csources.git csources - cd csources - build.bat From ba5366e84b93352ce320568a04b7150dd6166449 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 13:44:51 -0700 Subject: [PATCH 04/40] try usr/bin --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 87c89b3e32..8f53176554 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,7 +3,7 @@ platform: - x64 build_script: - - SET PATH=c:\msys64\bin;%PATH% + - SET PATH=C:\msys64\usr\bin\;%PATH% - git clone -q --depth 1 git://github.com/nim-lang/csources.git csources - cd csources - build.bat From 0d2fe39357245b7cc6687da277921f6ea5541eff Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 13:56:31 -0700 Subject: [PATCH 05/40] try mingw64 path --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 8f53176554..f639c62bf5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,7 +3,7 @@ platform: - x64 build_script: - - SET PATH=C:\msys64\usr\bin\;%PATH% + - SET PATH=C:\msys64\mingw64\bin;%PATH% - git clone -q --depth 1 git://github.com/nim-lang/csources.git csources - cd csources - build.bat From 38e74630911dbe213a9f306c98053337c38d4491 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 14:06:07 -0700 Subject: [PATCH 06/40] start with 64-bit build --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f639c62bf5..2c921a9999 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,12 +1,12 @@ platform: - - x86 - x64 build_script: - SET PATH=C:\msys64\mingw64\bin;%PATH% + - gcc -v - git clone -q --depth 1 git://github.com/nim-lang/csources.git csources - cd csources - - build.bat + - build64.bat - cd .. - bin/nim koch - koch boot From e2ec02fb7dcb18bee6fc802d465b6d4bedaef6d0 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 14:10:12 -0700 Subject: [PATCH 07/40] rename; faster clones --- appveyor.yml => .appveyor.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename appveyor.yml => .appveyor.yml (100%) diff --git a/appveyor.yml b/.appveyor.yml similarity index 100% rename from appveyor.yml rename to .appveyor.yml From 3698b0e4b7b542996ff28dce61d8958bddbcc5e2 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 14:11:11 -0700 Subject: [PATCH 08/40] oops, wrong name --- .appveyor.yml => appveyor.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .appveyor.yml => appveyor.yml (100%) diff --git a/.appveyor.yml b/appveyor.yml similarity index 100% rename from .appveyor.yml rename to appveyor.yml From 6fc82607dfd30eae5dc025eba1c77f87ba5e21f3 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 14:13:55 -0700 Subject: [PATCH 09/40] oh yea windows paths --- appveyor.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 2c921a9999..0ff1bba80b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,12 +1,14 @@ +clone_depth: 5 + platform: - x64 build_script: - SET PATH=C:\msys64\mingw64\bin;%PATH% - gcc -v - - git clone -q --depth 1 git://github.com/nim-lang/csources.git csources + - git clone -q --depth 1 https://github.com/nim-lang/csources - cd csources - build64.bat - cd .. - - bin/nim koch + - bin\nim koch - koch boot From 3753b16786dee3536b6f1216c4d06e93814a4f21 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 14:17:09 -0700 Subject: [PATCH 10/40] so close --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 0ff1bba80b..1cfdf384bc 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,5 +10,5 @@ build_script: - cd csources - build64.bat - cd .. - - bin\nim koch + - bin\nim c koch - koch boot From 8cf343078847a319445711f43678a177e2216936 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 14:22:31 -0700 Subject: [PATCH 11/40] add test script --- appveyor.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 1cfdf384bc..d2ee475877 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,3 +12,12 @@ build_script: - cd .. - bin\nim c koch - koch boot + - koch boot -d:release + +before_test: + - nim e install_nimble.nims + - nimble update + - nimble install zip + +test_script: + - koch test all --pedantic From ed24ad3edd17cc39d3601c017372439c2522d4ae Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 14:28:21 -0700 Subject: [PATCH 12/40] add nim.exe artifact --- appveyor.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index d2ee475877..a65a0cccf7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,8 @@ clone_depth: 5 +artifacts: + - path: bin\nim.exe + platform: - x64 From d089b6a55b334c3b697a077c938478d5533f1c9c Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 14:35:55 -0700 Subject: [PATCH 13/40] add bin to path --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index a65a0cccf7..ec9a6aca35 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,13 +7,13 @@ platform: - x64 build_script: - - SET PATH=C:\msys64\mingw64\bin;%PATH% + - SET PATH=C:\msys64\mingw64\bin;bin;%PATH% - gcc -v - git clone -q --depth 1 https://github.com/nim-lang/csources - cd csources - build64.bat - cd .. - - bin\nim c koch + - nim c koch - koch boot - koch boot -d:release From 8d02dc2e62a8cf1d2afdfab05830a02d1ab2ef8f Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 14:48:14 -0700 Subject: [PATCH 14/40] try installing openssl? --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index ec9a6aca35..9899c30752 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,6 +7,7 @@ platform: - x64 build_script: + - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S openssl" - SET PATH=C:\msys64\mingw64\bin;bin;%PATH% - gcc -v - git clone -q --depth 1 https://github.com/nim-lang/csources From d069ba7ef8866c1a9234a27100d70fd6ca7163ad Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 15:02:26 -0700 Subject: [PATCH 15/40] list out openssl contents --- appveyor.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 9899c30752..85577ed16f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,7 +7,9 @@ platform: - x64 build_script: - - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S openssl" + - C:\msys64\usr\bin\bash -lc "pacman -Ql openssl" + - dir c:\msys64\ssl + - dir c:\msys64\mingw64\lib - SET PATH=C:\msys64\mingw64\bin;bin;%PATH% - gcc -v - git clone -q --depth 1 https://github.com/nim-lang/csources From 32f522be06713e67e59d19f09a98e20d25a8f488 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 15:07:19 -0700 Subject: [PATCH 16/40] install libssl --- appveyor.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 85577ed16f..cc77fbee5a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,10 +6,10 @@ artifacts: platform: - x64 +before_build: + - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S openssl-devel" + build_script: - - C:\msys64\usr\bin\bash -lc "pacman -Ql openssl" - - dir c:\msys64\ssl - - dir c:\msys64\mingw64\lib - SET PATH=C:\msys64\mingw64\bin;bin;%PATH% - gcc -v - git clone -q --depth 1 https://github.com/nim-lang/csources From 9ca773c3e2c63a0cfa6311a7b7cb199a53ecf4fb Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 15:15:32 -0700 Subject: [PATCH 17/40] show libopenssl contents --- appveyor.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index cc77fbee5a..038f34d4e2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,6 +8,8 @@ platform: before_build: - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S openssl-devel" + - C:\msys64\usr\bin\bash -lc "pacman -Ql libopenssl" + - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S libcurl-devel libsqlite-devel pcre-devel ncurses-devel mingw-w64-ncurses mingw-w64-SDL mingw-w64-glfw" build_script: - SET PATH=C:\msys64\mingw64\bin;bin;%PATH% @@ -24,6 +26,8 @@ before_test: - nim e install_nimble.nims - nimble update - nimble install zip + - nimble install opengl + - nimble install sdl1 test_script: - koch test all --pedantic From 27037d49106091b5aee4d546cdce163a305dd384 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 15:19:18 -0700 Subject: [PATCH 18/40] show openssl-devel contents --- appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 038f34d4e2..ea7674bb08 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,7 +9,8 @@ platform: before_build: - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S openssl-devel" - C:\msys64\usr\bin\bash -lc "pacman -Ql libopenssl" - - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S libcurl-devel libsqlite-devel pcre-devel ncurses-devel mingw-w64-ncurses mingw-w64-SDL mingw-w64-glfw" + - C:\msys64\usr\bin\bash -lc "pacman -Ql openssl-devel" + - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S libcurl-devel libsqlite-devel pcre-devel ncurses-devel" build_script: - SET PATH=C:\msys64\mingw64\bin;bin;%PATH% From eac9fdae5d8d99f70dc1c3f94db252f120ef7bb9 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 15:26:39 -0700 Subject: [PATCH 19/40] use pre-built dlls --- appveyor.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index ea7674bb08..b8c4ead77d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,13 +7,11 @@ platform: - x64 before_build: - - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S openssl-devel" - - C:\msys64\usr\bin\bash -lc "pacman -Ql libopenssl" - - C:\msys64\usr\bin\bash -lc "pacman -Ql openssl-devel" - - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S libcurl-devel libsqlite-devel pcre-devel ncurses-devel" + - appveyor DownloadFile http://nim-lang.org/download/dlls.zip + - 7z x dlls.zip build_script: - - SET PATH=C:\msys64\mingw64\bin;bin;%PATH% + - SET PATH=C:\msys64\mingw64\bin;dlls;bin;%PATH% - gcc -v - git clone -q --depth 1 https://github.com/nim-lang/csources - cd csources @@ -27,8 +25,6 @@ before_test: - nim e install_nimble.nims - nimble update - nimble install zip - - nimble install opengl - - nimble install sdl1 test_script: - koch test all --pedantic From 75f648398a0d1c3477578f0ad204a32a365ea7d4 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 15:31:57 -0700 Subject: [PATCH 20/40] avoid libcurl.dll since it clashes with msys curl --- appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index b8c4ead77d..5ffe41a493 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,7 +8,8 @@ platform: before_build: - appveyor DownloadFile http://nim-lang.org/download/dlls.zip - - 7z x dlls.zip + - 7z e dlls.zip -odlls + - del dlls\libcurl.dll build_script: - SET PATH=C:\msys64\mingw64\bin;dlls;bin;%PATH% From c2940260e55203f764965e16b1776b0b31d2d482 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 16:06:31 -0700 Subject: [PATCH 21/40] avoid sqlite db on travis and appveyor --- tests/testament/backend.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/testament/backend.nim b/tests/testament/backend.nim index e2e2e2dd5c..2698356070 100644 --- a/tests/testament/backend.nim +++ b/tests/testament/backend.nim @@ -112,7 +112,8 @@ proc writeTestResult*(name, category, target, thisCommit, thisMachine) proc open*() = - db = open(connection="testament.db", user="testament", password="", + let dbFile = if existsEnv("TRAVIS") or existsEnv("APPVEYOR"): ":memory:" else: "testament.db" + db = open(connection=dbFile, user="testament", password="", database="testament") createDb() thisMachine = getMachine(db) From c34cbe690c109054bd4ff172751762d0783c4690 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 16:06:51 -0700 Subject: [PATCH 22/40] tie into appveyor test results api --- tests/testament/tester.nim | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/testament/tester.nim b/tests/testament/tester.nim index 636093a7f5..c6cd904382 100644 --- a/tests/testament/tester.nim +++ b/tests/testament/tester.nim @@ -164,6 +164,16 @@ proc addResult(r: var TResults, test: TTest, styledEcho fgYellow, "Gotten:" styledEcho styleBright, given, "\n" + if existsEnv("APPVEYOR"): + let (outcome, msg) = + if success == reSuccess: + ("Passed", "") + elif success == reIgnored: + ("Skipped", "") + else: + ("Failed", "Expected:" & expected & "\n" & "Gotten:" & given & "\n") + discard execProcess("appveyor", args=["AddTest", name, "-Framework", test.cat.string, "-FileName", $test.name, "-Outcome", outcome, "-ErrorMessage", msg], options={poStdErrToStdOut, poUsePath}) + proc cmpMsgs(r: var TResults, expected, given: TSpec, test: TTest) = if strip(expected.msg) notin strip(given.msg): r.addResult(test, expected.msg, given.msg, reMsgsDiffer) From 5b6d4b03a205e68f4e1f6457520bda80f9bb9313 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 16:15:13 -0700 Subject: [PATCH 23/40] download and extract fasm.exe --- appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 5ffe41a493..e7fd788cac 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,6 +10,8 @@ before_build: - appveyor DownloadFile http://nim-lang.org/download/dlls.zip - 7z e dlls.zip -odlls - del dlls\libcurl.dll + - appveyor DownloadFile http://flatassembler.net/fasmw17139.zip + - 7z e fasmw17139.zip -obin fasm.exe build_script: - SET PATH=C:\msys64\mingw64\bin;dlls;bin;%PATH% From 6af9ac18f15d15c39267e5569e8cd549cee1c35a Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 16:25:03 -0700 Subject: [PATCH 24/40] clean up whitespace on error msg --- tests/testament/tester.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testament/tester.nim b/tests/testament/tester.nim index c6cd904382..5aa6a9ab70 100644 --- a/tests/testament/tester.nim +++ b/tests/testament/tester.nim @@ -171,7 +171,7 @@ proc addResult(r: var TResults, test: TTest, elif success == reIgnored: ("Skipped", "") else: - ("Failed", "Expected:" & expected & "\n" & "Gotten:" & given & "\n") + ("Failed", "Expected:\n" & expected & "\n\n" & "Gotten:\n" & given) discard execProcess("appveyor", args=["AddTest", name, "-Framework", test.cat.string, "-FileName", $test.name, "-Outcome", outcome, "-ErrorMessage", msg], options={poStdErrToStdOut, poUsePath}) proc cmpMsgs(r: var TResults, expected, given: TSpec, test: TTest) = From 3dfcaec25f3df4630d547fb0751801c151e6929b Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 16:27:06 -0700 Subject: [PATCH 25/40] use category as filename, and full filename in test name --- tests/testament/tester.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testament/tester.nim b/tests/testament/tester.nim index 5aa6a9ab70..8c8d63da7b 100644 --- a/tests/testament/tester.nim +++ b/tests/testament/tester.nim @@ -172,7 +172,7 @@ proc addResult(r: var TResults, test: TTest, ("Skipped", "") else: ("Failed", "Expected:\n" & expected & "\n\n" & "Gotten:\n" & given) - discard execProcess("appveyor", args=["AddTest", name, "-Framework", test.cat.string, "-FileName", $test.name, "-Outcome", outcome, "-ErrorMessage", msg], options={poStdErrToStdOut, poUsePath}) + discard execProcess("appveyor", args=["AddTest", test.name & test.options, "-FileName", test.cat.string, "-Outcome", outcome, "-ErrorMessage", msg], options={poStdErrToStdOut, poUsePath}) proc cmpMsgs(r: var TResults, expected, given: TSpec, test: TTest) = if strip(expected.msg) notin strip(given.msg): From cdd59ebf200275757baa94cf0ba423c6c15c1bff Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 16:27:11 -0700 Subject: [PATCH 26/40] fix unsafeaddr test --- tests/ccgbugs/tunsafeaddr.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ccgbugs/tunsafeaddr.nim b/tests/ccgbugs/tunsafeaddr.nim index 4f05c7c21b..518e05b258 100644 --- a/tests/ccgbugs/tunsafeaddr.nim +++ b/tests/ccgbugs/tunsafeaddr.nim @@ -3,8 +3,8 @@ discard """ """ {.emit: """ -long sum(long* a, long len) { - long i, result = 0; +NI sum(NI* a, NI len) { + NI i, result = 0; for (i = 0; i < len; ++i) result += a[i]; return result; } From b418153899ae5c0a9cd53376e8684f32292bb0e1 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 16:32:01 -0700 Subject: [PATCH 27/40] install zlib --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index e7fd788cac..3c28536519 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,6 +7,7 @@ platform: - x64 before_build: + - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S zlib-devel" - appveyor DownloadFile http://nim-lang.org/download/dlls.zip - 7z e dlls.zip -odlls - del dlls\libcurl.dll From 582c5054a11a3d91264a5875bed8463cbed29776 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 16:42:08 -0700 Subject: [PATCH 28/40] report duration to appveyor runner --- tests/testament/tester.nim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/testament/tester.nim b/tests/testament/tester.nim index 8c8d63da7b..4d4bade002 100644 --- a/tests/testament/tester.nim +++ b/tests/testament/tester.nim @@ -12,7 +12,7 @@ import parseutils, strutils, pegs, os, osproc, streams, parsecfg, json, marshal, backend, parseopt, specs, htmlgen, browsers, terminal, - algorithm, compiler/nodejs, re + algorithm, compiler/nodejs, re, times const resultsFile = "testresults.html" @@ -47,6 +47,7 @@ type options: string target: TTarget action: TTestAction + startTime: float # ---------------------------------------------------------------------------- @@ -143,6 +144,7 @@ proc `$`(x: TResults): string = proc addResult(r: var TResults, test: TTest, expected, given: string, success: TResultEnum) = let name = test.name.extractFilename & test.options + let duration = epochTime() - test.startTime backend.writeTestResult(name = name, category = test.cat.string, target = $test.target, @@ -172,7 +174,7 @@ proc addResult(r: var TResults, test: TTest, ("Skipped", "") else: ("Failed", "Expected:\n" & expected & "\n\n" & "Gotten:\n" & given) - discard execProcess("appveyor", args=["AddTest", test.name & test.options, "-FileName", test.cat.string, "-Outcome", outcome, "-ErrorMessage", msg], options={poStdErrToStdOut, poUsePath}) + discard execProcess("appveyor", args=["AddTest", test.name & test.options, "-FileName", test.cat.string, "-Outcome", outcome, "-ErrorMessage", msg, "-Duration", $(duration*1000).int], options={poStdErrToStdOut, poUsePath}) proc cmpMsgs(r: var TResults, expected, given: TSpec, test: TTest) = if strip(expected.msg) notin strip(given.msg): @@ -366,7 +368,7 @@ proc makeTest(test, options: string, cat: Category, action = actionCompile, target = targetC, env: string = ""): TTest = # start with 'actionCompile', will be overwritten in the spec: result = TTest(cat: cat, name: test, options: options, - target: target, action: action) + target: target, action: action, startTime: epochTime()) include categories From 6457e8f56e17a7dc7c8df8364b1c91a787991e9c Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 16:45:48 -0700 Subject: [PATCH 29/40] skip tester html on travis/appveyor --- koch.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/koch.nim b/koch.nim index 3d1a22b9cc..f7c0ae204d 100644 --- a/koch.nim +++ b/koch.nim @@ -342,7 +342,8 @@ proc tests(args: string) = exec "nim c --lib:lib -d:release --opt:speed compiler/nim.nim" let tester = quoteShell(getCurrentDir() / "tests/testament/tester".exe) let success = tryExec tester & " " & (args|"all") - exec tester & " html" + if not existsEnv("TRAVIS") and not existsEnv("APPVEYOR"): + exec tester & " html" if not success: quit("tests failed", QuitFailure) From 7954fcfa9e1b6d8c5682b922b042566ba0d84465 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 17:50:35 -0700 Subject: [PATCH 30/40] show current commit --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 3c28536519..8ce8f59c1d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,6 +7,7 @@ platform: - x64 before_build: + - git log -1 - C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S zlib-devel" - appveyor DownloadFile http://nim-lang.org/download/dlls.zip - 7z e dlls.zip -odlls From f0793a6d97164bbcba4145525fc5d1a64b6c14d7 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 17:50:54 -0700 Subject: [PATCH 31/40] collect any output of appveyor command --- tests/testament/tester.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/testament/tester.nim b/tests/testament/tester.nim index 4d4bade002..5b315198d3 100644 --- a/tests/testament/tester.nim +++ b/tests/testament/tester.nim @@ -174,7 +174,9 @@ proc addResult(r: var TResults, test: TTest, ("Skipped", "") else: ("Failed", "Expected:\n" & expected & "\n\n" & "Gotten:\n" & given) - discard execProcess("appveyor", args=["AddTest", test.name & test.options, "-FileName", test.cat.string, "-Outcome", outcome, "-ErrorMessage", msg, "-Duration", $(duration*1000).int], options={poStdErrToStdOut, poUsePath}) + var p = startProcess("appveyor", args=["AddTest", test.name & test.options, "-FileName", test.cat.string, "-Outcome", outcome, "-ErrorMessage", msg, "-Duration", $(duration*1000).int], options={poStdErrToStdOut, poUsePath, poParentStreams}) + waitForExit(p) + close(p) proc cmpMsgs(r: var TResults, expected, given: TSpec, test: TTest) = if strip(expected.msg) notin strip(given.msg): From 24ec975aa172b59e86944ea62355da3f436ea41d Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 18:15:59 -0700 Subject: [PATCH 32/40] fix compile error --- tests/testament/tester.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testament/tester.nim b/tests/testament/tester.nim index 5b315198d3..0470627f28 100644 --- a/tests/testament/tester.nim +++ b/tests/testament/tester.nim @@ -175,7 +175,7 @@ proc addResult(r: var TResults, test: TTest, else: ("Failed", "Expected:\n" & expected & "\n\n" & "Gotten:\n" & given) var p = startProcess("appveyor", args=["AddTest", test.name & test.options, "-FileName", test.cat.string, "-Outcome", outcome, "-ErrorMessage", msg, "-Duration", $(duration*1000).int], options={poStdErrToStdOut, poUsePath, poParentStreams}) - waitForExit(p) + discard waitForExit(p) close(p) proc cmpMsgs(r: var TResults, expected, given: TSpec, test: TTest) = From f49cffeb19562867ea5df5d285bd06d1cdc46bf4 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 18:28:57 -0700 Subject: [PATCH 33/40] framework is required --- tests/testament/tester.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testament/tester.nim b/tests/testament/tester.nim index 0470627f28..840937ddc2 100644 --- a/tests/testament/tester.nim +++ b/tests/testament/tester.nim @@ -174,7 +174,7 @@ proc addResult(r: var TResults, test: TTest, ("Skipped", "") else: ("Failed", "Expected:\n" & expected & "\n\n" & "Gotten:\n" & given) - var p = startProcess("appveyor", args=["AddTest", test.name & test.options, "-FileName", test.cat.string, "-Outcome", outcome, "-ErrorMessage", msg, "-Duration", $(duration*1000).int], options={poStdErrToStdOut, poUsePath, poParentStreams}) + var p = startProcess("appveyor", args=["AddTest", test.name & test.options, "-Framework", "nim-testament", "-FileName", test.cat.string, "-Outcome", outcome, "-ErrorMessage", msg, "-Duration", $(duration*1000).int], options={poStdErrToStdOut, poUsePath, poParentStreams}) discard waitForExit(p) close(p) From cadef4378663640d9985f2ecdb135cc0549b7a11 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 7 Oct 2015 21:42:12 -0700 Subject: [PATCH 34/40] standardize on forward slashes for paths --- tests/testament/tester.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testament/tester.nim b/tests/testament/tester.nim index 840937ddc2..b5f5443f9e 100644 --- a/tests/testament/tester.nim +++ b/tests/testament/tester.nim @@ -174,7 +174,7 @@ proc addResult(r: var TResults, test: TTest, ("Skipped", "") else: ("Failed", "Expected:\n" & expected & "\n\n" & "Gotten:\n" & given) - var p = startProcess("appveyor", args=["AddTest", test.name & test.options, "-Framework", "nim-testament", "-FileName", test.cat.string, "-Outcome", outcome, "-ErrorMessage", msg, "-Duration", $(duration*1000).int], options={poStdErrToStdOut, poUsePath, poParentStreams}) + var p = startProcess("appveyor", args=["AddTest", test.name.replace("\\", "/") & test.options, "-Framework", "nim-testament", "-FileName", test.cat.string, "-Outcome", outcome, "-ErrorMessage", msg, "-Duration", $(duration*1000).int], options={poStdErrToStdOut, poUsePath, poParentStreams}) discard waitForExit(p) close(p) From 5bb0820596512be5a1314b5ac3f68b9b4a6e62df Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Thu, 8 Oct 2015 10:58:37 -0700 Subject: [PATCH 35/40] show failure code --- tests/testament/tester.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testament/tester.nim b/tests/testament/tester.nim index b5f5443f9e..b18e343cda 100644 --- a/tests/testament/tester.nim +++ b/tests/testament/tester.nim @@ -173,7 +173,7 @@ proc addResult(r: var TResults, test: TTest, elif success == reIgnored: ("Skipped", "") else: - ("Failed", "Expected:\n" & expected & "\n\n" & "Gotten:\n" & given) + ("Failed", "Failure: " & $success & "\nExpected:\n" & expected & "\n\n" & "Gotten:\n" & given) var p = startProcess("appveyor", args=["AddTest", test.name.replace("\\", "/") & test.options, "-Framework", "nim-testament", "-FileName", test.cat.string, "-Outcome", outcome, "-ErrorMessage", msg, "-Duration", $(duration*1000).int], options={poStdErrToStdOut, poUsePath, poParentStreams}) discard waitForExit(p) close(p) From a1750bd43189bb36f5e461df139b7b1a5b4c6b5c Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Thu, 8 Oct 2015 10:58:52 -0700 Subject: [PATCH 36/40] skip sdl/opengl/fsmonitor tests when unavailable --- tests/testament/tester.nim | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/testament/tester.nim b/tests/testament/tester.nim index b18e343cda..a5e6220100 100644 --- a/tests/testament/tester.nim +++ b/tests/testament/tester.nim @@ -105,6 +105,12 @@ proc callCompiler(cmdTemplate, filename, options: string, elif suc =~ pegSuccess: result.err = reSuccess + if result.err == reNimcCrash and + ("Your platform is not supported" in result.msg or + "cannot open 'sdl'" in result.msg or + "cannot open 'opengl'" in result.msg): + result.err = reIgnored + proc callCCompiler(cmdTemplate, filename, options: string, target: TTarget): TSpec = let c = parseCmdLine(cmdTemplate % ["target", targetToCmd[target], From c3415a27d77f302be4f41d5f9bbcdf7c0dd3e80a Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Thu, 8 Oct 2015 11:00:02 -0700 Subject: [PATCH 37/40] copy server.dll too? --- tests/testament/categories.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/testament/categories.nim b/tests/testament/categories.nim index 57b28620e4..d9fafaf7fc 100644 --- a/tests/testament/categories.nim +++ b/tests/testament/categories.nim @@ -82,6 +82,8 @@ proc runBasicDLLTest(c, r: var TResults, cat: Category, options: string) = when defined(Windows): # windows looks in the dir of the exe (yay!): + var serverDll = DynlibFormat % "server" + safeCopyFile("lib" / serverDll, "tests/dll" / serverDll) var nimrtlDll = DynlibFormat % "nimrtl" safeCopyFile("lib" / nimrtlDll, "tests/dll" / nimrtlDll) else: From f3a2efa6aedbf9b77aaf0b8aa9c56b62648d92e5 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Tue, 13 Oct 2015 15:48:01 -0700 Subject: [PATCH 38/40] really be pedantic --- .travis.yml | 2 +- appveyor.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c027386f56..605e838e53 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,4 +26,4 @@ script: - nimble install zip - nimble install opengl - nimble install sdl1 - - ./koch test all --pedantic + - ./koch test --pedantic all diff --git a/appveyor.yml b/appveyor.yml index 8ce8f59c1d..98a35d73f5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -32,4 +32,4 @@ before_test: - nimble install zip test_script: - - koch test all --pedantic + - koch test --pedantic all From 4c5f8cfd0c553b8169b6b18c0200d7b1c6b521ba Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Tue, 13 Oct 2015 16:14:29 -0700 Subject: [PATCH 39/40] use tester directly --- .travis.yml | 3 ++- appveyor.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 605e838e53..256fb0da0f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,4 +26,5 @@ script: - nimble install zip - nimble install opengl - nimble install sdl1 - - ./koch test --pedantic all + - nim c --taintMode:on tests/testament/tester + - tests/testament/tester --pedantic all diff --git a/appveyor.yml b/appveyor.yml index 98a35d73f5..11f6c5854b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -32,4 +32,5 @@ before_test: - nimble install zip test_script: - - koch test --pedantic all + - nim c --taintMode:on tests/testament/tester + - tests/testament/tester --pedantic all From f7c979f865143cb7003bc34193cec1a97eff3b1b Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Tue, 13 Oct 2015 16:21:30 -0700 Subject: [PATCH 40/40] try with windows slashes --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 11f6c5854b..2b1eab5d0d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -33,4 +33,4 @@ before_test: test_script: - nim c --taintMode:on tests/testament/tester - - tests/testament/tester --pedantic all + - tests\testament\tester --pedantic all