<commit_before>
set(TEST_ENVIRONMENT
  "EXAMPLES_DIR=${CMAKE_BINARY_DIR}/examples SRC_EXAMPLES_DIR=${CMAKE_SOURCE_DIR}/examples PLPLOT_LIB=${CMAKE_SOURCE_DIR}/data/"
)

set(JAVA_TEST_ENVIRONMENT "${TEST_ENVIRONMENT} PLPLOT_JAVA_WRAP_DIR=${CMAKE_BINARY_DIR}/bindings/java/ PLPLOT_CLASSPATH=${CMAKE_BINARY_DIR}/examples/java/plplot.jar")

configure_file(
  plplot-test.sh.cmake
  ${CMAKE_CURRENT_BINARY_DIR}/plplot-test.sh 
  @ONLY
  )

configure_file(test_c.sh.in ${CMAKE_CURRENT_BINARY_DIR}/test_c.sh @ONLY)
set(SCRIPTS test_c.sh)
add_test(examples_c
  sh -c "${TEST_ENVIRONMENT} ./plplot-test.sh --front-end=c"
  )

if(ENABLE_cxx)
  configure_file(test_cxx.sh.in ${CMAKE_CURRENT_BINARY_DIR}/test_cxx.sh @ONLY)
  set(SCRIPTS ${SCRIPTS} test_cxx.sh)
  add_test(examples_cxx
    sh -c "${TEST_ENVIRONMENT} ./plplot-test.sh --front-end=cxx"
  )
endif(ENABLE_cxx)

if(ENABLE_f77)
  configure_file(test_f77.sh.in ${CMAKE_CURRENT_BINARY_DIR}/test_f77.sh @ONLY)
  set(SCRIPTS ${SCRIPTS} test_f77.sh)
  add_test(examples_f77
    sh -c "${TEST_ENVIRONMENT} ./plplot-test.sh --front-end=f77"
  )
endif(ENABLE_f77)

if(ENABLE_f95)
  configure_file(test_f95.sh.in ${CMAKE_CURRENT_BINARY_DIR}/test_f95.sh @ONLY)
  set(SCRIPTS ${SCRIPTS} test_f95.sh)
  add_test(examples_f95
    sh -c "${TEST_ENVIRONMENT} ./plplot-test.sh --front-end=f95"
  )
endif(ENABLE_f95)

if(ENABLE_java)
  configure_file(
    test_java.sh.in 
    ${CMAKE_CURRENT_BINARY_DIR}/test_java.sh 
    @ONLY
    )
  set(SCRIPTS ${SCRIPTS} test_java.sh)
  add_test(examples_java
    sh -c "${JAVA_TEST_ENVIRONMENT} ./plplot-test.sh --front-end=java"
  )
endif(ENABLE_java)

if(ENABLE_octave)
  configure_file(
    test_octave.sh.in 
    ${CMAKE_CURRENT_BINARY_DIR}/test_octave.sh 
    @ONLY
    )
  set(SCRIPTS ${SCRIPTS} test_octave.sh)
endif(ENABLE_octave)
<commit_msg>Add build-tree octave examples test.<commit_after>
set(TEST_ENVIRONMENT
  "EXAMPLES_DIR=${CMAKE_BINARY_DIR}/examples SRC_EXAMPLES_DIR=${CMAKE_SOURCE_DIR}/examples PLPLOT_LIB=${CMAKE_SOURCE_DIR}/data/"
)

set(JAVA_TEST_ENVIRONMENT "${TEST_ENVIRONMENT} PLPLOT_JAVA_WRAP_DIR=${CMAKE_BINARY_DIR}/bindings/java/ PLPLOT_CLASSPATH=${CMAKE_BINARY_DIR}/examples/java/plplot.jar")

configure_file(
  plplot-test.sh.cmake
  ${CMAKE_CURRENT_BINARY_DIR}/plplot-test.sh 
  @ONLY
  )

configure_file(test_c.sh.in ${CMAKE_CURRENT_BINARY_DIR}/test_c.sh @ONLY)
set(SCRIPTS test_c.sh)
add_test(examples_c
  sh -c "${TEST_ENVIRONMENT} ./plplot-test.sh --front-end=c"
  )

if(ENABLE_cxx)
  configure_file(test_cxx.sh.in ${CMAKE_CURRENT_BINARY_DIR}/test_cxx.sh @ONLY)
  set(SCRIPTS ${SCRIPTS} test_cxx.sh)
  add_test(examples_cxx
    sh -c "${TEST_ENVIRONMENT} ./plplot-test.sh --front-end=cxx"
  )
endif(ENABLE_cxx)

if(ENABLE_f77)
  configure_file(test_f77.sh.in ${CMAKE_CURRENT_BINARY_DIR}/test_f77.sh @ONLY)
  set(SCRIPTS ${SCRIPTS} test_f77.sh)
  add_test(examples_f77
    sh -c "${TEST_ENVIRONMENT} ./plplot-test.sh --front-end=f77"
  )
endif(ENABLE_f77)

if(ENABLE_f95)
  configure_file(test_f95.sh.in ${CMAKE_CURRENT_BINARY_DIR}/test_f95.sh @ONLY)
  set(SCRIPTS ${SCRIPTS} test_f95.sh)
  add_test(examples_f95
    sh -c "${TEST_ENVIRONMENT} ./plplot-test.sh --front-end=f95"
  )
endif(ENABLE_f95)

if(ENABLE_java)
  configure_file(
    test_java.sh.in 
    ${CMAKE_CURRENT_BINARY_DIR}/test_java.sh 
    @ONLY
    )
  set(SCRIPTS ${SCRIPTS} test_java.sh)
  add_test(examples_java
    sh -c "${JAVA_TEST_ENVIRONMENT} ./plplot-test.sh --front-end=java"
  )
endif(ENABLE_java)

if(ENABLE_octave)
  configure_file(
    test_octave.sh.in 
    ${CMAKE_CURRENT_BINARY_DIR}/test_octave.sh 
    @ONLY
    )
  set(SCRIPTS ${SCRIPTS} test_octave.sh)
  add_test(examples_octave
    sh -c "${TEST_ENVIRONMENT} ./plplot-test.sh --front-end=octave"
  )
endif(ENABLE_octave)

{'fraction_non_alphanumeric': 0.137546468401487, 'fraction_numerical': 0.01486988847583643, 'mean_word_length': 5.0368589743589745, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1735336', 'n_tokens_mistral': 1716, 'n_tokens_neox': 1660, 'n_words': 190}