-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
96477c1
commit d6f67a9
Showing
10 changed files
with
40 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,25 @@ | ||
// SPDX-FileCopyrightText: 2022-2023 Robin Lindén <[email protected]> | ||
// SPDX-FileCopyrightText: 2022-2024 Robin Lindén <[email protected]> | ||
// | ||
// SPDX-License-Identifier: BSD-2-Clause | ||
|
||
#include "etest/etest.h" | ||
#include "etest/etest2.h" | ||
|
||
#include <iostream> | ||
#include <tuple> | ||
|
||
int main() { | ||
etest::Suite s{}; | ||
|
||
bool ran{}; | ||
etest::disabled_test("hi", [&] { ran = true; }); | ||
s.disabled_test("hi", [&](etest::IActions &) { ran = true; }); | ||
|
||
std::ignore = etest::run_all_tests(); | ||
std::ignore = s.run(); | ||
if (ran) { | ||
std::cerr << "A disabled test ran when it shouldn't have\n"; | ||
return 1; | ||
} | ||
|
||
std::ignore = etest::run_all_tests({.run_disabled_tests = true}); | ||
std::ignore = s.run({.run_disabled_tests = true}); | ||
if (!ran) { | ||
std::cerr << "A disabled test didn't run when it should have\n"; | ||
return 1; | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
// SPDX-FileCopyrightText: 2021-2022 Robin Lindén <[email protected]> | ||
// SPDX-FileCopyrightText: 2021-2024 Robin Lindén <[email protected]> | ||
// | ||
// SPDX-License-Identifier: BSD-2-Clause | ||
|
||
#include "etest/etest.h" | ||
#include "etest/etest2.h" | ||
|
||
int main() { | ||
etest::test("this should fail", [] { etest::expect_eq(1, 2); }); | ||
return etest::run_all_tests(); | ||
etest::Suite s{}; | ||
s.add_test("this should fail", [](etest::IActions &a) { a.expect_eq(1, 2); }); | ||
return s.run(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
// SPDX-FileCopyrightText: 2021-2022 Robin Lindén <[email protected]> | ||
// SPDX-FileCopyrightText: 2021-2024 Robin Lindén <[email protected]> | ||
// | ||
// SPDX-License-Identifier: BSD-2-Clause | ||
|
||
#include "etest/etest.h" | ||
|
||
using etest::expect; | ||
#include "etest/etest2.h" | ||
|
||
int main() { | ||
etest::test("this should fail", [] { expect(false); }); | ||
return etest::run_all_tests(); | ||
etest::Suite s{}; | ||
s.add_test("this should fail", [](etest::IActions &a) { a.expect(false); }); | ||
return s.run(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
// SPDX-FileCopyrightText: 2023 Robin Lindén <[email protected]> | ||
// SPDX-FileCopyrightText: 2023-2024 Robin Lindén <[email protected]> | ||
// | ||
// SPDX-License-Identifier: BSD-2-Clause | ||
|
||
#include "etest/etest.h" | ||
#include "etest/etest2.h" | ||
|
||
// If you try to run tests, but none will run due to them all being filtered out | ||
// or something, that's probably an error. | ||
int main() { | ||
bool failure = etest::run_all_tests() != 0; | ||
bool failure = etest::Suite{}.run() != 0; | ||
return failure ? 0 : 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
// SPDX-FileCopyrightText: 2021-2022 Robin Lindén <[email protected]> | ||
// SPDX-FileCopyrightText: 2021-2024 Robin Lindén <[email protected]> | ||
// | ||
// SPDX-License-Identifier: BSD-2-Clause | ||
|
||
#include "etest/etest.h" | ||
#include "etest/etest2.h" | ||
|
||
int main() { | ||
etest::test("this should fail", [] { etest::require_eq(1, 2); }); | ||
return etest::run_all_tests(); | ||
etest::Suite s{}; | ||
s.add_test("this should fail", [](etest::IActions &a) { a.require_eq(1, 2); }); | ||
return s.run(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
// SPDX-FileCopyrightText: 2021-2022 Robin Lindén <[email protected]> | ||
// SPDX-FileCopyrightText: 2021-2024 Robin Lindén <[email protected]> | ||
// | ||
// SPDX-License-Identifier: BSD-2-Clause | ||
|
||
#include "etest/etest.h" | ||
|
||
using etest::require; | ||
#include "etest/etest2.h" | ||
|
||
int main() { | ||
etest::test("this should fail", [] { require(false); }); | ||
return etest::run_all_tests(); | ||
etest::Suite s{}; | ||
s.add_test("this should fail", [](etest::IActions &a) { a.require(false); }); | ||
return s.run(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
// SPDX-FileCopyrightText: 2021 Robin Lindén <[email protected]> | ||
// SPDX-FileCopyrightText: 2021-2024 Robin Lindén <[email protected]> | ||
// | ||
// SPDX-License-Identifier: BSD-2-Clause | ||
|
||
#include "etest/etest.h" | ||
#include "etest/etest2.h" | ||
|
||
int main() { | ||
etest::test("expect", [] { etest::expect(true); }); | ||
etest::test("expect_eq", [] { etest::expect_eq(1, 1); }); | ||
etest::test("require", [] { etest::require(true); }); | ||
etest::test("require_eq", [] { etest::require_eq(1, 1); }); | ||
return etest::run_all_tests(); | ||
etest::Suite s{}; | ||
s.add_test("expect", [](etest::IActions &a) { a.expect(true); }); | ||
s.add_test("expect_eq", [](etest::IActions &a) { a.expect_eq(1, 1); }); | ||
s.add_test("require", [](etest::IActions &a) { a.require(true); }); | ||
s.add_test("require_eq", [](etest::IActions &a) { a.require_eq(1, 1); }); | ||
return s.run(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters