<commit_before>// RUN: %target-run-stdlib-swift
// REQUIRES: executable_test

// REQUIRES: OS=linux-gnu

import Swift
import StdlibUnittest


import Glibc

var GlibcTestSuite = TestSuite("Glibc")

GlibcTestSuite.test("errno") {
  errno = 0
  expectEqual(0, errno)
  close(-1)
  expectEqual(EBADF, errno)
}

var GlibcIoctlConstants = TestSuite("GlibcIoctlConstants")

GlibcIoctlConstants.test("tty ioctl constants availability") {
  let aConstant = TIOCGWINSZ
}

runAllTests()<commit_msg>Glibc validation test now performed also on FreeBSD<commit_after>// RUN: %target-run-stdlib-swift
// REQUIRES: executable_test

import Swift
import StdlibUnittest

#if os(Linux) || os(FreeBSD)
import Glibc
#endif

var GlibcTestSuite = TestSuite("Glibc")

GlibcTestSuite.test("errno")
  .skip(.custom({
    !( linuxAny(reason: "").evaluate() || freeBSDAny(reason: "").evaluate() ) 
  }, reason: "Only Linux and FreeBSD are supported")).code {
    errno = 0
    expectEqual(0, errno)
    close(-1)
    expectEqual(EBADF, errno)
}


var GlibcIoctlConstants = TestSuite("GlibcIoctlConstants")

GlibcIoctlConstants.test("tty ioctl constants availability") 
  .skip(.custom({
    !( linuxAny(reason: "").evaluate() || freeBSDAny(reason: "").evaluate() ) 
  }, reason: "Only Linux and FreeBSD are supported")).code {
    let aConstant = TIOCGWINSZ
}


runAllTests()
{'fraction_non_alphanumeric': 0.13457249070631971, 'fraction_numerical': 0.0044609665427509295, 'mean_word_length': 4.852173913043479, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6065845', 'n_tokens_mistral': 505, 'n_tokens_neox': 454, 'n_words': 102}