Skip to content

Commit

Permalink
tests: perf: build but exclude performance tests by default
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pks-t committed Jan 3, 2018
1 parent b8c1449 commit 543ec14
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ENDIF()

ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/clar.suite
COMMAND ${PYTHON_EXECUTABLE} generate.py -o "${CMAKE_CURRENT_BINARY_DIR}" -f -xonline -xstress .
COMMAND ${PYTHON_EXECUTABLE} generate.py -o "${CMAKE_CURRENT_BINARY_DIR}" -f -xonline -xstress -xperf .
DEPENDS ${SRC_TEST}
WORKING_DIRECTORY ${CLAR_PATH}
)
Expand Down
13 changes: 0 additions & 13 deletions tests/perf/merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,7 @@
#define ID_BRANCH_A "d853fb9f24e0fe63b3dce9fbc04fd9cfe17a030b"
#define ID_BRANCH_B "1ce9ea3ba9b4fa666602d52a5281d41a482cc58b"


void test_perf_merge__initialize(void)
{
}

void test_perf_merge__cleanup(void)
{
}

void test_perf_merge__m1(void)
{
#if 1
cl_skip();
#else
perf__do_merge(SRC_REPO, "m1", ID_BRANCH_A, ID_BRANCH_B);
#endif
}

0 comments on commit 543ec14

Please sign in to comment.