Fixes of the core tests for testing on Windows

* Initialize the environment variables with paths to
  MSVC toolchain before running the racket-test-core,
  since the foreign library tests need a C compiler.

* Fix a bug in foreign-test.rktl that deletes the existing
  content of environment variables (PATH, INCLUDE, LIB, etc)

* Let a test in date.rktl fail more gracefully.
This commit is contained in:
shhyou 2020-12-21 15:18:07 -06:00
parent 0041354e1f
commit 50f373f4d6
3 changed files with 10 additions and 4 deletions

View File

@ -47,7 +47,9 @@ jobs:
call racket\raco.exe pkg install --auto --no-docs racket-test unstable-flonum-lib net-test call racket\raco.exe pkg install --auto --no-docs racket-test unstable-flonum-lib net-test
- name: Run tests/racket/test - name: Run tests/racket/test
shell: cmd shell: cmd
run: racket\raco.exe test -l tests/racket/test run: |
call .\racket\src\worksp\msvcprep.bat x86_amd64
racket\raco.exe test -l tests/racket/test
- name: Run tests/racket/contract/all - name: Run tests/racket/contract/all
shell: cmd shell: cmd
run: racket\racket.exe -l tests/racket/contract/all run: racket\racket.exe -l tests/racket/contract/all

View File

@ -26,7 +26,9 @@
(test 0 find-seconds 0 0 0 1 1 1970 #f) (test 0 find-seconds 0 0 0 1 1 1970 #f)
(test 32416215 find-seconds 15 30 4 11 1 1971 #f) (test 32416215 find-seconds 15 30 4 11 1 1971 #f)
(test 1969 date-year (seconds->date (- (* 24 60 60)))) (define (date-year.seconds->date sec)
(date-year (seconds->date sec)))
(test 1969 date-year.seconds->date (- (* 24 60 60)))
(let* ([s (current-seconds)] (let* ([s (current-seconds)]
[d1 (seconds->date s)] [d1 (seconds->date s)]

View File

@ -73,17 +73,19 @@
(and progfiles (concat progfiles "/Microsoft Visual Studio 10.0"))) (and progfiles (concat progfiles "/Microsoft Visual Studio 10.0")))
(when (and studio (directory-exists? studio)) (when (and studio (directory-exists? studio))
(define (paths-env var . ps) (define (paths-env var . ps)
(define orig-val (getenv var))
(define val (define val
(apply concat (for/list ([p (in-list ps)] (apply concat (for/list ([p (in-list ps)]
#:when (and p (directory-exists? p))) #:when (and p (directory-exists? p)))
(concat p ";")))) (concat p ";"))))
(printf ">>> $~a = ~s\n" var val) (printf ">>> $~a = ~s\n" var val)
(putenv var val)) (putenv var (if orig-val
(concat orig-val ";" val)
val)))
(define (vc p) (concat studio "/VC/" p)) (define (vc p) (concat studio "/VC/" p))
(define (common p) (concat studio "/Common7/" p)) (define (common p) (concat studio "/Common7/" p))
(define (winsdk p) (concat progfiles "/Microsoft SDKs/Windows/v7.0A/" p)) (define (winsdk p) (concat progfiles "/Microsoft SDKs/Windows/v7.0A/" p))
(paths-env "PATH" (paths-env "PATH"
(getenv "PATH")
(vc (if 64bit? "BIN/amd64" "BIN")) (vc (if 64bit? "BIN/amd64" "BIN"))
(vc "IDE") (vc "Tools") (vc "Tools/bin") (vc "IDE") (vc "Tools") (vc "Tools/bin")
(common "Tools") (common "IDE")) (common "Tools") (common "IDE"))