Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1048879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:31:39+00:00 2026-05-16T16:31:39+00:00

I need to use a file for one of my tests written using Check

  • 0

I need to use a file for one of my tests written using Check. I initially hardcoded the path, which worked fine. However, this didn’t work when the code is built outside of the source directory. I came up with the following solution which somewhat works. (I then prefix pathnames with TESTS_DIR)

# Set correct directory for test files
AS_IF([test "x$srcdir" = x.],
      [TESTS_DIR=""],
      [TESTS_DIR="$srcdir/tests/"])
AC_DEFINE_UNQUOTED([TESTS_DIR], ["$TESTS_DIR"], [directory for test files])

Unfortunately, this fails again for make distcheck. I could post specific path layouts and structures, but I’m wondering if there’s an “easy” way to refer to files in the source directory in all these cases. Thanks!

UPDATE: I’ve tried to use absolute paths, but it seems $abs_top_srcdir isn’t set when I tried to update the define in configure.ac. Any thoughts as to why that is would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T16:31:40+00:00Added an answer on May 16, 2026 at 4:31 pm

    I discovered that the problem was that $top_srcdir is not set at configure time. Instead, I added -DTESTS_DIR="\"$(top_srcdir)/tests/\"" to AM_CFLAGS in my tests Makefile.am and also added all directories containing test files to EXTRA_DIST.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Limit file format when using <input type=file>? I need to use the
I was following this tutorial . I need to use a php file's ouput
As per [http://lessons.goxtk.com/09/][1] [1]: http://lessons.goxtk.com/09/ i need to use a .vtk file with 15,000
I need to use the Scanner class to read a file and count how
What encoding we need to use to save a file as text file(of type
I need to use comb filter/transform to detect fundamental frequency of a wav file
when you need to use a function you include a header file but wheres
I have a xsl file where i need to use parameters from an external
I have the following links in a sql dump file(.sql). I need to use
Consider the path to a file like this: \\Tests\Results\knowles\project\LU\D15\RUN1\Results.xml How can I make a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.