Skip to content

Commit

Permalink
DO NOT MERGE test [unix] via testscript
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdan committed Jul 27, 2022
1 parent 17fa7fe commit c46dc82
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 81 deletions.
32 changes: 19 additions & 13 deletions testscript/testdata/cond.txt
@@ -1,17 +1,23 @@
[!exec:sh] skip 'sh not found in $PATH'

# test that exactly one of gc and gccgo is set
[gc] exec sh -c 'echo gc >> go-compiler'
[gccgo] exec sh -c 'echo gccgo >> go-compiler'
grep '\A(gc|gccgo)\n\z' go-compiler
[gc] mkdir gc_true
[gccgo] mkdir gccgo_true

[gc] ! exists gccgo_true
[!gc] exists gccgo_true
[gccgo] ! exists gc_true
[!gccgo] exists gc_true

# test that go version build tags are set
[go1.1] exec sh -c 'echo go1.1 >> go-version'
[go2.1] exec sh -c 'echo go2.1 >> go-version'
grep '\Ago1\.1\n\z' go-version
[go1.1] mkdir go1.x
[go2.1] mkdir go2.x

exists go1.x
! exists go2.x

# unix should be true on Linux and MacOS, but not on Windows.
# Both platforms are tested on CI.
[unix] mkdir unix_true

# test that either 'unix' or '!unix' is true
[unix] exec sh -c 'echo unix >> unixness'
[!unix] exec sh -c 'echo not unix >> unixness'
[unix] grep '\Aunix\n\z' unixness
[!unix] grep '\Anot unix\n\z' unixness
[linux] exists unix_true
[darwin] exists unix_true
[windows] ! exists unix_true
34 changes: 0 additions & 34 deletions testscript/testscript_nonunix_test.go

This file was deleted.

34 changes: 0 additions & 34 deletions testscript/testscript_unix_test.go

This file was deleted.

0 comments on commit c46dc82

Please sign in to comment.