mirror of
https://github.com/joncampbell123/dosbox-x.git
synced 2025-10-14 02:17:36 +08:00
make unit tests available in all debug builds
This commit is contained in:
@@ -18,22 +18,7 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/* This sample shows how to write a simple unit test for dosbox-staging using
|
||||
* Google C++ testing framework.
|
||||
*
|
||||
* Read Google Test Primer for reference of most available features, macros,
|
||||
* and guidance about writing unit tests:
|
||||
*
|
||||
* https://github.com/google/googletest/blob/master/googletest/docs/primer.md#googletest-primer
|
||||
*/
|
||||
|
||||
/* Include necessary header files; order of headers should be as follows:
|
||||
*
|
||||
* 1. Header declaring functions/classes being tested
|
||||
* 2. <gtest/gtest.h>, which declares the testing framework
|
||||
* 3. Additional system headers (if needed)
|
||||
* 4. Additional dosbox-staging headers (if needed)
|
||||
*/
|
||||
#if C_DEBUG
|
||||
|
||||
#include "../src/dos/drives.h"
|
||||
|
||||
@@ -163,3 +148,4 @@ TEST(Set_Label, InvalidCharsEndingDotCD)
|
||||
}
|
||||
|
||||
} // namespace
|
||||
#endif
|
||||
|
9
tests/readme.txt
Normal file
9
tests/readme.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
Source files in this subdirectory contain unit tests.
|
||||
They use GTest and GMock for running unit testing.
|
||||
Unit tests can be launched with "dosbox-x -tests".
|
||||
Free free to add more unit tests in this directory.
|
||||
|
||||
Read Google Test Primer for reference of most available
|
||||
features, macros, and guidance about writing unit tests:
|
||||
|
||||
https://google.github.io/googletest/primer.html
|
@@ -18,22 +18,7 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/* This sample shows how to write a simple unit test for dosbox-staging using
|
||||
* Google C++ testing framework.
|
||||
*
|
||||
* Read Google Test Primer for reference of most available features, macros,
|
||||
* and guidance about writing unit tests:
|
||||
*
|
||||
* https://github.com/google/googletest/blob/master/googletest/docs/primer.md#googletest-primer
|
||||
*/
|
||||
|
||||
/* Include necessary header files; order of headers should be as follows:
|
||||
*
|
||||
* 1. Header declaring functions/classes being tested
|
||||
* 2. <gtest/gtest.h>, which declares the testing framework
|
||||
* 3. Additional system headers (if needed)
|
||||
* 4. Additional dosbox-staging headers (if needed)
|
||||
*/
|
||||
#if C_DEBUG
|
||||
|
||||
#include "shell.h"
|
||||
|
||||
@@ -190,3 +175,4 @@ TEST_F(DOS_Shell_CMDSTest, CMD_ECHO_space_handling)
|
||||
}
|
||||
|
||||
} // namespace
|
||||
#endif
|
||||
|
22
tests/tests.h
Normal file
22
tests/tests.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#if C_DEBUG
|
||||
|
||||
// The following includes necessary GTest/GMock source files for unit tests.
|
||||
// Launch DOSBox-X with -tests option in debug builds to run unit tests.
|
||||
|
||||
#include "../../tests/gmock/gmock-cardinalities.cc"
|
||||
#include "../../tests/gmock/gmock-internal-utils.cc"
|
||||
#include "../../tests/gmock/gmock-spec-builders.cc"
|
||||
#include "../../tests/gmock/gmock.cc"
|
||||
#include "../../tests/gtest/gtest-death-test.cc"
|
||||
#include "../../tests/gtest/gtest-filepath.cc"
|
||||
#include "../../tests/gtest/gtest-port.cc"
|
||||
#include "../../tests/gtest/gtest-printers.cc"
|
||||
#include "../../tests/gtest/gtest-test-part.cc"
|
||||
#include "../../tests/gtest/gtest.cc"
|
||||
|
||||
// The following are source files containing unit tests.
|
||||
|
||||
#include "../../tests/drives_tests.cpp"
|
||||
#include "../../tests/shell_cmds_tests.cpp"
|
||||
|
||||
#endif // DEBUG
|
Reference in New Issue
Block a user