How to use run class

Best Atoum code snippet using run

dune.inc

Source:dune.inc Github

copy

Full Screen

...3 (deps (package dune) (source_tree test-cases/action-modifying-a-dependency))4 (action5 (chdir6 test-cases/action-modifying-a-dependency7 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))8(alias9 (name aliases)10 (deps (package dune) (source_tree test-cases/aliases))11 (action12 (chdir13 test-cases/aliases14 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))15(alias16 (name bad-alias-error)17 (deps (package dune) (source_tree test-cases/bad-alias-error))18 (action19 (chdir20 test-cases/bad-alias-error21 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))22(alias23 (name block-strings)24 (deps (package dune) (source_tree test-cases/block-strings))25 (action26 (chdir27 test-cases/block-strings28 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))29(alias30 (name byte-code-only)31 (deps (package dune) (source_tree test-cases/byte-code-only))32 (action33 (chdir34 test-cases/byte-code-only35 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))36(alias37 (name c-stubs)38 (deps (package dune) (source_tree test-cases/c-stubs))39 (action40 (chdir41 test-cases/c-stubs42 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))43(alias44 (name configurator)45 (deps (package dune) (source_tree test-cases/configurator))46 (action47 (chdir48 test-cases/configurator49 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected))))50 (enabled_if (<> %{ocaml-config:system} win)))51(alias52 (name copy_files)53 (deps (package dune) (source_tree test-cases/copy_files))54 (action55 (chdir56 test-cases/copy_files57 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))58(alias59 (name cross-compilation)60 (deps (package dune) (source_tree test-cases/cross-compilation))61 (action62 (chdir63 test-cases/cross-compilation64 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))65(alias66 (name custom-build-dir)67 (deps (package dune) (source_tree test-cases/custom-build-dir))68 (action69 (chdir70 test-cases/custom-build-dir71 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))72(alias73 (name dep-vars)74 (deps (package dune) (source_tree test-cases/dep-vars))75 (action76 (chdir77 test-cases/dep-vars78 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))79(alias80 (name depend-on-the-universe)81 (deps (package dune) (source_tree test-cases/depend-on-the-universe))82 (action83 (chdir84 test-cases/depend-on-the-universe85 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))86(alias87 (name dev-flag-1103)88 (deps (package dune) (source_tree test-cases/dev-flag-1103))89 (action90 (chdir91 test-cases/dev-flag-110392 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))93(alias94 (name dune-build-dir-exec-1101)95 (deps (package dune) (source_tree test-cases/dune-build-dir-exec-1101))96 (action97 (chdir98 test-cases/dune-build-dir-exec-110199 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))100(alias101 (name dune-jbuild-var-case)102 (deps (package dune) (source_tree test-cases/dune-jbuild-var-case))103 (action104 (chdir105 test-cases/dune-jbuild-var-case106 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))107(alias108 (name dune-ppx-driver-system)109 (deps (package dune) (source_tree test-cases/dune-ppx-driver-system))110 (action111 (chdir112 test-cases/dune-ppx-driver-system113 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))114(alias115 (name dune-project-edition)116 (deps (package dune) (source_tree test-cases/dune-project-edition))117 (action118 (chdir119 test-cases/dune-project-edition120 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))121(alias122 (name dup-fields)123 (deps (package dune) (source_tree test-cases/dup-fields))124 (action125 (chdir126 test-cases/dup-fields127 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))128(alias129 (name env)130 (deps (package dune) (source_tree test-cases/env))131 (action132 (chdir133 test-cases/env134 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))135(alias136 (name envs-and-contexts)137 (deps (package dune) (source_tree test-cases/envs-and-contexts))138 (action139 (chdir140 test-cases/envs-and-contexts141 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))142(alias143 (name exclude-missing-module)144 (deps (package dune) (source_tree test-cases/exclude-missing-module))145 (action146 (chdir147 test-cases/exclude-missing-module148 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))149(alias150 (name exec-cmd)151 (deps (package dune) (source_tree test-cases/exec-cmd))152 (action153 (chdir154 test-cases/exec-cmd155 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))156(alias157 (name exec-missing)158 (deps (package dune) (source_tree test-cases/exec-missing))159 (action160 (chdir161 test-cases/exec-missing162 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))163(alias164 (name fallback-dune)165 (deps (package dune) (source_tree test-cases/fallback-dune))166 (action167 (chdir168 test-cases/fallback-dune169 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))170(alias171 (name findlib)172 (deps (package dune) (source_tree test-cases/findlib))173 (action174 (chdir175 test-cases/findlib176 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))177(alias178 (name findlib-error)179 (deps (package dune) (source_tree test-cases/findlib-error))180 (action181 (chdir182 test-cases/findlib-error183 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))184(alias185 (name force-test)186 (deps (package dune) (source_tree test-cases/force-test))187 (action188 (chdir189 test-cases/force-test190 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))191(alias192 (name gen-opam-install-file)193 (deps (package dune) (source_tree test-cases/gen-opam-install-file))194 (action195 (chdir196 test-cases/gen-opam-install-file197 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))198(alias199 (name github1019)200 (deps (package dune) (source_tree test-cases/github1019))201 (action202 (chdir203 test-cases/github1019204 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))205(alias206 (name github20)207 (deps (package dune) (source_tree test-cases/github20))208 (action209 (chdir210 test-cases/github20211 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))212(alias213 (name github24)214 (deps (package dune) (source_tree test-cases/github24))215 (action216 (chdir217 test-cases/github24218 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))219(alias220 (name github25)221 (deps (package dune) (source_tree test-cases/github25))222 (action223 (setenv224 OCAMLPATH225 ./findlib-packages226 (chdir227 test-cases/github25228 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected))))))229(alias230 (name github534)231 (deps (package dune) (source_tree test-cases/github534))232 (action233 (chdir234 test-cases/github534235 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))236(alias237 (name github568)238 (deps (package dune) (source_tree test-cases/github568))239 (action240 (chdir241 test-cases/github568242 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))243(alias244 (name github597)245 (deps (package dune) (source_tree test-cases/github597))246 (action247 (chdir248 test-cases/github597249 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))250(alias251 (name github644)252 (deps (package dune) (source_tree test-cases/github644))253 (action254 (chdir255 test-cases/github644256 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))257(alias258 (name github660)259 (deps (package dune) (source_tree test-cases/github660))260 (action261 (chdir262 test-cases/github660263 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))264(alias265 (name github717-odoc-index)266 (deps (package dune) (source_tree test-cases/github717-odoc-index))267 (action268 (chdir269 test-cases/github717-odoc-index270 (progn271 (run %{exe:cram.exe} -skip-versions 4.02.3 -test run.t)272 (diff? run.t run.t.corrected)))))273(alias274 (name github734)275 (deps (package dune) (source_tree test-cases/github734))276 (action277 (chdir278 test-cases/github734279 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))280(alias281 (name github759)282 (deps (package dune) (source_tree test-cases/github759))283 (action284 (chdir285 test-cases/github759286 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))287(alias288 (name github761)289 (deps (package dune) (source_tree test-cases/github761))290 (action291 (chdir292 test-cases/github761293 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))294(alias295 (name github764)296 (deps (package dune) (source_tree test-cases/github764))297 (action298 (chdir299 test-cases/github764300 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected))))301 (enabled_if (<> %{ocaml-config:system} win)))302(alias303 (name github784)304 (deps (package dune) (source_tree test-cases/github784))305 (action306 (chdir307 test-cases/github784308 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))309(alias310 (name github992)311 (deps (package dune) (source_tree test-cases/github992))312 (action313 (chdir314 test-cases/github992315 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))316(alias317 (name ignored_subdirs)318 (deps (package dune) (source_tree test-cases/ignored_subdirs))319 (action320 (chdir321 test-cases/ignored_subdirs322 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))323(alias324 (name include-loop)325 (deps (package dune) (source_tree test-cases/include-loop))326 (action327 (chdir328 test-cases/include-loop329 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))330(alias331 (name inline_tests)332 (deps (package dune) (source_tree test-cases/inline_tests))333 (action334 (chdir335 test-cases/inline_tests336 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))337(alias338 (name installable-dup-private-libs)339 (deps (package dune) (source_tree test-cases/installable-dup-private-libs))340 (action341 (chdir342 test-cases/installable-dup-private-libs343 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))344(alias345 (name intf-only)346 (deps (package dune) (source_tree test-cases/intf-only))347 (action348 (chdir349 test-cases/intf-only350 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))351(alias352 (name js_of_ocaml)353 (deps (package dune) (source_tree test-cases/js_of_ocaml))354 (action355 (setenv356 NODE357 %{bin:node}358 (chdir359 test-cases/js_of_ocaml360 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected))))))361(alias362 (name lib-available)363 (deps (package dune) (source_tree test-cases/lib-available))364 (action365 (chdir366 test-cases/lib-available367 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))368(alias369 (name link-deps)370 (deps (package dune) (source_tree test-cases/link-deps))371 (action372 (chdir373 test-cases/link-deps374 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))375(alias376 (name loop)377 (deps (package dune) (source_tree test-cases/loop))378 (action379 (chdir380 test-cases/loop381 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))382(alias383 (name macro-expand-error)384 (deps (package dune) (source_tree test-cases/macro-expand-error))385 (action386 (chdir387 test-cases/macro-expand-error388 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))389(alias390 (name menhir)391 (deps (package dune) (source_tree test-cases/menhir))392 (action393 (chdir394 test-cases/menhir395 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))396(alias397 (name merlin-tests)398 (deps (package dune) (source_tree test-cases/merlin-tests))399 (action400 (chdir401 test-cases/merlin-tests402 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))403(alias404 (name meta-gen)405 (deps (package dune) (source_tree test-cases/meta-gen))406 (action407 (chdir408 test-cases/meta-gen409 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))410(alias411 (name misc)412 (deps (package dune) (source_tree test-cases/misc))413 (action414 (chdir415 test-cases/misc416 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))417(alias418 (name missing-loc-run)419 (deps (package dune) (source_tree test-cases/missing-loc-run))420 (action421 (chdir422 test-cases/missing-loc-run423 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))424(alias425 (name multi-dir)426 (deps (package dune) (source_tree test-cases/multi-dir))427 (action428 (chdir429 test-cases/multi-dir430 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))431(alias432 (name multiple-private-libs)433 (deps (package dune) (source_tree test-cases/multiple-private-libs))434 (action435 (chdir436 test-cases/multiple-private-libs437 (progn438 (run %{exe:cram.exe} -skip-versions 4.02.3 -test run.t)439 (diff? run.t run.t.corrected)))))440(alias441 (name name-field-validation)442 (deps (package dune) (source_tree test-cases/name-field-validation))443 (action444 (chdir445 test-cases/name-field-validation446 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))447(alias448 (name no-installable-mode)449 (deps (package dune) (source_tree test-cases/no-installable-mode))450 (action451 (chdir452 test-cases/no-installable-mode453 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))454(alias455 (name no-name-field)456 (deps (package dune) (source_tree test-cases/no-name-field))457 (action458 (chdir459 test-cases/no-name-field460 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))461(alias462 (name null-dep)463 (deps (package dune) (source_tree test-cases/null-dep))464 (action465 (chdir466 test-cases/null-dep467 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))468(alias469 (name ocaml-config-macro)470 (deps (package dune) (source_tree test-cases/ocaml-config-macro))471 (action472 (chdir473 test-cases/ocaml-config-macro474 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))475(alias476 (name ocaml-syntax)477 (deps (package dune) (source_tree test-cases/ocaml-syntax))478 (action479 (chdir480 test-cases/ocaml-syntax481 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))482(alias483 (name ocamldep-multi-stanzas)484 (deps (package dune) (source_tree test-cases/ocamldep-multi-stanzas))485 (action486 (chdir487 test-cases/ocamldep-multi-stanzas488 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))489(alias490 (name odoc)491 (deps (package dune) (source_tree test-cases/odoc))492 (action493 (chdir494 test-cases/odoc495 (progn496 (run %{exe:cram.exe} -skip-versions 4.02.3 -test run.t)497 (diff? run.t run.t.corrected)))))498(alias499 (name odoc-unique-mlds)500 (deps (package dune) (source_tree test-cases/odoc-unique-mlds))501 (action502 (chdir503 test-cases/odoc-unique-mlds504 (progn505 (run %{exe:cram.exe} -skip-versions 4.02.3 -test run.t)506 (diff? run.t run.t.corrected)))))507(alias508 (name output-obj)509 (deps (package dune) (source_tree test-cases/output-obj))510 (action511 (chdir512 test-cases/output-obj513 (progn514 (run %{exe:cram.exe} -skip-versions <4.06.0 -test run.t)515 (diff? run.t run.t.corrected))))516 (enabled_if517 (and (<> %{ocaml-config:system} macosx) (<> %{ocaml-config:system} win))))518(alias519 (name package-dep)520 (deps (package dune) (source_tree test-cases/package-dep))521 (action522 (chdir523 test-cases/package-dep524 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))525(alias526 (name path-variables)527 (deps (package dune) (source_tree test-cases/path-variables))528 (action529 (chdir530 test-cases/path-variables531 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))532(alias533 (name ppx-rewriter)534 (deps (package dune) (source_tree test-cases/ppx-rewriter))535 (action536 (chdir537 test-cases/ppx-rewriter538 (progn539 (run %{exe:cram.exe} -skip-versions 4.02.3 -test run.t)540 (diff? run.t run.t.corrected)))))541(alias542 (name preprocess-with-action)543 (deps (package dune) (source_tree test-cases/preprocess-with-action))544 (action545 (chdir546 test-cases/preprocess-with-action547 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))548(alias549 (name private-public-overlap)550 (deps (package dune) (source_tree test-cases/private-public-overlap))551 (action552 (chdir553 test-cases/private-public-overlap554 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))555(alias556 (name project-root)557 (deps (package dune) (source_tree test-cases/project-root))558 (action559 (chdir560 test-cases/project-root561 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))562(alias563 (name promote)564 (deps (package dune) (source_tree test-cases/promote))565 (action566 (chdir567 test-cases/promote568 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))569(alias570 (name quoting)571 (deps (package dune) (source_tree test-cases/quoting))572 (action573 (chdir574 test-cases/quoting575 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))576(alias577 (name reason)578 (deps (package dune) (source_tree test-cases/reason))579 (action580 (chdir581 test-cases/reason582 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))583(alias584 (name redirections)585 (deps (package dune) (source_tree test-cases/redirections))586 (action587 (chdir588 test-cases/redirections589 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))590(alias591 (name reporting-of-cycles)592 (deps (package dune) (source_tree test-cases/reporting-of-cycles))593 (action594 (chdir595 test-cases/reporting-of-cycles596 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))597(alias598 (name scope-bug)599 (deps (package dune) (source_tree test-cases/scope-bug))600 (action601 (chdir602 test-cases/scope-bug603 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))604(alias605 (name scope-ppx-bug)606 (deps (package dune) (source_tree test-cases/scope-ppx-bug))607 (action608 (chdir609 test-cases/scope-ppx-bug610 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))611(alias612 (name select)613 (deps (package dune) (source_tree test-cases/select))614 (action615 (chdir616 test-cases/select617 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))618(alias619 (name shadow-bindings)620 (deps (package dune) (source_tree test-cases/shadow-bindings))621 (action622 (chdir623 test-cases/shadow-bindings624 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))625(alias626 (name subst)627 (deps (package dune) (source_tree test-cases/subst))628 (action629 (chdir630 test-cases/subst631 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))632(alias633 (name syntax-versioning)634 (deps (package dune) (source_tree test-cases/syntax-versioning))635 (action636 (chdir637 test-cases/syntax-versioning638 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))639(alias640 (name tests-stanza)641 (deps (package dune) (source_tree test-cases/tests-stanza))642 (action643 (chdir644 test-cases/tests-stanza645 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))646(alias647 (name too-many-parens)648 (deps (package dune) (source_tree test-cases/too-many-parens))649 (action650 (chdir651 test-cases/too-many-parens652 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))653(alias654 (name use-meta)655 (deps (package dune) (source_tree test-cases/use-meta))656 (action657 (chdir658 test-cases/use-meta659 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))660(alias661 (name utop)662 (deps (package dune) (source_tree test-cases/utop))663 (action664 (chdir665 test-cases/utop666 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))667(alias668 (name windows-diff)669 (deps (package dune) (source_tree test-cases/windows-diff))670 (action671 (chdir672 test-cases/windows-diff673 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))674(alias675 (name workspaces)676 (deps (package dune) (source_tree test-cases/workspaces))677 (action678 (chdir679 test-cases/workspaces680 (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected)))))681(alias682 (name runtest)683 (deps684 (alias action-modifying-a-dependency)685 (alias aliases)686 (alias bad-alias-error)687 (alias block-strings)688 (alias byte-code-only)689 (alias c-stubs)690 (alias configurator)691 (alias copy_files)692 (alias cross-compilation)693 (alias custom-build-dir)694 (alias dep-vars)695 (alias depend-on-the-universe)696 (alias dev-flag-1103)697 (alias dune-build-dir-exec-1101)698 (alias dune-jbuild-var-case)699 (alias dune-ppx-driver-system)700 (alias dune-project-edition)701 (alias dup-fields)702 (alias env)703 (alias exclude-missing-module)704 (alias exec-cmd)705 (alias exec-missing)706 (alias fallback-dune)707 (alias findlib)708 (alias findlib-error)709 (alias force-test)710 (alias gen-opam-install-file)711 (alias github1019)712 (alias github20)713 (alias github24)714 (alias github25)715 (alias github534)716 (alias github568)717 (alias github597)718 (alias github644)719 (alias github660)720 (alias github717-odoc-index)721 (alias github734)722 (alias github759)723 (alias github761)724 (alias github764)725 (alias github784)726 (alias github992)727 (alias ignored_subdirs)728 (alias include-loop)729 (alias inline_tests)730 (alias installable-dup-private-libs)731 (alias intf-only)732 (alias lib-available)733 (alias link-deps)734 (alias loop)735 (alias macro-expand-error)736 (alias menhir)737 (alias merlin-tests)738 (alias meta-gen)739 (alias misc)740 (alias missing-loc-run)741 (alias multi-dir)742 (alias multiple-private-libs)743 (alias name-field-validation)744 (alias no-installable-mode)745 (alias no-name-field)746 (alias null-dep)747 (alias ocaml-config-macro)748 (alias ocaml-syntax)749 (alias ocamldep-multi-stanzas)750 (alias odoc)751 (alias odoc-unique-mlds)752 (alias output-obj)753 (alias package-dep)754 (alias path-variables)755 (alias ppx-rewriter)756 (alias preprocess-with-action)757 (alias private-public-overlap)758 (alias project-root)759 (alias promote)760 (alias quoting)761 (alias reason)762 (alias redirections)763 (alias reporting-of-cycles)764 (alias scope-bug)765 (alias scope-ppx-bug)766 (alias select)767 (alias shadow-bindings)768 (alias subst)769 (alias syntax-versioning)770 (alias tests-stanza)771 (alias too-many-parens)772 (alias use-meta)773 (alias utop)774 (alias windows-diff)775 (alias workspaces)))776(alias777 (name runtest-no-deps)778 (deps779 (alias action-modifying-a-dependency)780 (alias aliases)781 (alias bad-alias-error)782 (alias block-strings)783 (alias byte-code-only)784 (alias c-stubs)785 (alias configurator)786 (alias copy_files)787 (alias cross-compilation)788 (alias custom-build-dir)789 (alias dep-vars)790 (alias depend-on-the-universe)791 (alias dev-flag-1103)792 (alias dune-build-dir-exec-1101)793 (alias dune-jbuild-var-case)794 (alias dune-ppx-driver-system)795 (alias dune-project-edition)796 (alias dup-fields)797 (alias env)798 (alias exclude-missing-module)799 (alias exec-cmd)800 (alias exec-missing)801 (alias fallback-dune)802 (alias findlib)803 (alias findlib-error)804 (alias force-test)805 (alias github1019)806 (alias github20)807 (alias github24)808 (alias github25)809 (alias github534)810 (alias github568)811 (alias github597)812 (alias github660)813 (alias github734)814 (alias github759)815 (alias github761)816 (alias github764)817 (alias github784)818 (alias github992)819 (alias ignored_subdirs)820 (alias include-loop)821 (alias inline_tests)822 (alias installable-dup-private-libs)823 (alias intf-only)824 (alias lib-available)825 (alias link-deps)826 (alias loop)827 (alias macro-expand-error)828 (alias merlin-tests)829 (alias meta-gen)830 (alias misc)831 (alias missing-loc-run)832 (alias multi-dir)833 (alias name-field-validation)834 (alias no-installable-mode)835 (alias no-name-field)836 (alias null-dep)837 (alias ocaml-config-macro)838 (alias ocaml-syntax)839 (alias ocamldep-multi-stanzas)840 (alias output-obj)841 (alias package-dep)842 (alias path-variables)843 (alias preprocess-with-action)844 (alias project-root)845 (alias promote)846 (alias quoting)847 (alias redirections)848 (alias reporting-of-cycles)849 (alias scope-bug)850 (alias select)851 (alias shadow-bindings)852 (alias subst)853 (alias syntax-versioning)854 (alias tests-stanza)855 (alias too-many-parens)856 (alias use-meta)857 (alias windows-diff)858 (alias workspaces)))859(alias (name runtest-disabled) (deps (alias envs-and-contexts)))860(alias (name runtest-js) (deps (alias js_of_ocaml)))...

Full Screen

Full Screen

run_test.go

Source:run_test.go Github

copy

Full Screen

1// These tests verify the test running logic.2package check_test3import (4 "errors"5 . "github.com/magiconair/properties/_third_party/gopkg.in/check.v1"6 "os"7 "sync"8)9var runnerS = Suite(&RunS{})10type RunS struct{}11func (s *RunS) TestCountSuite(c *C) {12 suitesRun += 113}14// -----------------------------------------------------------------------15// Tests ensuring result counting works properly.16func (s *RunS) TestSuccess(c *C) {17 output := String{}18 result := Run(&SuccessHelper{}, &RunConf{Output: &output})19 c.Check(result.Succeeded, Equals, 1)20 c.Check(result.Failed, Equals, 0)21 c.Check(result.Skipped, Equals, 0)22 c.Check(result.Panicked, Equals, 0)23 c.Check(result.FixturePanicked, Equals, 0)24 c.Check(result.Missed, Equals, 0)25 c.Check(result.RunError, IsNil)26}27func (s *RunS) TestFailure(c *C) {28 output := String{}29 result := Run(&FailHelper{}, &RunConf{Output: &output})30 c.Check(result.Succeeded, Equals, 0)31 c.Check(result.Failed, Equals, 1)32 c.Check(result.Skipped, Equals, 0)33 c.Check(result.Panicked, Equals, 0)34 c.Check(result.FixturePanicked, Equals, 0)35 c.Check(result.Missed, Equals, 0)36 c.Check(result.RunError, IsNil)37}38func (s *RunS) TestFixture(c *C) {39 output := String{}40 result := Run(&FixtureHelper{}, &RunConf{Output: &output})41 c.Check(result.Succeeded, Equals, 2)42 c.Check(result.Failed, Equals, 0)43 c.Check(result.Skipped, Equals, 0)44 c.Check(result.Panicked, Equals, 0)45 c.Check(result.FixturePanicked, Equals, 0)46 c.Check(result.Missed, Equals, 0)47 c.Check(result.RunError, IsNil)48}49func (s *RunS) TestPanicOnTest(c *C) {50 output := String{}51 helper := &FixtureHelper{panicOn: "Test1"}52 result := Run(helper, &RunConf{Output: &output})53 c.Check(result.Succeeded, Equals, 1)54 c.Check(result.Failed, Equals, 0)55 c.Check(result.Skipped, Equals, 0)56 c.Check(result.Panicked, Equals, 1)57 c.Check(result.FixturePanicked, Equals, 0)58 c.Check(result.Missed, Equals, 0)59 c.Check(result.RunError, IsNil)60}61func (s *RunS) TestPanicOnSetUpTest(c *C) {62 output := String{}63 helper := &FixtureHelper{panicOn: "SetUpTest"}64 result := Run(helper, &RunConf{Output: &output})65 c.Check(result.Succeeded, Equals, 0)66 c.Check(result.Failed, Equals, 0)67 c.Check(result.Skipped, Equals, 0)68 c.Check(result.Panicked, Equals, 0)69 c.Check(result.FixturePanicked, Equals, 1)70 c.Check(result.Missed, Equals, 2)71 c.Check(result.RunError, IsNil)72}73func (s *RunS) TestPanicOnSetUpSuite(c *C) {74 output := String{}75 helper := &FixtureHelper{panicOn: "SetUpSuite"}76 result := Run(helper, &RunConf{Output: &output})77 c.Check(result.Succeeded, Equals, 0)78 c.Check(result.Failed, Equals, 0)79 c.Check(result.Skipped, Equals, 0)80 c.Check(result.Panicked, Equals, 0)81 c.Check(result.FixturePanicked, Equals, 1)82 c.Check(result.Missed, Equals, 2)83 c.Check(result.RunError, IsNil)84}85// -----------------------------------------------------------------------86// Check result aggregation.87func (s *RunS) TestAdd(c *C) {88 result := &Result{89 Succeeded: 1,90 Skipped: 2,91 Failed: 3,92 Panicked: 4,93 FixturePanicked: 5,94 Missed: 6,95 ExpectedFailures: 7,96 }97 result.Add(&Result{98 Succeeded: 10,99 Skipped: 20,100 Failed: 30,101 Panicked: 40,102 FixturePanicked: 50,103 Missed: 60,104 ExpectedFailures: 70,105 })106 c.Check(result.Succeeded, Equals, 11)107 c.Check(result.Skipped, Equals, 22)108 c.Check(result.Failed, Equals, 33)109 c.Check(result.Panicked, Equals, 44)110 c.Check(result.FixturePanicked, Equals, 55)111 c.Check(result.Missed, Equals, 66)112 c.Check(result.ExpectedFailures, Equals, 77)113 c.Check(result.RunError, IsNil)114}115// -----------------------------------------------------------------------116// Check the Passed() method.117func (s *RunS) TestPassed(c *C) {118 c.Assert((&Result{}).Passed(), Equals, true)119 c.Assert((&Result{Succeeded: 1}).Passed(), Equals, true)120 c.Assert((&Result{Skipped: 1}).Passed(), Equals, true)121 c.Assert((&Result{Failed: 1}).Passed(), Equals, false)122 c.Assert((&Result{Panicked: 1}).Passed(), Equals, false)123 c.Assert((&Result{FixturePanicked: 1}).Passed(), Equals, false)124 c.Assert((&Result{Missed: 1}).Passed(), Equals, false)125 c.Assert((&Result{RunError: errors.New("!")}).Passed(), Equals, false)126}127// -----------------------------------------------------------------------128// Check that result printing is working correctly.129func (s *RunS) TestPrintSuccess(c *C) {130 result := &Result{Succeeded: 5}131 c.Check(result.String(), Equals, "OK: 5 passed")132}133func (s *RunS) TestPrintFailure(c *C) {134 result := &Result{Failed: 5}135 c.Check(result.String(), Equals, "OOPS: 0 passed, 5 FAILED")136}137func (s *RunS) TestPrintSkipped(c *C) {138 result := &Result{Skipped: 5}139 c.Check(result.String(), Equals, "OK: 0 passed, 5 skipped")140}141func (s *RunS) TestPrintExpectedFailures(c *C) {142 result := &Result{ExpectedFailures: 5}143 c.Check(result.String(), Equals, "OK: 0 passed, 5 expected failures")144}145func (s *RunS) TestPrintPanicked(c *C) {146 result := &Result{Panicked: 5}147 c.Check(result.String(), Equals, "OOPS: 0 passed, 5 PANICKED")148}149func (s *RunS) TestPrintFixturePanicked(c *C) {150 result := &Result{FixturePanicked: 5}151 c.Check(result.String(), Equals, "OOPS: 0 passed, 5 FIXTURE-PANICKED")152}153func (s *RunS) TestPrintMissed(c *C) {154 result := &Result{Missed: 5}155 c.Check(result.String(), Equals, "OOPS: 0 passed, 5 MISSED")156}157func (s *RunS) TestPrintAll(c *C) {158 result := &Result{Succeeded: 1, Skipped: 2, ExpectedFailures: 3,159 Panicked: 4, FixturePanicked: 5, Missed: 6}160 c.Check(result.String(), Equals,161 "OOPS: 1 passed, 2 skipped, 3 expected failures, 4 PANICKED, "+162 "5 FIXTURE-PANICKED, 6 MISSED")163}164func (s *RunS) TestPrintRunError(c *C) {165 result := &Result{Succeeded: 1, Failed: 1,166 RunError: errors.New("Kaboom!")}167 c.Check(result.String(), Equals, "ERROR: Kaboom!")168}169// -----------------------------------------------------------------------170// Verify that the method pattern flag works correctly.171func (s *RunS) TestFilterTestName(c *C) {172 helper := FixtureHelper{}173 output := String{}174 runConf := RunConf{Output: &output, Filter: "Test[91]"}175 Run(&helper, &runConf)176 c.Check(helper.calls[0], Equals, "SetUpSuite")177 c.Check(helper.calls[1], Equals, "SetUpTest")178 c.Check(helper.calls[2], Equals, "Test1")179 c.Check(helper.calls[3], Equals, "TearDownTest")180 c.Check(helper.calls[4], Equals, "TearDownSuite")181 c.Check(len(helper.calls), Equals, 5)182}183func (s *RunS) TestFilterTestNameWithAll(c *C) {184 helper := FixtureHelper{}185 output := String{}186 runConf := RunConf{Output: &output, Filter: ".*"}187 Run(&helper, &runConf)188 c.Check(helper.calls[0], Equals, "SetUpSuite")189 c.Check(helper.calls[1], Equals, "SetUpTest")190 c.Check(helper.calls[2], Equals, "Test1")191 c.Check(helper.calls[3], Equals, "TearDownTest")192 c.Check(helper.calls[4], Equals, "SetUpTest")193 c.Check(helper.calls[5], Equals, "Test2")194 c.Check(helper.calls[6], Equals, "TearDownTest")195 c.Check(helper.calls[7], Equals, "TearDownSuite")196 c.Check(len(helper.calls), Equals, 8)197}198func (s *RunS) TestFilterSuiteName(c *C) {199 helper := FixtureHelper{}200 output := String{}201 runConf := RunConf{Output: &output, Filter: "FixtureHelper"}202 Run(&helper, &runConf)203 c.Check(helper.calls[0], Equals, "SetUpSuite")204 c.Check(helper.calls[1], Equals, "SetUpTest")205 c.Check(helper.calls[2], Equals, "Test1")206 c.Check(helper.calls[3], Equals, "TearDownTest")207 c.Check(helper.calls[4], Equals, "SetUpTest")208 c.Check(helper.calls[5], Equals, "Test2")209 c.Check(helper.calls[6], Equals, "TearDownTest")210 c.Check(helper.calls[7], Equals, "TearDownSuite")211 c.Check(len(helper.calls), Equals, 8)212}213func (s *RunS) TestFilterSuiteNameAndTestName(c *C) {214 helper := FixtureHelper{}215 output := String{}216 runConf := RunConf{Output: &output, Filter: "FixtureHelper\\.Test2"}217 Run(&helper, &runConf)218 c.Check(helper.calls[0], Equals, "SetUpSuite")219 c.Check(helper.calls[1], Equals, "SetUpTest")220 c.Check(helper.calls[2], Equals, "Test2")221 c.Check(helper.calls[3], Equals, "TearDownTest")222 c.Check(helper.calls[4], Equals, "TearDownSuite")223 c.Check(len(helper.calls), Equals, 5)224}225func (s *RunS) TestFilterAllOut(c *C) {226 helper := FixtureHelper{}227 output := String{}228 runConf := RunConf{Output: &output, Filter: "NotFound"}229 Run(&helper, &runConf)230 c.Check(len(helper.calls), Equals, 0)231}232func (s *RunS) TestRequirePartialMatch(c *C) {233 helper := FixtureHelper{}234 output := String{}235 runConf := RunConf{Output: &output, Filter: "est"}236 Run(&helper, &runConf)237 c.Check(len(helper.calls), Equals, 8)238}239func (s *RunS) TestFilterError(c *C) {240 helper := FixtureHelper{}241 output := String{}242 runConf := RunConf{Output: &output, Filter: "]["}243 result := Run(&helper, &runConf)244 c.Check(result.String(), Equals,245 "ERROR: Bad filter expression: error parsing regexp: missing closing ]: `[`")246 c.Check(len(helper.calls), Equals, 0)247}248// -----------------------------------------------------------------------249// Verify that List works correctly.250func (s *RunS) TestListFiltered(c *C) {251 names := List(&FixtureHelper{}, &RunConf{Filter: "1"})252 c.Assert(names, DeepEquals, []string{253 "FixtureHelper.Test1",254 })255}256func (s *RunS) TestList(c *C) {257 names := List(&FixtureHelper{}, &RunConf{})258 c.Assert(names, DeepEquals, []string{259 "FixtureHelper.Test1",260 "FixtureHelper.Test2",261 })262}263// -----------------------------------------------------------------------264// Verify that verbose mode prints tests which pass as well.265func (s *RunS) TestVerboseMode(c *C) {266 helper := FixtureHelper{}267 output := String{}268 runConf := RunConf{Output: &output, Verbose: true}269 Run(&helper, &runConf)270 expected := "PASS: check_test\\.go:[0-9]+: FixtureHelper\\.Test1\t *[.0-9]+s\n" +271 "PASS: check_test\\.go:[0-9]+: FixtureHelper\\.Test2\t *[.0-9]+s\n"272 c.Assert(output.value, Matches, expected)273}274func (s *RunS) TestVerboseModeWithFailBeforePass(c *C) {275 helper := FixtureHelper{panicOn: "Test1"}276 output := String{}277 runConf := RunConf{Output: &output, Verbose: true}278 Run(&helper, &runConf)279 expected := "(?s).*PANIC.*\n-+\n" + // Should have an extra line.280 "PASS: check_test\\.go:[0-9]+: FixtureHelper\\.Test2\t *[.0-9]+s\n"281 c.Assert(output.value, Matches, expected)282}283// -----------------------------------------------------------------------284// Verify the stream output mode. In this mode there's no output caching.285type StreamHelper struct {286 l2 sync.Mutex287 l3 sync.Mutex288}289func (s *StreamHelper) SetUpSuite(c *C) {290 c.Log("0")291}292func (s *StreamHelper) Test1(c *C) {293 c.Log("1")294 s.l2.Lock()295 s.l3.Lock()296 go func() {297 s.l2.Lock() // Wait for "2".298 c.Log("3")299 s.l3.Unlock()300 }()301}302func (s *StreamHelper) Test2(c *C) {303 c.Log("2")304 s.l2.Unlock()305 s.l3.Lock() // Wait for "3".306 c.Fail()307 c.Log("4")308}309func (s *RunS) TestStreamMode(c *C) {310 helper := &StreamHelper{}311 output := String{}312 runConf := RunConf{Output: &output, Stream: true}313 Run(helper, &runConf)314 expected := "START: run_test\\.go:[0-9]+: StreamHelper\\.SetUpSuite\n0\n" +315 "PASS: run_test\\.go:[0-9]+: StreamHelper\\.SetUpSuite\t *[.0-9]+s\n\n" +316 "START: run_test\\.go:[0-9]+: StreamHelper\\.Test1\n1\n" +317 "PASS: run_test\\.go:[0-9]+: StreamHelper\\.Test1\t *[.0-9]+s\n\n" +318 "START: run_test\\.go:[0-9]+: StreamHelper\\.Test2\n2\n3\n4\n" +319 "FAIL: run_test\\.go:[0-9]+: StreamHelper\\.Test2\n\n"320 c.Assert(output.value, Matches, expected)321}322type StreamMissHelper struct{}323func (s *StreamMissHelper) SetUpSuite(c *C) {324 c.Log("0")325 c.Fail()326}327func (s *StreamMissHelper) Test1(c *C) {328 c.Log("1")329}330func (s *RunS) TestStreamModeWithMiss(c *C) {331 helper := &StreamMissHelper{}332 output := String{}333 runConf := RunConf{Output: &output, Stream: true}334 Run(helper, &runConf)335 expected := "START: run_test\\.go:[0-9]+: StreamMissHelper\\.SetUpSuite\n0\n" +336 "FAIL: run_test\\.go:[0-9]+: StreamMissHelper\\.SetUpSuite\n\n" +337 "START: run_test\\.go:[0-9]+: StreamMissHelper\\.Test1\n" +338 "MISS: run_test\\.go:[0-9]+: StreamMissHelper\\.Test1\n\n"339 c.Assert(output.value, Matches, expected)340}341// -----------------------------------------------------------------------342// Verify that that the keep work dir request indeed does so.343type WorkDirSuite struct{}344func (s *WorkDirSuite) Test(c *C) {345 c.MkDir()346}347func (s *RunS) TestKeepWorkDir(c *C) {348 output := String{}349 runConf := RunConf{Output: &output, Verbose: true, KeepWorkDir: true}350 result := Run(&WorkDirSuite{}, &runConf)351 c.Assert(result.String(), Matches, ".*\nWORK="+result.WorkDir)352 stat, err := os.Stat(result.WorkDir)353 c.Assert(err, IsNil)354 c.Assert(stat.IsDir(), Equals, true)355}...

Full Screen

Full Screen

RunTest.php

Source:RunTest.php Github

copy

Full Screen

...43 * @covers Whoops\Run::clearHandlers44 */45 public function testClearHandlers()46 {47 $run = $this->getRunInstance();48 $run->clearHandlers();49 $handlers = $run->getHandlers();50 $this->assertEmpty($handlers);51 }52 /**53 * @covers Whoops\Run::pushHandler54 */55 public function testPushHandler()56 {57 $run = $this->getRunInstance();58 $run->clearHandlers();59 $handlerOne = $this->getHandler();60 $handlerTwo = $this->getHandler();61 $run->pushHandler($handlerOne);62 $run->pushHandler($handlerTwo);63 $handlers = $run->getHandlers();64 $this->assertCount(2, $handlers);65 $this->assertContains($handlerOne, $handlers);66 $this->assertContains($handlerTwo, $handlers);67 }68 /**69 * @expectedException InvalidArgumentException70 * @covers Whoops\Run::pushHandler71 */72 public function testPushInvalidHandler()73 {74 $run = $this->getRunInstance();75 $run->pushHandler($banana = 'actually turnip');76 }77 /**78 * @covers Whoops\Run::pushHandler79 */80 public function testPushClosureBecomesHandler()81 {82 $run = $this->getRunInstance();83 $run->pushHandler(function() {});84 $this->assertInstanceOf('Whoops\\Handler\\CallbackHandler', $run->popHandler());85 }86 /**87 * @covers Whoops\Run::popHandler88 * @covers Whoops\Run::getHandlers89 */90 public function testPopHandler()91 {92 $run = $this->getRunInstance();93 $handlerOne = $this->getHandler();94 $handlerTwo = $this->getHandler();95 $handlerThree = $this->getHandler();96 $run->pushHandler($handlerOne);97 $run->pushHandler($handlerTwo);98 $run->pushHandler($handlerThree);99 $this->assertSame($handlerThree, $run->popHandler());100 $this->assertSame($handlerTwo, $run->popHandler());101 $this->assertSame($handlerOne, $run->popHandler());102 // Should return null if there's nothing else in103 // the stack104 $this->assertNull($run->popHandler());105 // Should be empty since we popped everything off106 // the stack:107 $this->assertEmpty($run->getHandlers());108 }109 /**110 * @covers Whoops\Run::register111 */112 public function testRegisterHandler()113 {114 // It is impossible to test the Run::register method using phpunit,115 // as given how every test is always inside a giant try/catch block,116 // any thrown exception will never hit a global exception handler.117 // On the other hand, there is not much need in testing118 // a call to a native PHP function.119 $this->assertTrue(true);120 }121 /**122 * @covers Whoops\Run::unregister123 * @expectedException Exception124 */125 public function testUnregisterHandler()126 {127 $run = $this->getRunInstance();128 $run->register();129 $handler = $this->getHandler();130 $run->pushHandler($handler);131 $run->unregister();132 throw $this->getException("I'm not supposed to be caught!");133 }134 /**135 * @covers Whoops\Run::pushHandler136 * @covers Whoops\Run::getHandlers137 */138 public function testHandlerHoldsOrder()139 {140 $run = $this->getRunInstance();141 $handlerOne = $this->getHandler();142 $handlerTwo = $this->getHandler();143 $handlerThree = $this->getHandler();144 $handlerFour = $this->getHandler();145 $run->pushHandler($handlerOne);146 $run->pushHandler($handlerTwo);147 $run->pushHandler($handlerThree);148 $run->pushHandler($handlerFour);149 $handlers = $run->getHandlers();150 $this->assertSame($handlers[0], $handlerOne);151 $this->assertSame($handlers[1], $handlerTwo);152 $this->assertSame($handlers[2], $handlerThree);153 $this->assertSame($handlers[3], $handlerFour);154 }155 /**156 * @todo possibly split this up a bit and move157 * some of this test to Handler unit tests?158 * @covers Whoops\Run::handleException159 */160 public function testHandlersGonnaHandle()161 {162 $run = $this->getRunInstance();163 $exception = $this->getException();164 $order = new ArrayObject;165 $handlerOne = $this->getHandler();166 $handlerTwo = $this->getHandler();167 $handlerThree = $this->getHandler();168 $handlerOne->shouldReceive('handle')169 ->andReturnUsing(function() use($order) { $order[] = 1; });170 $handlerTwo->shouldReceive('handle')171 ->andReturnUsing(function() use($order) { $order[] = 2; });172 $handlerThree->shouldReceive('handle')173 ->andReturnUsing(function() use($order) { $order[] = 3; });174 $run->pushHandler($handlerOne);175 $run->pushHandler($handlerTwo);176 $run->pushHandler($handlerThree);177 // Get an exception to be handled, and verify that the handlers178 // are given the handler, and in the inverse order they were179 // registered.180 $run->handleException($exception);181 $this->assertEquals((array) $order, array(3, 2, 1));182 }183 /**184 * @covers Whoops\Run::handleException185 */186 public function testLastHandler()187 {188 $run = $this->getRunInstance();189 $handlerOne = $this->getHandler();190 $handlerTwo = $this->getHandler();191 $run->pushHandler($handlerOne);192 $run->pushHandler($handlerTwo);193 $test = $this;194 $handlerOne195 ->shouldReceive('handle')196 ->andReturnUsing(function () use($test) {197 $test->fail('$handlerOne should not be called');198 })199 ;200 $handlerTwo201 ->shouldReceive('handle')202 ->andReturn(Handler::LAST_HANDLER)203 ;204 $run->handleException($this->getException());205 // Reached the end without errors206 $this->assertTrue(true);207 }208 /**209 * Test error suppression using @ operator.210 */211 public function testErrorSuppression()212 {213 $run = $this->getRunInstance();214 $run->register();215 $handler = $this->getHandler();216 $run->pushHandler($handler);217 $test = $this;218 $handler219 ->shouldReceive('handle')220 ->andReturnUsing(function () use($test) {221 $test->fail('$handler should not be called, error not suppressed');222 })223 ;224 @trigger_error("Test error suppression");225 // Reached the end without errors226 $this->assertTrue(true);227 }228 public function testErrorCatching()229 {230 $run = $this->getRunInstance();231 $run->register();232 $handler = $this->getHandler();233 $run->pushHandler($handler);234 $test = $this;235 $handler236 ->shouldReceive('handle')237 ->andReturnUsing(function () use($test) {238 $test->fail('$handler should not be called error should be caught');239 })240 ;241 try {242 trigger_error(E_USER_NOTICE, 'foo');243 $this->fail('Should not continue after error thrown');244 } catch (\ErrorException $e) {245 // Do nothing246 $this->assertTrue(true);247 return;248 }249 $this->fail('Should not continue here, should have been caught.');250 }251 /**252 * Test to make sure that error_reporting is respected.253 */254 public function testErrorReporting()255 {256 $run = $this->getRunInstance();257 $run->register();258 $handler = $this->getHandler();259 $run->pushHandler($handler);260 $test = $this;261 $handler262 ->shouldReceive('handle')263 ->andReturnUsing(function () use($test) {264 $test->fail('$handler should not be called, error_reporting not respected');265 })266 ;267 $oldLevel = error_reporting(E_ALL ^ E_USER_NOTICE);268 trigger_error("Test error reporting", E_USER_NOTICE);269 error_reporting($oldLevel);270 // Reached the end without errors271 $this->assertTrue(true);272 }273 /**274 * @covers Whoops\Run::silenceErrorsInPaths275 */276 public function testSilenceErrorsInPaths()277 {278 $run = $this->getRunInstance();279 $run->register();280 $handler = $this->getHandler();281 $run->pushHandler($handler);282 $test = $this;283 $handler284 ->shouldReceive('handle')285 ->andReturnUsing(function () use($test) {286 $test->fail('$handler should not be called, silenceErrorsInPaths not respected');287 })288 ;289 $run->silenceErrorsInPaths('@^'.preg_quote(__FILE__).'$@', E_USER_NOTICE);290 trigger_error('Test', E_USER_NOTICE);291 $this->assertTrue(true);292 }293 /**294 * @covers Whoops\Run::handleException295 * @covers Whoops\Run::writeToOutput296 */297 public function testOutputIsSent()298 {299 $run = $this->getRunInstance();300 $run->pushHandler(function() {301 echo "hello there";302 });303 ob_start();304 $run->handleException(new RuntimeException);305 $this->assertEquals("hello there", ob_get_clean());306 }307 /**308 * @covers Whoops\Run::handleException309 * @covers Whoops\Run::writeToOutput310 */311 public function testOutputIsNotSent()312 {313 $run = $this->getRunInstance();314 $run->writeToOutput(false);315 $run->pushHandler(function() {316 echo "hello there";317 });318 ob_start();319 $this->assertEquals("hello there", $run->handleException(new RuntimeException));320 $this->assertEquals("", ob_get_clean());321 }322 /**323 * @covers Whoops\Run::sendHttpCode324 */325 public function testSendHttpCode()326 {327 $run = $this->getRunInstance();328 $run->sendHttpCode(true);329 $this->assertEquals(500, $run->sendHttpCode());330 }331 /**332 * @covers Whoops\Run::sendHttpCode333 * @expectedException InvalidArgumentException334 */335 public function testSendHttpCodeWrongCode()336 {337 $this->getRunInstance()->sendHttpCode(1337);338 }339}...

Full Screen

Full Screen

run.go

Source:run.go Github

copy

Full Screen

...9)10// -----------------------------------------------------------------------11// Test suite registry.12var allSuites []interface{}13// Suite registers the given value as a test suite to be run. Any methods14// starting with the Test prefix in the given value will be considered as15// a test method.16func Suite(suite interface{}) interface{} {17 allSuites = append(allSuites, suite)18 return suite19}20// -----------------------------------------------------------------------21// Public running interface.22var (23 oldFilterFlag = flag.String("gocheck.f", "", "Regular expression selecting which tests and/or suites to run")24 oldVerboseFlag = flag.Bool("gocheck.v", false, "Verbose mode")25 oldStreamFlag = flag.Bool("gocheck.vv", false, "Super verbose mode (disables output caching)")26 oldBenchFlag = flag.Bool("gocheck.b", false, "Run benchmarks")27 oldBenchTime = flag.Duration("gocheck.btime", 1*time.Second, "approximate run time for each benchmark")28 oldListFlag = flag.Bool("gocheck.list", false, "List the names of all tests that will be run")29 oldWorkFlag = flag.Bool("gocheck.work", false, "Display and do not remove the test working directory")30 newFilterFlag = flag.String("check.f", "", "Regular expression selecting which tests and/or suites to run")31 newVerboseFlag = flag.Bool("check.v", false, "Verbose mode")32 newStreamFlag = flag.Bool("check.vv", false, "Super verbose mode (disables output caching)")33 newBenchFlag = flag.Bool("check.b", false, "Run benchmarks")34 newBenchTime = flag.Duration("check.btime", 1*time.Second, "approximate run time for each benchmark")35 newBenchMem = flag.Bool("check.bmem", false, "Report memory benchmarks")36 newListFlag = flag.Bool("check.list", false, "List the names of all tests that will be run")37 newWorkFlag = flag.Bool("check.work", false, "Display and do not remove the test working directory")38)39// TestingT runs all test suites registered with the Suite function,40// printing results to stdout, and reporting any failures back to41// the "testing" package.42func TestingT(testingT *testing.T) {43 benchTime := *newBenchTime44 if benchTime == 1*time.Second {45 benchTime = *oldBenchTime46 }47 conf := &RunConf{48 Filter: *oldFilterFlag + *newFilterFlag,49 Verbose: *oldVerboseFlag || *newVerboseFlag,50 Stream: *oldStreamFlag || *newStreamFlag,51 Benchmark: *oldBenchFlag || *newBenchFlag,52 BenchmarkTime: benchTime,53 BenchmarkMem: *newBenchMem,54 KeepWorkDir: *oldWorkFlag || *newWorkFlag,55 }56 if *oldListFlag || *newListFlag {57 w := bufio.NewWriter(os.Stdout)58 for _, name := range ListAll(conf) {59 fmt.Fprintln(w, name)60 }61 w.Flush()62 return63 }64 result := RunAll(conf)65 println(result.String())66 if !result.Passed() {67 testingT.Fail()68 }69}70// RunAll runs all test suites registered with the Suite function, using the71// provided run configuration.72func RunAll(runConf *RunConf) *Result {73 result := Result{}74 for _, suite := range allSuites {75 result.Add(Run(suite, runConf))76 }77 return &result78}79// Run runs the provided test suite using the provided run configuration.80func Run(suite interface{}, runConf *RunConf) *Result {81 runner := newSuiteRunner(suite, runConf)82 return runner.run()83}84// ListAll returns the names of all the test functions registered with the85// Suite function that will be run with the provided run configuration.86func ListAll(runConf *RunConf) []string {87 var names []string88 for _, suite := range allSuites {89 names = append(names, List(suite, runConf)...)90 }91 return names92}93// List returns the names of the test functions in the given94// suite that will be run with the provided run configuration.95func List(suite interface{}, runConf *RunConf) []string {96 var names []string97 runner := newSuiteRunner(suite, runConf)98 for _, t := range runner.tests {99 names = append(names, t.String())100 }101 return names102}103// -----------------------------------------------------------------------104// Result methods.105func (r *Result) Add(other *Result) {106 r.Succeeded += other.Succeeded107 r.Skipped += other.Skipped108 r.Failed += other.Failed109 r.Panicked += other.Panicked110 r.FixturePanicked += other.FixturePanicked111 r.ExpectedFailures += other.ExpectedFailures112 r.Missed += other.Missed...

Full Screen

Full Screen

analysis.go

Source:analysis.go Github

copy

Full Screen

1package simple2import (3 "golang.org/x/tools/go/analysis"4 "golang.org/x/tools/go/analysis/passes/inspect"5 "honnef.co/go/tools/analysis/facts"6 "honnef.co/go/tools/analysis/lint"7 "honnef.co/go/tools/internal/passes/buildir"8)9var Analyzers = lint.InitializeAnalyzers(Docs, map[string]*analysis.Analyzer{10 "S1000": {11 Run: CheckSingleCaseSelect,12 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},13 },14 "S1001": {15 Run: CheckLoopCopy,16 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},17 },18 "S1002": {19 Run: CheckIfBoolCmp,20 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},21 },22 "S1003": {23 Run: CheckStringsContains,24 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},25 },26 "S1004": {27 Run: CheckBytesCompare,28 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},29 },30 "S1005": {31 Run: CheckUnnecessaryBlank,32 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},33 },34 "S1006": {35 Run: CheckForTrue,36 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},37 },38 "S1007": {39 Run: CheckRegexpRaw,40 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},41 },42 "S1008": {43 Run: CheckIfReturn,44 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},45 },46 "S1009": {47 Run: CheckRedundantNilCheckWithLen,48 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},49 },50 "S1010": {51 Run: CheckSlicing,52 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},53 },54 "S1011": {55 Run: CheckLoopAppend,56 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},57 },58 "S1012": {59 Run: CheckTimeSince,60 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},61 },62 "S1016": {63 Run: CheckSimplerStructConversion,64 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},65 },66 "S1017": {67 Run: CheckTrim,68 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},69 },70 "S1018": {71 Run: CheckLoopSlide,72 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},73 },74 "S1019": {75 Run: CheckMakeLenCap,76 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},77 },78 "S1020": {79 Run: CheckAssertNotNil,80 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},81 },82 "S1021": {83 Run: CheckDeclareAssign,84 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},85 },86 "S1023": {87 Run: CheckRedundantBreak,88 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},89 },90 "S1024": {91 Run: CheckTimeUntil,92 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},93 },94 "S1025": {95 Run: CheckRedundantSprintf,96 Requires: []*analysis.Analyzer{buildir.Analyzer, inspect.Analyzer, facts.Generated},97 },98 "S1028": {99 Run: CheckErrorsNewSprintf,100 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},101 },102 "S1029": {103 Run: CheckRangeStringRunes,104 Requires: []*analysis.Analyzer{buildir.Analyzer},105 },106 "S1030": {107 Run: CheckBytesBufferConversions,108 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},109 },110 "S1031": {111 Run: CheckNilCheckAroundRange,112 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},113 },114 "S1032": {115 Run: CheckSortHelpers,116 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},117 },118 "S1033": {119 Run: CheckGuardedDelete,120 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},121 },122 "S1034": {123 Run: CheckSimplifyTypeSwitch,124 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},125 },126 "S1035": {127 Run: CheckRedundantCanonicalHeaderKey,128 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},129 },130 "S1036": {131 Run: CheckUnnecessaryGuard,132 Requires: []*analysis.Analyzer{inspect.Analyzer},133 },134 "S1037": {135 Run: CheckElaborateSleep,136 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},137 },138 "S1038": {139 Run: CheckPrintSprintf,140 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},141 },142 "S1039": {143 Run: CheckSprintLiteral,144 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},145 },146 "S1040": {147 Run: CheckSameTypeTypeAssertion,148 Requires: []*analysis.Analyzer{inspect.Analyzer, facts.Generated},149 },150})...

Full Screen

Full Screen

cli_test.go

Source:cli_test.go Github

copy

Full Screen

1package kli2import (3 "errors"4 "testing"5)6func TestCli(t *testing.T) {7 c := NewCli("test", "description", "0")8 t.Run("Run SetBannerFunction()", func(t *testing.T) {9 c.SetBannerFunction(func(*Cli) string { return "" })10 })11 // t.Run("Run Abort()", func(t *testing.T) {12 // cl := NewCli("test", "description", "0")13 // cl.Abort(errors.New("test error"))14 // })15 t.Run("Run AddCommand()", func(t *testing.T) {16 c.AddCommand(&Command{name: "test"})17 })18 t.Run("Run PrintBanner()", func(t *testing.T) {19 c.PrintBanner()20 })21 t.Run("Run Run()", func(t *testing.T) {22 c.Run("test")23 c.Run()24 c.preRunCommand = func(*Cli) error { return errors.New("testing coverage") }25 c.Run("test")26 })27 t.Run("Run DefaultCommand()", func(t *testing.T) {28 c.DefaultCommand(&Command{})29 })30 t.Run("Run NewSubCommand()", func(t *testing.T) {31 c.NewSubCommand("name", "description")32 })33 t.Run("Run PreRun()", func(t *testing.T) {34 c.PreRun(func(*Cli) error { return nil })35 })36 t.Run("Run BoolFlag()", func(t *testing.T) {37 var variable bool38 c.BoolFlag("bool", "description", &variable)39 })40 t.Run("Run StringFlag()", func(t *testing.T) {41 var variable string42 c.StringFlag("string", "description", &variable)43 })44 t.Run("Run IntFlag()", func(t *testing.T) {45 var variable int46 c.IntFlag("int", "description", &variable)47 })48 t.Run("Run Action()", func(t *testing.T) {49 c.Action(func() error { return nil })50 })51 t.Run("Run LongDescription()", func(t *testing.T) {52 c.LongDescription("long description")53 })54}55func TestCliEmpty(t *testing.T) {56 var mockCli *Cli57 t.Run("Run NewCli()", func(t *testing.T) {58 mockCli = NewCli("name", "description", "version")59 t.Log(mockCli)60 })61 t.Run("Run defaultBannerFunction()", func(t *testing.T) {62 err := defaultBannerFunction(mockCli)63 t.Log(err)64 })65}66func TestCliGlobalFlag(t *testing.T) {67 var rootCli *Cli68 t.Run("rcli -config app.yml create", func(t *testing.T) {69 var cnf string70 rootCli = NewCli("rcli", "description", "version")71 rootCli.StringFlag("config", "Application yaml configuration file", &cnf)72 rootCli.Action(func() error {73 t.Fail()74 return nil75 })76 create := rootCli.NewSubCommand("create", "Create a sonic application")77 create.Action(func() error {78 t.Log("Running Create")79 return nil80 })81 rootCli.Run("-config", "app.yml", "create")82 t.Logf("After Execution cnf: %s", cnf)83 })84 t.Run("rcli -config app.yml create -v", func(t *testing.T) {85 var verb bool86 var cnf string87 rootCli = NewCli("rcli", "description", "version")88 rootCli.StringFlag("config", "Application yaml configuration file", &cnf)89 rootCli.Action(func() error {90 t.Fail()91 return nil92 })93 create := rootCli.NewSubCommand("create", "Create a sonic application")94 create.BoolFlag("v", "Activate verbose", &verb)95 create.Action(func() error {96 if verb == false {97 t.Fail()98 } else {99 t.Log("Running Create with verbose")100 }101 return nil102 })103 rootCli.Run("-config", "app.yml", "create", "-v")104 t.Logf("After Execution")105 })106 t.Run("rcli create -f file.txt", func(t *testing.T) {107 var file string108 rootCli = NewCli("rcli", "description", "version")109 create := rootCli.NewSubCommand("create", "Create a sonic application")110 create.StringFlag("f", "Pass file", &file)111 create.Action(func() error {112 if file == "file.txt" {113 t.Log("Running Create with -f params")114 } else {115 t.Fail()116 }117 return nil118 })119 rootCli.Run("create", "-f", "file.txt")120 t.Logf("After Execution")121 })122 t.Run("rcli -c app.yml create -f file.txt", func(t *testing.T) {123 var cnf string124 var file string125 rootCli = NewCli("rcli", "description", "version")126 rootCli.StringFlag("c", "Pass file", &cnf)127 create := rootCli.NewSubCommand("create", "Create a sonic application")128 create.StringFlag("f", "Pass file", &file)129 create.Action(func() error {130 if file == "file.txt" && cnf == "app.yml" {131 t.Log("Running Create with -f -c flags")132 } else {133 t.Fail()134 }135 return nil136 })137 rootCli.Run("-c", "app.yml", "create", "-f", "file.txt")138 t.Logf("After Execution")139 })140}...

Full Screen

Full Screen

command_test.go

Source:command_test.go Github

copy

Full Screen

...16 t.Run("Run parseFlags()", func(t *testing.T) {17 _, err := c.parseFlags([]string{"test", "flags"})18 t.Log(err)19 })20 t.Run("Run run()", func(t *testing.T) {21 cl := NewCli("test", "description", "0")22 cl.rootCommand.run([]string{"test"})23 cl.rootCommand.subCommandsMap["test"] = &Command{24 name: "subcom",25 shortdescription: "short description",26 hidden: false,27 app: cl,28 }29 cl.rootCommand.run([]string{"test"})30 cl.rootCommand.run([]string{"---"})31 cl.rootCommand.run([]string{"-help"})32 // cl.rootCommand.actionCallback = func() error {33 // println("Hello World!")34 // return nil35 // }36 // cl.rootCommand.run([]string{"test"})37 cl.rootCommand.app.defaultCommand = &Command{38 name: "subcom",39 shortdescription: "short description",40 hidden: false,41 app: cl,42 }43 cl.rootCommand.run([]string{"test"})44 })45 t.Run("Run Action()", func(t *testing.T) {46 c.Action(func() error { return nil })47 })48 t.Run("Run PrintHelp()", func(t *testing.T) {49 cl := NewCli("test", "description", "0")50 // co.shortdescription = ""51 cl.PrintHelp()52 cl.rootCommand.shortdescription = "test"53 cl.PrintHelp()54 cl.rootCommand.commandPath = "notTest"55 cl.PrintHelp()56 cl.rootCommand.longdescription = ""57 cl.PrintHelp()...

Full Screen

Full Screen

cli.php

Source:cli.php Github

copy

Full Screen

...50$application->add(new RunDay11Part1Command());51$application->add(new RunDay11Part2Command());52$application->add(new RunDay12Part1Command());53$application->add(new RunDay12Part2Command());54$application->run();...

Full Screen

Full Screen

run

Using AI Code Generation

copy

Full Screen

1$runner = new \mageekguy\atoum\scripts\runner();2$runner->addTestsFromDirectory(__DIR__.'/tests/units');3$runner->run();4$runner = new \mageekguy\atoum\scripts\runner();5$runner->addTestsFromDirectory(__DIR__.'/tests/units');6$runner->run();7$runner = new \mageekguy\atoum\scripts\runner();8$runner->addTestsFromDirectory(__DIR__.'/tests/units');9$runner->run();10$runner = new \mageekguy\atoum\scripts\runner();11$runner->addTestsFromDirectory(__DIR__.'/tests/units');12$runner->run();13$runner = new \mageekguy\atoum\scripts\runner();14$runner->addTestsFromDirectory(__DIR__.'/tests/units');15$runner->run();16$runner = new \mageekguy\atoum\scripts\runner();17$runner->addTestsFromDirectory(__DIR__.'/tests/units');18$runner->run();19$runner = new \mageekguy\atoum\scripts\runner();20$runner->addTestsFromDirectory(__DIR__.'/tests/units');21$runner->run();22$runner = new \mageekguy\atoum\scripts\runner();23$runner->addTestsFromDirectory(__DIR__.'/tests/units');24$runner->run();25$runner = new \mageekguy\atoum\scripts\runner();26$runner->addTestsFromDirectory(__DIR__.'/tests/units');27$runner->run();

Full Screen

Full Screen

run

Using AI Code Generation

copy

Full Screen

1$run = new \mageekguy\atoum\scripts\runner();2$run->setBootstrapFile('bootstrap.php');3$run->addTestsFromDirectory('tests/units');4$run->addDefaultReport();5$run->run();6require 'vendor/autoload.php';7namespace tests\units;8{9 public function testMy()10 {11 $this->object(new \MyClass())12 ->isInstanceOf('MyClass')13 ;14 }15}16{17}

Full Screen

Full Screen

run

Using AI Code Generation

copy

Full Screen

1use mageekguy\atoum\scripts\runner;2$runner = new runner();3$runner->addTestsFromDirectory('tests/units');4$runner->run();5use mageekguy\atoum\scripts\runner;6$runner = new runner();7$runner->addTestsFromDirectory('tests/units');8$runner->run();9use mageekguy\atoum\scripts\runner;10$runner = new runner();11$runner->addTestsFromDirectory('tests/units');12$runner->run();13use mageekguy\atoum\scripts\runner;14$runner = new runner();15$runner->addTestsFromDirectory('tests/units');16$runner->run();17use mageekguy\atoum\scripts\runner;18$runner = new runner();19$runner->addTestsFromDirectory('tests/units');20$runner->run();21use mageekguy\atoum\scripts\runner;22$runner = new runner();23$runner->addTestsFromDirectory('tests/units');

Full Screen

Full Screen

run

Using AI Code Generation

copy

Full Screen

1use \mageekguy\atoum\scripts;2$runner = new scripts\runner('path/to/your/project');3$runner->addTestsFromDirectory('path/to/your/tests/directory');4$runner->run();5use \mageekguy\atoum\scripts;6$runner = new scripts\runner('path/to/your/project');7$runner->addTestsFromDirectory('path/to/your/tests/directory');8$runner->run();9use \mageekguy\atoum\scripts;10$runner = new scripts\runner('path/to/your/project');11$runner->addTestsFromDirectory('path/to/your/tests/directory');12$runner->run();13use \mageekguy\atoum\scripts;14$runner = new scripts\runner('path/to/your/project');15$runner->addTestsFromDirectory('path/to/your/tests/directory');16$runner->run();17use \mageekguy\atoum\scripts;18$runner = new scripts\runner('path/to/your/project');19$runner->addTestsFromDirectory('path/to/your/tests/directory');20$runner->run();21use \mageekguy\atoum\scripts;22$runner = new scripts\runner('path/to/your/project');23$runner->addTestsFromDirectory('path/to/your/tests/directory');24$runner->run();25use \mageekguy\atoum\scripts;26$runner = new scripts\runner('path/to/your/project');27$runner->addTestsFromDirectory('path/to/your/tests/directory');28$runner->run();29use \mageekguy\atoum\scripts;30$runner = new scripts\runner('path/to/your/project');31$runner->addTestsFromDirectory('path

Full Screen

Full Screen

run

Using AI Code Generation

copy

Full Screen

1$runner = new \mageekguy\atoum\runner();2$runner->addTestsFromDirectory(__DIR__.'/tests/');3$runner->run();4$runner = new \mageekguy\atoum\runner();5$runner->addTestsFromDirectory(__DIR__.'/tests/');6$runner->run();7{8 public function createFile($filePath)9 {10 $file = fopen($filePath, 'w');11 fclose($file);12 }13}14{15 public function testCreateFile()16 {17 $fileCreator = new FileCreator();18 $filePath = '/tmp/test.txt';19 $fileMock = $this->getMockBuilder('stdClass')20 ->setMethods(array('fopen', 'fclose'))21 ->getMock();22 $fileMock->expects($this->once())23 ->method('fopen')24 ->with($filePath, 'w');25 $fileMock->expects($this->once())26 ->method('fclose');27 $fileCreator->createFile($filePath);28 }29}30$fileMock = $this->getMockBuilder('stdClass')31 ->setMethods(array('fopen', 'fclose'))32 ->getMock();33 $fileMock->expects($this->once())34 ->method('fopen')

Full Screen

Full Screen

run

Using AI Code Generation

copy

Full Screen

1$runner = new \mageekguy\atoum\runner();2$runner->addTestsFromDirectory('tests/units');3$script->addDefaultReport();4$runner->run();5namespace tests\units;6use \mageekguy\atoum;7{8public function testAdd()9{10->if($a=2)11->and($b=3)12->integer($a+$b)13->isEqualTo(5)14;15}16}17->if($a=2)18->and($b=3)19->integer($a+$b)20->isEqualTo(5)21;

Full Screen

Full Screen

run

Using AI Code Generation

copy

Full Screen

1require_once 'vendor/autoload.php';2require_once 'lib/Atoum/Run.php';3$runner = new Atoum\Run();4$runner->addTestsFromDirectory('tests');5$runner->run();6require_once 'vendor/autoload.php';7require_once 'lib/Atoum/Run.php';8$runner = new Atoum\Run();9$runner->addTestsFromDirectory('tests');10$runner->run();

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Atoum automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used methods in run

Run Selenium Automation Tests on LambdaTest Cloud Grid

Trigger Selenium automation tests on a cloud-based Grid of 3000+ real browsers and operating systems.

Test now for Free

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful