summaryrefslogtreecommitdiff
path: root/spew/dumpnocgo_test.go
diff options
context:
space:
mode:
authorDave Collins <[email protected]>2013-09-21 21:50:00 -0500
committerDave Collins <[email protected]>2013-09-21 21:50:00 -0500
commit56a83c905e47b41640b0a8281d80acd377d958fa (patch)
tree8de4c943cb1e7c370a90fddecae8044861b5abef /spew/dumpnocgo_test.go
parenta83f71796b50ca8b7a1839954fd122d52749dcfa (diff)
Add tests for recent cgo handling updates.
This commit adds tests for the recent cgo handling of char, unsigned char, and uint8_t arrays. In addition, it adds an architecture for the cgo specific testing based on build constraints. This was done because spew itself does not require cgo, but in order to test its handling of the cgo types it needs to be fed cgo data. Rather than force all users to have a system which supports cgo and an external compiler just to run the tests, the cgo test support must explicitly be turned on via a build tag.
Diffstat (limited to 'spew/dumpnocgo_test.go')
-rw-r--r--spew/dumpnocgo_test.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/spew/dumpnocgo_test.go b/spew/dumpnocgo_test.go
new file mode 100644
index 0000000..52a0971
--- /dev/null
+++ b/spew/dumpnocgo_test.go
@@ -0,0 +1,26 @@
+// Copyright (c) 2013 Dave Collins <[email protected]>
+//
+// Permission to use, copy, modify, and distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+// NOTE: Due to the following build constraints, this file will only be compiled
+// when either cgo is not supported or "-tags testcgo" is not added to the go
+// test command line. This file intentionally does not setup any cgo tests in
+// this scenario.
+// +build !cgo !testcgo
+
+package spew_test
+
+func addCgoDumpTests() {
+ // Don't add any tests for cgo since this file is only compiled when
+ // there should not be any cgo tests.
+}