-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Adam Treat <treat.adam@gmail.com> Signed-off-by: Jared Van Bortel <jared@nomic.ai> Co-authored-by: Jared Van Bortel <jared@nomic.ai>
- Loading branch information
1 parent
c3357b7
commit 9cafd38
Showing
5 changed files
with
57 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
include(FetchContent) | ||
|
||
find_package(Python3 REQUIRED COMPONENTS Interpreter) | ||
|
||
# Google test download and setup | ||
FetchContent_Declare( | ||
googletest | ||
URL https://github.com/google/googletest/archive/refs/tags/v1.15.2.zip | ||
) | ||
FetchContent_MakeAvailable(googletest) | ||
|
||
add_test(NAME ChatPythonTests | ||
COMMAND ${Python3_EXECUTABLE} -m pytest ${CMAKE_SOURCE_DIR}/tests/python_tests | ||
) | ||
set_tests_properties(ChatPythonTests PROPERTIES | ||
ENVIRONMENT "CHAT_EXECUTABLE=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/chat" | ||
TIMEOUT 60 | ||
) | ||
|
||
add_executable(gpt4all_tests | ||
test_main.cpp | ||
basic_test.cpp | ||
) | ||
|
||
target_link_libraries(gpt4all_tests PRIVATE gtest gtest_main) | ||
|
||
include(GoogleTest) | ||
gtest_discover_tests(gpt4all_tests) |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include <gtest/gtest.h> | ||
|
||
TEST(BasicTest, TestInitialization) { | ||
EXPECT_TRUE(true); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import os | ||
|
||
import pytest | ||
|
||
# test that the chat executable exists | ||
def test_chat_environment(): | ||
assert os.path.exists(os.environ['CHAT_EXECUTABLE']) |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <gtest/gtest.h> | ||
|
||
int main(int argc, char **argv) { | ||
::testing::InitGoogleTest(&argc, argv); | ||
return RUN_ALL_TESTS(); | ||
} |