Skip to content

Commit 543ec14

Browse files
committed
tests: perf: build but exclude performance tests by default
Our performance tests (or to be more concrete, our single performance test) are not built by default, as they are always #ifdef'd out. While it is true that we don't want to run performance tests by default, not compiling them at all may cause code rot and is thus an unfavorable approach to handle this. We can easily improve this situation: this commit removes the #ifdef, causing the code to always be compiled. Furthermore, we add `-xperf` to the default command line parameters of `generate.py`, thus causing the tests to be excluded by default. Due to this approach, we are now able to execute the performance tests by passing `-sperf` to `libgit2_clar`. Unfortunately, we cannot execute the performance tests on Travis or AppVeyor as they rely on history being available for the libgit2 repository. As both do a shallow clone only, though, this is not given.
1 parent b8c1449 commit 543ec14

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ENDIF()
2020

2121
ADD_CUSTOM_COMMAND(
2222
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/clar.suite
23-
COMMAND ${PYTHON_EXECUTABLE} generate.py -o "${CMAKE_CURRENT_BINARY_DIR}" -f -xonline -xstress .
23+
COMMAND ${PYTHON_EXECUTABLE} generate.py -o "${CMAKE_CURRENT_BINARY_DIR}" -f -xonline -xstress -xperf .
2424
DEPENDS ${SRC_TEST}
2525
WORKING_DIRECTORY ${CLAR_PATH}
2626
)

tests/perf/merge.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,7 @@
2525
#define ID_BRANCH_A "d853fb9f24e0fe63b3dce9fbc04fd9cfe17a030b"
2626
#define ID_BRANCH_B "1ce9ea3ba9b4fa666602d52a5281d41a482cc58b"
2727

28-
29-
void test_perf_merge__initialize(void)
30-
{
31-
}
32-
33-
void test_perf_merge__cleanup(void)
34-
{
35-
}
36-
3728
void test_perf_merge__m1(void)
3829
{
39-
#if 1
40-
cl_skip();
41-
#else
4230
perf__do_merge(SRC_REPO, "m1", ID_BRANCH_A, ID_BRANCH_B);
43-
#endif
4431
}

0 commit comments

Comments
 (0)