trunner_special.nim 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. discard """
  2. targets: "c cpp"
  3. joinable: false
  4. disabled: osx
  5. """
  6. #[
  7. Runs tests that require special treatment, e.g. because they rely on 3rd party code
  8. or require external networking.
  9. xxx test all tests/untestable/* here, possibly with adjustments to make running times reasonable
  10. ]#
  11. import std/[strformat,os,unittest,compilesettings]
  12. import stdtest/specialpaths
  13. from stdtest/testutils import disableSSLTesting
  14. const
  15. nim = getCurrentCompilerExe()
  16. mode = querySetting(backend)
  17. proc runCmd(cmd: string) =
  18. let ret = execShellCmd(cmd)
  19. check ret == 0 # allows more than 1 failure
  20. proc main =
  21. let options = fmt"-b:{mode} --hints:off"
  22. block: # SSL nimDisableCertificateValidation integration tests
  23. runCmd fmt"{nim} r {options} -d:nimDisableCertificateValidation -d:ssl {testsDir}/untestable/thttpclient_ssl_disabled.nim"
  24. block: # SSL certificate check integration tests
  25. runCmd fmt"{nim} r {options} -d:ssl --threads:on --mm:refc {testsDir}/untestable/thttpclient_ssl_remotenetwork.nim"
  26. when not disableSSLTesting():
  27. main()