Upgrade to Pro — share decks privately, control downloads, hide ads and more …

【Go言語】テスト

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.

 【Go言語】テスト

Goのテストについて解説しています。

Avatar for Tomoki Ota

Tomoki Ota

October 10, 2024
Tweet

More Decks by Tomoki Ota

Other Decks in Programming

Transcript

  1. 14

  2. ϏϧυΦϓγϣϯ 23 • windows, linux, darwin • unix • ignore(ͦͷଞಠࣗͷΧελϜλάͰ΋Մೳ)

    : build࣌ʹແࢹ͍ͨ͠ͱ͖ • cgo : CGO_ENABLED͕1ͷͱ͖ʹbuildର৅ͱͳΔ • linux • unix • darwin • go1.22 (ϚΠφʔόʔδϣϯ͸ࢦఆͰ͖ͳ͍) • gc, gccgo • android, ios • arm,arm.5, arm.6, arm.7 • amd64, amd64.v1, amd64.v2, amd64.v3 • mips64x, ppc64x, wasm
  3. ϏϧυλάʹΑΔςετͷ෼ྨͷ஫ҙ 31 1. //go:build !integration Λ͚ͭͳ͍ͱɺgo test -tags=integration Ͱ λά͕͍͍ͭͯͳ͍΋ͷ΋࣮ߦ͞ΕΔɻ

    2. ϏϧυλάͰςετΛεΩοϓͨ͠ࡍɺͲͷςετ͕εΩοϓ͞Ε͔ͨ͸ ग़ྗ͞Εͳ͍ → ؀ڥม਺Λ࢖༻͢Δͱग़ྗͰ͖Δ