12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697(**************************************************************************)(* The OUnit library *)(* *)(* Copyright (C) 2002-2008 Maas-Maarten Zeeman. *)(* Copyright (C) 2010 OCamlCore SARL *)(* Copyright (C) 2013 Sylvain Le Gall *)(* *)(* The package OUnit is copyright by Maas-Maarten Zeeman, OCamlCore SARL *)(* and Sylvain Le Gall. *)(* *)(* Permission is hereby granted, free of charge, to any person obtaining *)(* a copy of this document and the OUnit software ("the Software"), to *)(* deal in the Software without restriction, including without limitation *)(* the rights to use, copy, modify, merge, publish, distribute, *)(* sublicense, and/or sell copies of the Software, and to permit persons *)(* to whom the Software is furnished to do so, subject to the following *)(* conditions: *)(* *)(* The above copyright notice and this permission notice shall be *)(* included in all copies or substantial portions of the Software. *)(* *)(* The Software is provided ``as is'', without warranty of any kind, *)(* express or implied, including but not limited to the warranties of *)(* merchantability, fitness for a particular purpose and noninfringement. *)(* In no event shall Maas-Maarten Zeeman be liable for any claim, damages *)(* or other liability, whether in an action of contract, tort or *)(* otherwise, arising from, out of or in connection with the Software or *)(* the use or other dealings in the software. *)(* *)(* See LICENSE.txt for details. *)(**************************************************************************)openOUnitTestlet(>:)=OUnitTest.(>:)let(>::)=OUnitTest.(>::)let(>:::)=OUnitTest.(>:::)typetest_ctxt=OUnitTest.ctxttypetest_fun=OUnitTest.test_funtypetest_length=OUnitTest.test_lengthtypetest=OUnitTest.testlettest_case?(length=Short)f=TestCase(length,f)lettest_listlst=TestListlsttypelog_severity=OUnitLogger.log_severityletassert_failure=OUnitAssert.assert_failureletassert_bool=OUnitAssert.assert_boolletassert_string=OUnitAssert.assert_string(* Upgrade to OUnit v2, using logger. *)(* let assert_command = OUnitAssert.assert_command *)letassert_command?exit_code?sinput?foutput?use_stderr?backtrace?chdir?env~ctxtprgargs=OUnitAssert.assert_command?exit_code?sinput?foutput?use_stderr?backtrace?chdir?env~ctxtprgargsletassert_equal=OUnitAssert.assert_equalletassert_raises=OUnitAssert.assert_raisesletskip_if=OUnitAssert.skip_iflettodo=OUnitAssert.todoletcmp_float=OUnitUtils.cmp_floatletbracket=OUnitBracket.createletbracket_tmpfile=OUnitBracket.bracket_tmpfileletbracket_tmpdir=OUnitBracket.bracket_tmpdirletwith_bracket_chdirtest_ctxtdnf=OUnitBracket.with_brackettest_ctxt(OUnitBracket.bracket_chdirdn)(fun_->f)letnon_fatal=OUnitTest.non_fatalletrun_test_tt_main=OUnitCore.run_test_tt_mainletlogfctxtlog_severityfmt=OUnitLogger.Test.logfctxt.test_loggerlog_severityfmtletin_testdata_dirctxtpath=OUnitTestData.in_testdata_dirctxt.confpathletconf_wrapfnamedefaulthelp=letget=fnamedefaulthelpinfunctxt->getctxt.confmoduleConf=structtype'aconf_t=string->'a->Arg.doc->test_ctxt->'aletmake_string=conf_wrapOUnitConf.make_stringletmake_string_opt=conf_wrapOUnitConf.make_string_optletmake_int=conf_wrapOUnitConf.make_intletmake_float=conf_wrapOUnitConf.make_floatletmake_bool=conf_wrapOUnitConf.make_boolletmake_execname=letget=OUnitConf.make_execnameinfunctxt->getctxt.confend